Commit Graph

302 Commitit

Tekijä SHA1 Viesti Päivämäärä
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
Nisha Menon
a2f5ca7c04 qcacmn: Check return status of deliver to stack function
Check the return status of the osif->rx function and in case
of failure drop the skb. This is needed when OOR error frame
is received and if the frame was not delivered to stack it
needs to be dropped.
Add error counter to periodic stats to determine how many Rx
packets were rejected or were dropped since deliver to
stack failed.
Add the new status check for delivering rx frames to stack
under MCC specific flag - DELIVERY_TO_STACK_STATUS_CHECK.

Change-Id: I9b1c795f168774669783cc601e68003a7747a279
CRs-Fixed: 2672498
2020-05-03 18:19:10 -07:00
phadiman
1f3652debc qcacmn: Datapath init-deinit changes
Do a logical split of dp_soc_attach and
dp_pdev_attach into Allocation and initialization
and dp_soc_detach and dp_pdev_detach into
de-initialization and free routines

Change-Id: I23bdca0ca86db42a4d0b2554cd60d99bb207a647
2020-05-02 21:59:42 -07:00
Nisha Menon
12cc7c6558 qcacmn: SKB buf memory Leak@ Func dp_pdev_nbuf_alloc_and_map
Fix the skb leak in dp_rx_process where rx descriptor cookie
validity fails. This skb should be cleaned up as part of the
rx desc and nbuf free function called during the driver unload.
However this will ensure that the skb released and added rx desc
added to the free list during dp_rx_process itself.

Add skb map, unmap functions, line numbers and if the nbuf is
mapped or unmapped to the nbuf tracking table. This debug info
will be logged once the skb is leaked.

Change-Id: I52dbf38922be20fc0aaea380e0e572af16de773e
CRs-Fixed: 2662992
2020-04-30 18:21:23 -07:00
Yeshwanth Sriram Guntuka
7dad533e6c qcacmn: Handle scattered msdu in OOR error scenario
In OOR error handling scenario, msdu is spread across
two nbufs. Due to this, there is a mismatch between
msdu count fetched from MPDU desc detatils and count
fetched from rx link descriptor.

Fix is to create frag list for the case where msdu
is spread across multiple nbufs.

Change-Id: I1d600a0988b373e68aad6ef815fb2d775763b7cb
CRs-Fixed: 2665963
2020-04-28 03:59:14 -07:00
phadiman
b133d310ec qcacmn: Split dp_rx_pdev_attach and dp_rx_pdev_detach
Split dp_rx_pdev_attach into dp_rx_pdev_desc_pool_alloc,
dp_rx_pdev_desc_pool_init, dp_rx_pdev_buffers_alloc and
dp_rx_pdev_detach into dp_rx_pdev_desc_pool_free, dp_rx
_pdev_desc_pool_deinit, dp_rx_pdev_buffers_free APIs

This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: Ib543ddae90b90f4706004080b1f2b7d0e5cfbfbc
CRs-Fixed: 2663595
2020-04-27 18:02:37 -07:00
Varsha Mishra
c71df5eef4 qcacmn: Restrict DMA Map/UnMap upto buffer size
Restrict DMA Map/UnMap upto buffer size for packets in rx process.
This gives 2-3% cpu gain in peak throughput.

Change-Id: Iaf5e9f6f734d80b6d2c234bd8e679cf2a81c7e2c
CRs-Fixed: 2660698
2020-04-23 16:26:49 -07:00
Varsha Mishra
4c39342f6a qcacmn: Lockless access of reo destination rings
Remove lock to access REO destination rings because 4 rings are
accessed in 4 individual cores.

Change-Id: Ia3f92cc5136dbdbeea1e9cda8d52b474356a3e1a
CRs-Fixed: 2660901
2020-04-11 07:35:07 -07:00
Jinwei Chen
b3e587db52 qcacmn: Support RX 2K jump/OOR frame handling from REO2TCL ring
Support RX 2K jump/OOR frame handling from REO2TCL ring.
(a) configure REO error destination ring register to route 2K jump
/OOR frame to REO2TCL ring.
(b) for 2K jump RX frame, only accept ARP frame and drop others,
meanwhile, send delba action frame to remote peer once receive first
2K jump data.
(c) for OOR RX frame, accept ARP/EAPOL/DHCP/IPV6_DHCP frame, otherwise
drop it.

Change-Id: I7cb33279a8ba543686da4eba547e40f86813e057
CRs-Fixed: 2631949
2020-03-24 19:58:16 -07:00
Saket Jha
42f305e423 qcacmn: Avoid accessing invalid cookie rx_descriptor
Remove debug dump call to dp_rx_desc_dump() as cookie rx_descriptor is
invalid.

