Commit Graph

1095 Commits

Author SHA1 Message Date
Venkata Sharath Chandra Manchala
cb6d0c0741 qcacmn: Create a wlan configuration table for ring types
1. Add config table to accommodate per ring type
   configuration to have a finer control over the
   ring.
2. Provide struct wlan_srng_cfg interface to add
   more parameters to control the ring.
3. Add interrupt threshold configuration parameters
   to wlan_srng_cfg structure.
4. Add WLAN_CFG_INT_TIMER_THRESHOLD_WBM_RELEASE_RING
   and WLAN_CFG_INT_TIMER_THRESHOLD_REO_RING to have
   different timer values for REO and WBM ring.

Change-Id: Ied50e3241ab2cc181ca4ed7f126959cd5d9d2de5
CRs-Fixed: 2455297
2019-06-20 18:36:24 -07:00
Mainak Sen
95101bb281 qcacmn: Remove CONFIG_WIN flag for VoW stats
Use V3_STATS_ENABLED flag instead of CONFIG_WIN

Change-Id: I1559d67f005c4cba2472970ea3bd49826c16a047
2019-06-20 14:45:24 -07:00
Jinwei Chen
e1ffcf089e qcacmn: fix monitor packets radiotap channel incorrect issue
The channel number is always 0 from HAL RX PPDU TLV, then monitor
mode frames radiotap channel frequency is always 2407, get the
correct channel number that we saved when set monitor channel.

Change-Id: Ib927fe9aca3a4c1f98845fe37c9b1d37d1d6cf5a
CRs-Fixed: 2471161
2019-06-19 10:33:06 -07:00
Vivek
030ffadb08 qcacmn: Free srng buffer only when allocation is successful
In srng setup, we set srng alloc size, and allocate memory
for srng buffers.
Even if allocation fails, srng alloc size is set,
which is done even before the allocation is attempted.

In srng clean up path, we attempt to free the memory,
since srng alloc size is set,
but for which allocation had failed,

Instead, when freeing srng buffers, check if we have
a valid address also for srng buffer and then free,
instead of checking srng alloc size only.

Change-Id: I1f2de526e27b7b8d97535bf4c2235c82ffd3ce5f
CRs-Fixed: 2452219
2019-06-18 12:25:57 -07:00
Varun Reddy Yeturu
f31e44d8dc qcacmn: Fix memory allocation failure for nbuf pointers
Fix memory allocation failure for nbuf pointers array in
dp_pdev_rx_buffers_attach(), by allocating a single page
of memory for the pointers and re-using them by iterating
in a loop until the total required nbuf's are traversed,
instead of allocating a huge contiguous memory for pointers
to store the address locations of all the nbuf's.

Change-Id: I47ca8f94405e44d6bdbc43129012df1b65b14ba6
CRs-Fixed: 2464598
2019-06-18 12:25:53 -07:00
Tallapragada Kalyan
ae7baa998f qcacmn: disable cached descriptor support if NSS is enabled
disable cached descriptor support if NSS is enabled

Change-Id: If0eee42dc07947944e39ef6d98de271ce79419ac
2019-06-17 18:24:34 -07:00
Rakesh Pillai
2529ae1c8a qcacmn: Add event history logs for datapath
Add support to log the important events in
datapath, which will help in debugging the
datapath issues.

IRQ handler, Napi poll and srng access start/end
are the events which are currently logged.

CRs-Fixed: 2457854
Change-Id: Iba105b0e79443b670a01a929f999f94e00ea92f2
2019-06-17 10:23:01 -07:00
jiad
a833f30506 qcacmn: Properly map RX buffer pool to IPA SMMU domain
Currently for WDI 3.0, IPA runtime enablement is done in the
way that dp_ipa_enable_pipes API is first invoked and followed
by dp_ipa_enable_autonomy API. With SMMU S1 enabled, RX buffers
are mapped to IPA domain in dp_ipa_enable_autonomy. However RX
buffers could be provided to IPA once after dp_ipa_enable_pipes
and this could lead to possible SMMU fault.

Fix is to map RX buffers to IPA domain before dp_ipa_enable_pipes
API.

Change-Id: Ifdad2db6fa26da06a91b84de8f8603cbc779dd67
CRs-Fixed: 2467966
2019-06-17 06:23:28 -07:00
Tallapragada Kalyan
cea9c935f9 qcacmn: Do not check for msdu Done bit for raw packets
Do not check for msdu Done bit for raw packets as HW
does not set this bit for msdus spread across nbufs.

