Commit Graph

320 Commits

Author SHA1 Message Date
Karthik Kantamneni
1759c5d6cb qcacmn: Rate limit excessive logs in WBM error path
Rate limit excessive logging prints in WBM error path

Change-Id: Ifb69959b78740bf4a0fca7b7611a2da0ef740413
CRs-Fixed: 2908240
2021-04-06 18:43:06 -07:00
Manikanta Pubbisetty
86e32fb122 qcacmn: assert on processing invalid RX ring descriptors
Currently, we break the dp_rx_process() reap loop when we encounter
a ring descriptor with invalid bit set in SW cookie. If the HW
has copied old/stale entries in the ring, then we will end up
processing the same entry every time we try to reap the ring.
Instead, assert on processing such invalid entries so that
we can obtain useful debug information.

CRs-Fixed: 2904509
Change-Id: Iddde959a573ddf4ca364e1fb7a54ed0eaf4dc169
2021-03-24 06:44:23 -07:00
Subrat Dash
ecb559ab6f qcacmn: Add check to discard multicast echo packets
The bridge forwards the multicast packets to all the
interfaces attached the bridge.

When the STA network interface receives such packets
from bridge and send it to the AP, it is echoed back
from the BSS.

These packets are not intended for the bridge as it
will lead to looping.

Add a check to detect and drop such packets when
received back from the BSS.

Refactor dp_rx_mcast_echo_check function to fix
compilation errors from the above change.

CRs-Fixed: 2894272
Change-Id: I3f9e92c3598af11d3ff4e6b9b8afbc4110a926fc
2021-03-18 07:43:13 -07:00
Karthik Kantamneni
f5fe106f3f qcacmn: Sanitize Rx buffer length received from H.W
Check if Rx single msdu length including padding and tlvs length
is greater than Rx buffer size allocated to H.W and raise error
to catch out of bound access.

Change-Id: I7c70b8a0b6828f7fd88a19141f9087430085c13a
CRs-Fixed: 2873933
2021-03-05 01:18:22 -08:00
Karthik Kantamneni
c9cec76270 qcacmn: Avoid per packet Rx refill buffer pool lock
Avoid per packet Rx refill buff pool lock, instead
acquire/release lock for burst of nbuf's replenishment.

Change-Id: I778cb9702d31d4b8911cca4e7f06f12c50ef6df9
CRs-Fixed: 2884208
2021-02-25 23:21:25 -08:00
Vulupala Shashank Reddy
1065dc8179 qcacmn: Refactor compilation flag of pkt capture mode
Refactor WLAN_FEATURE_PKT_CAPTURE_LITHIUM to WLAN_FEATURE_PKT_CAPTURE_V2
to remove hardware name from compilation flag.

Change-Id: I5a30b33d8bd6065d12e7c89c666c2f0cab66344e
CRs-Fixed: 2869827
2021-02-11 00:24:33 -08:00
Karthik Kantamneni
595bc84a39 qcacmn: Add RX prealloc pool for replenishing RX buffers
Add and initialize a preallocated pool of buffers which can
be used to replenish RX buffers. During replenish, the buffers
from the pool are used instead of allocating/mapping a new buffer
in the softirq context. This preallocated pool will be refilled
in thread context.

Change-Id: Idf3bd7d25c5d57ddba105ccd8fab672c26a184f1
CRs-Fixed: 2869345
2021-02-09 17:47:02 -08:00
Lihua Liu
74efc61848 qcacmn: Avoid using small buffer address
The memory below 0x2000 is reserved for the target use,
so any memory in this region should not used by host.
But on some third-party platforms, we observe such
memory is allocated for RX buffer, which cause HW/FW
NOC error, then RX is stuck. To address this,
re-allocate RX buffers when small buffer appear.

Change-Id: Iad118e82f3fe10f92cbf5f7388dc0960542fc03c
CRs-Fixed: 2707190
2021-02-04 06:43:41 -08:00
Surabhi Vishnoi
01c8d3f45f qcacmn: Add support for RX offload packets in packet capture mode
Add support to process RX offload packets in packet capture mode.
To distinguish rx offload packets from normal rx packets,
DP_PEER_METADATA_OFFLOAD bit is set in peer metadata, based on value
of this bit rx packet is delivered to stack or packet capture
component.

Change-Id: Ice656a0bc14efd0382c4949d695daa8e926ce41e
CRs-Fixed: 2856792
2021-01-22 16:12:18 -08:00
Shwetha G K
b3fafa78c8 qcacmn: Cleanup rssi and snr used interchangeably
Cleanup rssi and snr used interchangeably