Change-Id: I106ebc2f872e43079abd6e6e493c90022fd09c3b
CRs-Fixed: 2638059
2020-03-16 19:55:12 -07:00
Rakesh Pillai
f2e0f22bf7 qcacmn: Fix stack frame overflow for dp_rx_process
dp_rx_process stack frame has grown to exceed the
stack frame size of 4096. dp_rx_deliver_to_stack_no_peer
is a big function which should not be inline. Calling it
in other function increases the stack size consumed by the
caller function a lot.

Since dp_rx_deliver_to_stack_no_peer is not called very
frequently from dp_rx_process, changing its type to non-inline
function does not hit the core rx datapath much. Hence
change dp_rx_deliver_to_stack_no_peer to a non-inline
function.

Change-Id: Ib042f74c1f5a9cbe5fd947a24f004bb2fecf1fb1
CRs-Fixed: 2636365
2020-03-16 03:47:48 -07:00
Saket Jha
d364435727 qcacmn: Validate rx return_buffer_manager
Host rx return_buffer_manager should always be 4 or 6. Add check for
invalid return_buffer_manager value in ring descriptor.

Change-Id: I509dd58ddd89e6a0ce1bffa509dcfabbd0fbc975
CRs-Fixed: 2632372
2020-03-06 18:52:30 -08:00
Jinwei Chen
356c6b714e qcacmn: fix null skb accessing due to incomplete scattered msdu
If RX packets reaped from REO2SW ring hit rx_reap_loop_pkt_limit,
REO2SW ring reaping will break and stop, but for scattered msdu case,
all related buffer should be received one time for further processing,
otherwise dp_rx_sg_create can not handle correctly.

(1) make sure all buffers for scattered msdu is received then allow
break when rx_reap_loop_pkt_limit hit.
(2) refine skb unmap location in case msdu_scatter_wait_break logic is
hit, then may double unmap for same skb(not for current issue).

Change-Id: I85d385ee9c3b1a5ed56ae5e5b68636d04968553f
CRs-Fixed: 2632082
2020-03-04 09:56:49 -08:00
Rakesh Pillai
7a26da4e7e qcacmn: Validate the rx descriptor before dereferencing
The rx descriptor obtained using the cookie
can be NULL if the cookie is invalid. Hence
dereferencing the rx descriptor without any
validation can cause invalid address access.

Fix this by validating the rx descriptor
which has been obtained using the cookie from
the hal ring descriptor.

Change-Id: Ib584f0d8175b581d15b0e1c67d2f6ed9119ecbfc
CRs-Fixed: 2629254
2020-03-03 18:55:00 -08:00
Vivek
10d8aff10e qcacmn: Use right API for retrieving pdev based on id
We are seeing a invalid memory access crash
in the dp_get_pdev_for_mac_id call from
dp_rx_process_invalid_peer, due to invalid mac id passed,
probably due to some stack correction.

We should instead use dp_get_pdev_for_lmac_id from
dp_rx_process_invalid_peer, where for invalid
mac id, we assert.

Change-Id: I0737132b5bbdd2fcbdb714d4643a69184ae3821e
CRs-Fixed: 2618432
2020-02-24 22:02:03 -08:00
Aditya Sathish
041409f98f qcacmn: Add 6GHz support for chan/freq/band usage in mesh mode
Currently mesh mode uses channel numbering which is derived
from APIs that don't support 6GHz channels numbering due to the
overloading of 6GHz channels with 2.4GHz and 5GHz.

Add support to obtain the correct channel number (and auxiliary
information like band and frequency) through the new APIs that
support 6GHz.

Change-Id: Ib0b39ebae2a22bd6b2b5d17b9058c3c2100e0d59
CRs-Fixed: 2605229
2020-02-20 08:32:09 -08:00
Manjunathappa Prakash
c4667b8b12 qcacmn: Save Rx TLV offset info so as to recover in FISA
Packets delivered to FISA via exception err path doesnot have TLVs.
FISA handling requires additional TLVs. dp rx core handling
skips TLVs, save TLV length info in nbuf->cb so that TLVs
are recovered back in FISA.

Change-Id: I53fab2e19abcbf82697ea6f53a4ddf3ea0dd0699
CRs-Fixed: 2620844
2020-02-20 06:39:48 -08:00
Manjunathappa Prakash
b896f0eade qcacmn: Add NULL check for vdev before accessing
Add NULL check for valid vdev before accessing it.

Change-Id: I977671bd7f612a30e1cb3b72d6b46200eaf1a34c
CRs-Fixed: 2606040
2020-02-12 11:59:15 -08:00
Manjunathappa Prakash
5d73e075e8 qcacmn: Add support to deliver the packets to FISA
Hook FISA specific callback to deliver the Rx packets to
FISA frame work.

Change-Id: Ia16c857764c0c3bf99c3855eac01659eb03c7608
CRs-Fixed: 2599917
2020-02-12 11:58:59 -08:00