Change-Id: I9c2af01c6b55600511abeec9ab6fc185fcc6ef36
2019-06-17 02:18:25 -07:00
Mohit Khanna
3ba9372a50 qcacmn: Fix invalid sa_da_idx condition in RX path
Currenly this function, is_sa_da_idx_valid(), called from dp_rx_process
does not take MC/BC packets into account. For broadcast packets e.g.
DHCP offer packets from some APs, this check may fail (incorrectly).
Thus dropping the broadcast packet, when it should have been passed
on to the stack.

Fix is_sa_da_idx_valid function by taking MC/BC packets into account.

Change-Id: Ibbb34134e997e0d5394dfa654be84b9fa43434a3
CRs-Fixed: 2466839
2019-06-15 20:55:03 -07:00
Tallapragada Kalyan
f3af8bb319 qcacmn: unmap raw mode nbufs in failure cases
currently we are not unmapping the nbuf which was
already mapped in dp_tx_raw_prepare in failure cases
We always need to unmap and free the nbuf if its mapped.

Change-Id: Ia5e6a31a7aac356a934ff2496d0542039bc3ece7
CRs-Fixed: 2462518
2019-06-14 18:19:45 -07:00
Mainak Sen
7258660417 qcacmn: Disable print FW Dropped byte in offload
Disable printing TX FW remove byte counter for NSS offload mode

Change-Id: I44cd80a4d07082f91cfdbfff9a9bc94d4c31bb86
2019-06-14 10:21:10 -07:00
Amir Patel
420a8d3c6d qcacmn: Add bss peer check for rate stats flush request
To avoid flushing bss peer rate stats, add bss peer check
for rate stats flush request

Change-Id: If69ec38efca2b447f3fafa080bafae75017e50fc
2019-06-14 06:15:33 -07:00
Varun Reddy Yeturu
a0bb4d6ec1 qcacmn: Free the Rx descriptor pool in error case
Free the Rx descriptors pool if there is a failure
in allocating memory for nbuf during
dp_pdev_rx_buffers_attach()

Change-Id: If4fcfcfdc2fe70c8c4753518ca020a7d8b0bd2b5
CRs-Fixed: 2464596
2019-06-13 13:56:27 -07:00
Akshay Kosigi
fb0877f2d6 qcacmn: Use module specific kbuilds for config params
write module specific macros inside module/config and
use these inc files inside the kbuild of the module using those
macros.

Change-Id: Ide18770973f35d0e5c45e2474b24256107f40d8c
2019-06-12 20:04:12 -07:00
Varun Reddy Yeturu
83a31a34b0 qcacmn: Add debug log in dp_tx_delete_flow_pool
Add debug log in dp_tx_delete_flow_pool() to know if
all available tx descriptors have been released to the
pool or not

Change-Id: Id0684effd5c5c0b531bb2d4b3f08d929aaa85b5c
CRs-Fixed: 2463632
2019-06-12 17:46:01 -07:00
Amir Patel
1d4ac98ffe qcacmn: Add rssi_chain support for lithium
Read rssi_chain per nss per bw and from rx status TLVs
and update to host data structures.

CRs-Fixed: 2445933
Change-Id: I275e9e502a0a724410fc189ac293cadc8f2981e0
2019-06-12 17:45:57 -07:00
Amir Patel
70f3c3001b qcacmn: Update Access category stats only for data TIDs
Currently AC stats are getting updated for data tid as
well as non-data tid. Add check to update stats only for
data tids

CRs-Fixed: 2455781
Change-Id: I69d7a11f0101a5c3c6c7e5b0df3e190437990188
2019-06-10 07:28:19 -07:00
jiad
9a1368c4ca qcacmn: Map REO reinject packets to IPA SMMU domain
SMMU fault is seen in REO reinject path since skb buffer
is not mapped to IPA SMMU domain. Thus map skb buffer
to IPA domain in REO reinject path.

Change-Id: I293353bfce961324af6c6372611e8a57cc13f347
CRs-Fixed: 2463376
2019-06-10 04:11:30 -07:00
Keyur Parekh
b8149a540c qcacmn: Fix for Not sending Deauth to non-authed STA
If any non authed clients send data packets then
AP should send Deauth Frames to STA. In Current code
we are finding VAP from pdev. And if MAC address are
same for VAPs on both radios then pdev will be wrong.
Because of that VDEV id was coming for non active VAP
and deauth frames were not going out of AP.