Change-Id: Idc78ca1ceb62af766aaf69e42ab5d6e8990a6f0b
2021-01-11 15:13:44 -08:00
Mainak Sen
37a91751be qcacmn: Enable Peer authorization support in RX path
In security mode, allow only EAPOL frames in receive path
when peer is not authorized. This feature is enabled per VAP
based on vdev flag and will be applicable for all peers in that
VAP

Change-Id: Ic5dea09c2083f31e8cd301a0cdc3565f247b735c
2021-01-07 16:48:52 -08:00
Vulupala Shashank Reddy
6735c84cff qcacmn: Add WDI event for rx packet to packet capture mode
Add WDI event and call wdi event handler for to deliver rx packet
to packet capture mode.

Change-Id: I856ac07f292047136431f67bb2654c855767e5e8
CRs-Fixed: 2844728
2020-12-24 09:52:42 -08:00
Vevek Venkatesan
16066cae2b qcacmn: fix error in NULL checking of rx_ring_history
rx_ring_history is an array of pointers, address of pointer is
always a non-NULL value, this always passed the NULL check,
which leads to NULL pointer dereference, fixing the same.

Change-Id: I401203a6f2a5930869cf4002ac0e714d3fdba62f
CRs-Fixed: 2844038
2020-12-24 07:40:22 -08:00
Shikha Bakshi
3de99369a0 qcacmn: Modify Logs for QDF_MODULE_ID_RX
Add macros dp_rx_info, dp_rx_debug, dp_rx_err,etc.
to define logs

Change-Id: I75820f9f19f876d9fb91b977f56e205b3e275444
CRs-Fixed: 2841584
2020-12-22 14:41:30 -08:00
phadiman
d1bb528ae7 qcacmn: Host Static Memory Optimization (in NSS offload mode)
Low memory profiles like 256M and 16M profiles support
only NSS Wi-Fi offload mode and HOST data path APIs are
not used in NSS offload mode

Disable HOST data path APIs which are not used in both
NSS Wi-Fi offload mode and in HOST mode (in NSS offload mode)

CRs-Fixed: 2831478
Change-Id: I6895054a6c96bd446c2df7761ce65feef662a3cc
2020-12-15 13:34:26 -08:00
Aniruddha Paul
e9a6af6660 qcacmn: Drop invalid peer frames with RA as STA and TA != BSSID
In HKv1, if smart monitor mode is enabled on RE,
we are getting invalid peer frames with RA as STA
mac of RE and the TA not matching with any NAC list
or the the BSSID.Such frames need to dropped in order
to avoid HM_WDS false addition.

Change-Id: If641052c3f0ac5ce49afcc52062462d8b7eaa0e6
2020-12-01 02:50:50 -08:00
Chaithanya Garrepalli
3888d0824e qcacmn: WAR to avoid SG process with wrong continuation bit
If a continuation bit is set in msdu desc info and reported
length can fit in single buffer avoid SG processing

Change-Id: I6e8c3e1e657c372d5d915450dda20ba26bac495f
2020-11-30 05:25:07 -08:00
Jinwei Chen
56f94da675 qcacmn: Add reo destination indication info to skb
Get reo destination indication from REO2SW ring descriptor,
store it to qdf_nbuf_cb of skb.

Change-Id: I5a4c504b2550229a77a435b1f5ddb78c4abe51aa
CRs-Fixed: 2809080
2020-11-01 23:14:06 -08:00
Tiger Yu
eff1069f87 qcacmn: Assertion when detecting rx desc nbuf sanity check failure
Assertion when detecting rx desc nbuf sanity check failure to get more
info in the RX refill buffer ring for default version.

Change-Id: I8d0255e2f13e2b993f5651b788f895ea06187bf9
CRs-Fixed: 2800602
2020-10-28 09:21:45 -07:00
nobelj
9e4237dc34 qcacmn: Added WAR to populate rssi info
rssi value is always zero when retrieved from tlv header.
so added war to populate rssi value from stored value
of peer instead.

Change-Id: I6d5127438dae1f3891e3e78c97be93b79b4ee128
2020-09-21 16:55:55 -07:00
Jinwei Chen
18989f8ede qcacmn: support multiple pages prealloc for descriptor
Support multiple pages prealloc for DP descriptor