Change-Id: Ia28ea4143cec9c876313211962ab98b0e4028ee8
2019-06-10 02:37:43 -07:00
Amir Patel
5dc47f56dc qcacmn: Move multicast enhancement feature out of common code
Move WIN specific multicast enhancement feature API/data
structure outside common code

Change-Id: I35b10d61bd969a4ab6a864a55dd215049981c0c9
2019-06-07 03:23:56 -07:00
Shashikala Prabhu
0bb59b225f qcacmn: Do not try to alloc memory again when qdf_nuf_alloc fails
Do not try to allocate the memory again when qdf_nbuf_alloc fails in
dp_rx_buffers_replenish().

Change-Id: Iafbe10021bf9f53d93a20d4c8e9543ca6f8aff8a
CRs-Fixed: 2463258
2019-06-06 13:02:25 -07:00
Balamurugan Mahalingam
ee6ca9bbc7 qcacmn: reset hw ring intr mask to skip WMAC2 irq
IPQ6018 platform has only two LMAC.
Disable registering interrupts for third hw ring.

Change-Id: I5a68e8c09ac53603cfa50c798b167af12bc3bbc4
2019-06-05 12:56:44 -07:00
Balaganapathy Palanisamy
6e4b4b8aaa qcacmn: Use uint16 for peer ID
Peer ID can be 16bit wide, use unsigned short to avoid
overflow.

Change-Id: I5139991fc83f38ec0ddb1d658bf5dd60b42f50eb
2019-06-04 20:22:46 -07:00
Ankit Kumar
2972a24c55 qcacmn: Ignore raw frame if is not of type Data
Non raw traffic gets enqueued to VAP in raw mode
and incorrect fc.type causes HW fault.
Lets proceed only if raw frame is of type data.

Change-Id: I9f0d608cd1b319feb9af642969b258aab813645f
CRs-Fixed: 2434391
2019-06-04 02:42:23 -07:00
Manjunathappa Prakash
85de96c698 qcacmn: Do not honor addba response Tx failure in roaming
Add callback to get the roaming status and do not honor addba
response Tx failure.

Change-Id: I148542fc3c629749fc08623f5041f6ca76fee298
CRs-Fixed: 2439721
2019-06-03 02:27:06 -07:00
Aditya Sathish
8482a0c0fc qcacmn: Add support to update vdev stats through CDP
Add CDP support to update vdev stats from the higher
layers.

The CDP API takes a buffer which is then used to
update parts the cdp_vdev_stats structure depending
on the stats ID that is sent through the API.

This change adds support for vdev tx ingress stats
only. Extended support can be added as required
by adding a new stats ID.

Change-Id: I13d6fb946c8a3dbb0b499b7b026d83b080411d15
CRs-Fixed: 2384177
2019-06-01 05:09:23 -07:00
Jinwei Chen
40de1db036 qcacmn: Fix RX defrag lock destroy without create issue
current Soc RX defrag lock create/destroy flow as below:
1. dp_soc_attach_wifi3
2. dp_pdev_attach_wifi3-->dp_soc_cmn_setup-->RX defrag lock create
3. dp_pdev_detach_wifi3 (no RX defrag lock detroy)
4. dp_soc_detach_wifi3 --->RX defrag lock destroy
here if step2 is skipped for some failure case, step4 will still
try to destroy RX defrag lock, panic happened.

add dp_soc_cmn_cleanup() function in step3, move RX defrag lock
destroy from step4 to step3 dp_pdev_detach_wifi3-->
dp_soc_cmn_cleanup, also move others like reo cmd lock, tx flow
control related lock.

Change-Id: Ic77ddf21e9cefc6d6b747aaad227c732fa2ae2c4
CRs-Fixed: 2447701
2019-05-31 14:50:45 -07:00
Rakesh Pillai
6c1cdf307a qcacmn: Fix memory leak in dp pdev attach failure case
Currently the failure in dp_rx_pdev_mon_attach, during
dp_pdev_attach_wifi3, does not cleanup the rx buffers
and hence that memory is leaked.

Follow the proper cleanup sequence to avoid leaking
the rx buffer memory.