Change-Id: I66d4cef3acf69acf4b6fc8e5a6d01c3d67921dca
CRs-Fixed: 2751338
2020-09-21 01:33:16 -07:00
Varsha Mishra
c7789836fd qcacmn: Extended WDS solution RX
1. Register peer->osif_peer for per-STA netdevice delivery.
2. Wi-Fi 3-address frame packets received would be processed
   through AP netdevice.
3. Wi-Fi 4-address frame packets received would be processed
   through per-STA netdevice.

Change-Id: I102874ea1de9fba40ab7f0e2c32c9de1c9b4d075
2020-09-19 10:25:18 -07:00
Ankit Kumar
8528f1fc76 qcacmn: Add feature debug print for RX_MON_MEM_FRAG
Added debug print for RX_MON_MEM_FRAG feature enable
disable log.

Change-Id: Iaa8712755bd1f9a686ec32e2e22ffc1f41da48a6
2020-09-17 13:01:54 -07:00
Rakesh Pillai
21af5ba8cf qcacmn: Add data structures for SWLM
Add the necessary data structures for the
software latency manager.

Change-Id: Ibf55f0eef7ee6602b007de39a28f09c4622bd356
CRs-Fixed: 2769004
2020-09-10 01:04:20 -07:00
Mainak Sen
60cdb2185c qcacmn: Hlos tid override support in dp vdev
1. Add flag to support hlos id override feature in dp vdev
2. Update tid from nbuf->priority in dp_tx_send
3. Update tid to nbuf->priority in dp_rx_process

Change-Id: I66e8d77733a667f3f60b77e0d7bb444f7c5ad93d
2020-09-07 01:03:42 -07:00
Chaithanya Garrepalli
ddc9e59e8f qcacmn: Add VDEV refcount debug support
Add debug support for VDEV refcount to take
refcount by module id and decrement corresponding
refcount with same module id

Change-Id: I15c075816994ba70155fefbc0bce208b20fb9a59
2020-08-20 10:07:32 -07:00
Chaithanya Garrepalli
a718007f03 qcacmn: increment vdev refcount for search by id
Add new API dp_vdev_get_ref_by_id() which will return vdev
pointer by holding a reference. Caller of this API has
to ensure that this reference is released by calling
dp_vdev_unref_delete() API

New lock soc->vdev_map_lock is introduced to protect
vdev id to object array

Change-Id: I883e328932e35ef31254125492dbae20cebe0e00
2020-08-20 10:07:28 -07:00
Chaithanya Garrepalli
f4701f13ec qcacmn: remove peer backpointer in DP ast entry
Remove the peer backpointer in ast entry and store
peer_id instead

Assign peer_id in AST entry in AST MAP event,
also add the ast entry to peers ast list

In AST map & AST unmap APIs use ast find by vdev_id

Change-Id: I74d9828dc309149d98f6f577b5c8304cb087fd76
2020-08-15 01:26:17 -07:00
Chaithanya Garrepalli
fdc6a808ae qcacmn: add module id for peer reference
Add support to get the peer reference with module id

To help debug the peer reference related issues

Change-Id: Ie20c7e710b9784b52f2e0f3d7488509282528a00
2020-08-15 01:26:14 -07:00
Chaithanya Garrepalli
113841906c qcacmn: increment refcount for peer find by id
Use unified version of dp_peer_find_by_id API
which will take peer reference

Also use unified peer ref release API dp_peer_unref_delete

Change-Id: Ibb516a933020a42a5584dbbbba59f8d9b72dcaa4
2020-08-15 01:26:10 -07:00
Rakesh Pillai
1de57c2150 qcacmn: Handle the duplicate entries in reo exception ring
We have come across scenarios where rxdma is pushing
a certain entry more than once to the reo exception
ring. In this scenario, when we try to unmap a buffer,
it can lead to multiple unmap of the same buffer.

Handle this case, by skipping the process of this
duplicate entry, if alrady unmapped, and proceed to the
next entry.

Change-Id: Iae66f27e432f795ba4730911029fa1d63a75cb06
CRs-Fixed: 2739176
2020-08-12 06:42:21 -07:00
Shivani Soni
c4c0a179f6 qcacmn: Monitor Status ring memory optimization
Memory optimization of monitor status ring by allocating buffers during
replenish using alloc_skb (linux API).
It creates buffer of required size rather than 4k size(dev_alloc_skb)