CRs-Fixed: 2451982
Change-Id: Idef308e11c46fe3e7ae9199a6fcf05ca83210b6b
2019-05-31 07:40:22 -07:00
Varsha Mishra
1f4cfb6c58 qcacmn: Fix tx completion and rx stats per wbm/reo ring
Tx completion stats should be counted per wbm ring on tx completion
and not globally. Similarly, rx stats should be counter per reo ring.
Change-Id: I1e4af0d38b23e60de78ca03316861db08ff0811a
2019-05-31 07:40:18 -07:00
jiad
3c91fb553a qcacmn: Set default REO destination ring to SW4
For MDM platforms, set default REO destination
ring to SW4 for STA vdev, which is same as SAP vdev.

Note that RX hashing is still enabled for STA vdev.
Also REO destination are run-time remapped when IPA
automony is enabled and disabled.

Change-Id: I49fa523673e7b736008679adec55821e198e8417
CRs-Fixed: 2456786
2019-05-31 02:29:59 -07:00
Karunakar Dasineni
acc8b565b3 qcacmn: Protocol tag support in lite rx monitor
Add protocol tagging support in lite rx monitor mode.

Change-Id: I1966fc4f54e1f4a1486162a88853f68f7644a766
CRs-Fixed: 2448517
2019-05-30 19:29:52 -07:00
Yue Ma
ac6b275768 qcacmn: Record caller and timestamp for pm_runtime_mark_last_busy
pm_runtime_mark_last_busy will extend the timer for runtime suspend.
Recording caller and timestamp can help to debug who may prevent
runtime PM suspend.

Change-Id: I4848a2558197e0fc9b7300421a5a1993817333e4
CRs-fixed: 2457803
2019-05-30 19:29:48 -07:00
Varsha Mishra
27c5bd3193 qcacmn: Handle tx_sniffer pakcets
Send tx_sniffer to firmware and handle ppdu completions accordingly.

Change-Id: Id19a8cba4fdcad88bca6ade8c30a587c2da26d19
2019-05-29 16:47:01 -07:00
Rakesh Pillai
51264a63e1 qcacmn: Disable excessive logging during dp init
Excessive logging during dp init causes watchdog
bite when multiple init-deinit cycle is followed.

Change the loglevel to debug, so that it does not
flood the console with logs.

CRs-Fixed: 2444944
Change-Id: I43daab413800424651e3f5edf558360886d7d7fe
2019-05-29 11:08:25 -07:00
Amir Patel
cb99026ade qcacmn: Move WDS feature out of common code
Move WDS feature specific APIs out of common code
as these features are WIN specific. Keep the usage inside
common code under feature specific flags.

Change-Id: Id907a5e22c27fc47e8314449e154525684a27e85
2019-05-29 11:08:21 -07:00
Chaithanya Garrepalli
ab234e56f6 qcacmn: Add Cached Descriptor support for DP SRNGs
Add support to configure any HAL SRNG descriptor to
be allocated from cached memory area. This is to
optimize of CPU cycles spent on uncached
memory accesses. Also added prefetch of cached
descriptors

Change-Id: I2544e8596d48e2f5549bf687a764c16d73397545
CRs-fixed: 2267945
2019-05-29 11:08:12 -07:00
Venkateswara Swamy Bandaru
9646895cad qcacmn: Fix KW issue related to meta header size
Increase the meta header size as per new ext2 descriptor.

Change-Id: I2cb1cc8399b15b9b784c5a5169d15223dfc5f0e4
CRs-Fixed: 2457693
2019-05-29 11:08:04 -07:00
Santosh Anbu
c2b2c77261 qcacmn: Remove unused peer mgmt stats
Peer delete request and response stats has been moved to per vap
stats. The time info on assoc, disassoc and deauth was already
cleaned up, but members in the dp_peer struct weren't removed.

Change-Id: Ie4a1b171178d8ad03abd76069cc0777802814993
CRs-Fixed: 2451766
2019-05-29 11:07:59 -07:00
Tallapragada Kalyan
f7b0f745c4 qcacmn: Make HTT PPDU TLV processing backward compatible
For HTT PPDU Stats TLVs, if target has provided less data than expected,
pad the data with zeros until it matches the expected length and
process the TLV, instead of     asserting.

This enables testing of different FW and Host versions during regression
analysis.

CRs-Fixed: 2451611
Change-Id: I79aaad8a6fde6d49510c3a212b21425ac784ad5c
2019-05-29 10:59:01 -07:00
Varun Reddy Yeturu
23fbb8796b qcacmn: Free pdev configuration parameters during pdev detach
Free the memory allocated for the pdev configuration parameters
during pdev detach so that there are no memory leaks