Change-Id: I3ae5e403de28c4570f8ac3b50d3ca878a9e4b2f9
CRs-Fixed: 2733931
2020-08-12 06:42:13 -07:00
Ankit Kumar
526bbe81de qcacmn: Handle frag based ops based on rx_Desc_pool flag
Rx desc pool have a flag to identify whether frag or nbuf
operation needs to be performed for alloc, map, prep and
free buffer for monitor dest buffer.

This flag will be set only for mon destination desc pool,
if RX_MON_MEM_FRAG feature is enabled.
In all other case, It will be set to Zero and default nbuf
operation will be taken.
This flag get initialized at the time of pdev rx_desc_pool
initialization and gets reset while pdev deinit.

Mon destination buffer will have support for frag if
RX_MON_MEM_FRAG flag is set.

Change-Id: I67c6c823ee4f114035b884c024a1a9054a40665b
CRs-Fixed: 2741757
2020-08-11 14:09:08 -07:00
nwzhao
ca9a332c4a qcacmn: [DP]TWT stats feature: add WMI Support for TWT stats event
Add WMI support for WMI_TWT_SESSION_STATS_EVENTID. This event
contains stats for a given TWT session.

Change-Id: I01d5f7b30da803ee713a14c1d1124b8af7161bca
CRs-Fixed: 2609951
2020-08-05 02:17:19 -07:00
Mainak Sen
eeaa5b7471 qcacmn: INI param to configure Rx S/W desc count
Rx s/w descriptor count should be configurable from
dp_rx_sw_desc_num INI

Change-Id: Id4bbe261b985219dad8d129679ab85e2dd1ba084
2020-08-04 14:59:06 -07:00
Rakesh Pillai
9beeaa95a7 qcacmn: Add history to track the entries in rx rings
The rx rings are relatively of smaller size. Any
duplicate entry sent by hardware cannot be back-tracked
by just looking at the ring contents alone.

Hence add a history to track the entries for the
REO2SW, REO exception and SW2REO ring.

Change-Id: I9b0b311950d60a9421378ce0fcc0535be450f713
CRs-Fixed: 2739181
2020-08-02 11:01:41 -07:00
Rakesh Pillai
d7a0b3f14c qcacmn: Handle the nbuf sanity failure gracefully
Th nbuf sanity can fail in case when HW posts the
same buffer twice. This case can be handled gracefully
by just skipping the processing of the corresponding rx
descriptor.

Change-Id: I471bb9f364a51937e85249996e427f15872bda97
CRs-Fixed: 2738558
2020-08-01 21:08:54 -07:00
Manikanta Pubbisetty
fa2844b787 qcacmn: DP RX changes for RX buffer pool support
DP RX changes to support RX buffer pool, this is a pre-allocated pool
of buffers which will be utilized during low memory conditions.

Change-Id: I8d89a865f989d4e88c10390861e9d4be72ae0299
CRs-Fixed: 2731517
2020-08-01 13:13:36 -07:00
Jinwei Chen
f3bffbfdd2 qcacmn: handle IPA buffer smmu map/unmap correctly
Handle ipa buffer smmu map/unmap with below changes,
(1) Do IPA smmu unmap for RX buffer received from REO
exception/WBM RX release/REO DST/RXDMA DST ring.
(2) Align IPA smmu map length to qdf_nbuf_map_nytes_single()
with fixed length.

Change-Id: I1ed46b31ed31f5b7e4e2484d519bc85d35ce1e69
CRs-Fixed: 2728644
2020-07-23 13:17:09 -07:00
Rakesh Pillai
eec104893e qcacmn: Add stats for stale cookie read from rx ring
Add a count for the number of times we read a stale
cookie value from the REO2SW ring.

Change-Id: I4b20fa93f5261b4ccb9479b7b3469a294703a184
CRs-Fixed: 2736028
2020-07-23 13:17:06 -07:00
Jinwei Chen
87d4f73245 qcacmn: Handle raw frames and invalid flow_idx stats
Make sure to drop the raw Rx frames as both driver and stack
are not expected to handle them.
Add counter for invalid fisa flow_idx packet received.

Change-Id: I5107c554b8ce6a9a7973f2aeca44bb0f360dc2df
CRs-Fixed: 2733981
2020-07-20 04:47:00 -07:00
Rakesh Pillai
28f1bf3f4e qcacmn: Invalidate ring desc cookie after processing
Currently all the rx ring descriptor contents are left
intact even after these entries are processed. This can,
at times, lead to stale entries being processed, if the
head pointer of any ring is updated before the updated
contents of the ring descriptor gets reflected in the memory.