Change-Id: I856cc6e6082197e98ad105053f1e4cffc2d25c53
CRs-Fixed: 2444000
2019-05-27 04:23:32 -07:00
nwzhao
d7196d8dd4 qcacmn: fix rx path dma-inv-range, unmap-single issues
In case of duplicated rx descriptors from hardware,
it will hit issues in __dma_inv_range(), __qdf_nbuf_unmap_single.
Detect the duplicates, skip processing them, drop the mpdu.

CRs-Fixed: 2413816
Change-Id: I7efd4b0c1bda5578578927bb22fe9d487758897d
2019-05-24 12:17:55 -07:00
Varun Reddy Yeturu
a7c21dc7f3 qcacmn: Allocate multi page memory for dp_rx_desc_pool_alloc
Allocate memory in multiple smaller chunks for dp_rx_desc_pool_alloc,
and link the pages instead of allocating one big contiguous memory to
avoid memory allocation failures.

Change-Id: Id81de10727555c4ca78963a6f01ed3b992ce9924
CRs-Fixed: 2443999
2019-05-23 20:35:07 -07:00
Jeffin Mammen
1514e796b6 qcacmn: Update Peer rx/tx rate based on DATA packets
Packets sent/received at fixed rate were also considered to
update the client rates as displayed in wlanconfig command output.
An idle client transmits NULL packets at basic rate and hence
rx rate shows up the basic rate when an idle client is connected.
Consider only data packets to update rates. Do not consider
NULL packets for rate update.
CRs-Fixed: 2435447

Change-Id: Icbf9f2a656bb0d36e16d953952c529185c119f17
2019-05-23 09:31:11 -07:00
Sravan Kumar Kairam
5b8283fe08 qcacmn: Flush rx cache frames at peer delete
Currently cached rx buffer frames are forwarded to stack
at the time of successful association completion. If the
association with the AP is unsuccessful frames are not
flushed and this leads to memory leak. To fix this clear
the cached buffers at the time of peer deletion.

Change-Id: Icec36376f9588dba8114f855ac9719b5735512e8
CRs-Fixed: 2452030
2019-05-23 09:31:03 -07:00
Sravan Kumar Kairam
0bd6c23c89 qcacmn: Fix decrement flush in progress
When rx buffer queue list is empty flush in progress
atomic variable is not decremented before return. Fix
this by removing the code to check list empty as the
qdf function to remove the node from front will also
do the same check for empty list, so the code fall
through and return at the end of the function.

Change-Id: I29b87eb7f9e5d35918aba6ad1d0ccbbdbf6eee3b
CRs-Fixed: 2444437
2019-05-23 09:30:55 -07:00
Varsha Mishra
09a4c0e6bd qcacmn: Fill skb->priority only for macro ATH_RX_PRI_SAVE
skb->priority is needed only for ATH_RX_PRI_SAVE. This access can
be avoided in regular datapath by using skb->cb for faster access.

Change-Id: I5ef970fa45fa314db7e14284d898c98a59d8591e
2019-05-22 12:13:38 -07:00
Chaithanya Garrepalli
d3d99db55b qcacmn: changes to read all MSDUs of MPDU in single reap
We need to read all MSDUs of MPDU in single reap for RAW mode
to prepare the complete SG list

Change-Id: Iaf2d0b9f32bf10181ce7646bf60c4d7e70aed36b
CRs-fixed: 2320143
2019-05-22 09:06:22 -07:00
Tallapragada Kalyan
9e4b36fd89 qcacmn: Rx optimizations to improve small pkt perf
basically tried reading peer_id from peer structure
to avoid 1 cache-line miss per pkt and access mac address
from frame data for WDS only if WDS condition is valid.
The other optimization is to avoid accessing queue_mapping
field of skb for skb received which is at 140 offset
This again helps to avoid i cache miss.
Another place is to do a memcpy only when we intend to
add an ast entry.

Change-Id: I7e328060c505bc21419d045e77329c2cda9e3644
CRs-fixed: 2388857
2019-05-22 00:18:17 -07:00
Jinwei Chen
5bcc30f51c qcacmn: fix peer ref counter unexpected increasement
Host will drop the RX data that introduced in change
"add counters for sa_idx invalid issue", the related peer
has done ref_cnt + 1, but there is no peer ref_cnt -1 accordingly.
peer ref_cnt increase unexpected, panic happened when rmmod at last.

add the peer ref_cnt decrease operation.

Change-Id: Ie6bc5b57560a93c5f21431838b7bcb1140abfec5
CRs-Fixed: 2454468
2019-05-22 00:18:14 -07:00