This can lead to scenarios where the host driver reads a
stale value of sw_cookie, and free/unmap a currently in-use
buffer, thereby leading to the hardware accessing unmapped
memory region.

The sw_cookie is the integral part of al the rx ring
processing. Hence we always mark the sw_cookie as invalid
after dequeuing an entry from the REO2SW ring. Every time
we check for the validity of the sw_cookie before we try to
process an entry from REO2SW ring. if the invalid bit in the
sw_cookie is set, we just skip this entry and move on to the
next entry in the ring.

Change-Id: I0e78fa662b8ba33e64687a4dee4d1a5875ddb4bf
CRs-Fixed: 2730718
2020-07-18 00:00:04 -07:00
Aniruddha Paul
1b7f50b096 qcacmn: Update the Tx/Rx Delay histograms
Update the Host Tx/Rx per packet delay histogram

Change-Id: I40c3c05b2eb90427bd83783f13f2a7a3df41d232
2020-07-17 21:25:58 -07:00
Yeshwanth Sriram Guntuka
90e1136afb qcacmn: Decrement peer ref cnt after dp_rx_deliver_to_stack
Ths issue scenario is that valid peer is fetched from
peer_id in dp_rx_process and peer ref count is released
prior to invoking dp_rx_deliver_to_stack. In parallel,
the peer is freed in a different context. This results in
use after free within dp_rx_check_delivery_to_stack since
stale peer is dereferenced to update stats.

Fix is to decrement peer ref cnt after dp_rx_deliver_to_stack

Change-Id: I145247f7795f926faba66c05927fdae0599f0cad
CRs-Fixed: 2720396
2020-07-02 08:48:21 -07:00
Balaganapathy Palanisamy
a497ea80aa qcacmn: Add peer isolation support per vap
Configure the client as isolated peer if part of isolation
list while creating/associating the node or adding the peer
to the isolation list.
Do not forward the packets to and from clients in isolation
list instead accelerate to upper stack.

CRs-Fixed: 2689868

Change-Id: I67fd4dee0fb76c993746cdd66c70c241d407239a
2020-06-03 08:08:13 -07:00
Chaithanya Garrepalli
1d144f88bd qcacmn: store peer_id instead of peer_ids array in dp_peer
In lithium a peer will have only single peer_id hence remove
peer_ids array from dp_peer structure

Change-Id: Ib98270b7fd98f1199b862e4608f990687914b7cc
2020-05-29 13:13:37 -07:00
Yeshwanth Sriram Guntuka
1173b39f0f qcacmn: Update peer rx mpdu count per mcs rate
Update the peer rx mpdu count per mcs rate as part
of peer stats updation.

Change-Id: I945d32c7701f5f5c9bfbbaa6ab4576b94389c84c
CRs-Fixed: 2688068
2020-05-21 20:34:59 -07:00
Jinwei Chen
800b1b181b qcacmn: add exception frame flag for non-regular RX delivery
FISA RX aggregation is not necessary for non-regular RX delivery
as it requires extra FISA flush and also may impact regular
dp_rx_process() RX FISA aggregation.
  Add exception frame flag for non-regular RX delivery, so that
FISA path can identify this frame and bypass FISA RX.

Change-Id: Ic06cb72b516221754b124a673ab6c4f392947897
CRs-Fixed: 2680255
2020-05-14 13:04:20 -07:00
Yeshwanth Sriram Guntuka
8a2c60e8f5 qcacmn: Add debug info support for rx descriptors
Add debug info support for rx descriptors to log
the caller func name and timestamp in replenish
and free scenario.

Change-Id: I1d9b855d14f705094f241bae653f33a94d0e39b7
CRs-Fixed: 2677288
2020-05-13 12:39:51 -07:00
Jinwei Chen
ac1aea6e59 qcacmn: WAR for duplicate RX desc issue from REO2SW ring
Two back to back same RX desc is received from
REO2SW1 ring. After first RX desc is processed,
RX_desc nbuf will be set to null.
when second REO entry/same RX desc is processing,
dp_rx_desc_nbuf_sanity_check() will access to RX_desc nbuf, null
nbuf accessing lead to panic.

As a WAR, check RX_desc in_use flag firstly to avoid
invalid accessing to nbuf, move
dp_rx_desc_nbuf_sanity_check() after it.

Change-Id: Ib9455c76af85cf83587c1428b20a9ad9e93a9499
CRs-Fixed: 2672088
2020-05-04 21:27:59 -07:00