Commit Graph

79 Commits

Author SHA1 Message Date
Amit Shukla
1edfe5ae7c qcacmn: Data path changes for Dynamic Mode Change FR. Changes include-
1. Move all LMAC rings to SOC from pDEV
	2. Dynamically obtain lmac->pdev mapping while handling LMAC interrupts

Change-Id: Ib017d49243405b62fc34099c01a2b898b25341d0
2020-01-16 17:14:39 -08:00
Jinwei Chen
1d2e65a76c qcacmn: fix STA + SAP IPA de-frag issue
Currently wlan host will re-inject defrag data with RBM 6 to
REO, this data buffer will go to REO-->REO2SW4-->IPA-->FW2RXDMA,
fix below issue introduced by this RX buffer path.
a. FW assert due to FW2RXDMA DMA address not 4 bytes aligned.
b. host skb double allocation due to qdf_nbuf_linearize() for frag skb.
c. Invalid RBM 6 for fragment RX due to RX buffer resue.

Change-Id: I36d831fc14b6b9aa0cea32682823de348f7eecd3
CRs-Fixed: 2591453
2020-01-03 04:43:01 -08:00
Jinwei Chen
5bd952ce05 qcacmn: fix srng lock hold long time due to logging
when lot of fragment frame with invalid peer_id indicated to
host through reo exception ring, excessive logging cause srng
lock hold long time.
  degrade log level as a WAR to avoid excessive logging.

Change-Id: Iffb18ad723d1ac5955868cc8ec99bb0198785ee5
CRs-Fixed: 2584610
2019-12-19 03:05:15 -08:00
Mohit Khanna
918456b6c3 qcacmn: Use HAL_RX_BUF_RBM_SW3_RBM for defrag pkts
Currently defragmented packets use HAL_RX_BUF_RBM_SW1_RBM as the RBM
value for the defragmented packets which are re-injected into REO.
Thus, if REO encounters any error while handling these packets, they
would end up in WBM2SW1 ring (via WBM), which is managed by the FW. The
FW will eventually recycle these buffers back to RXDMA via its refill
process. As a part of defragmentation, host does a 802.11 -> 802.3
header conversion. This is resulting in an address which is not 4
byte aligned. Hence, when RXDMA tries to use these addresses (after FW
recycles them), it may lead to issues.

Change the RBM value of the defragmented buffers which are
re-injected. Now, if REO ends up throwing an error for these
packets, they wll end up in WBM2SW3, which is managed by the host.
The host can then drop these packets and replenish RXDMA with 4 byte
aligned buffers (via FW).

Change-Id: I9d9c25385978d5be855699feb28d292c6f3fffdd
CRs-Fixed: 2572483
2019-12-07 04:22:09 -08:00
Pavankumar Nandeshwar
4c7b81b540 qcacmn: removal of cp handles and changes for ol_if_ops
Remove pdev and vdev control path handles from data path.
Instead send pdev_id and vdev_id along with opaque soc
handle in ol_if_ops.

Change-Id: I6ee083f07e464f283da0d70ada70a4e10e18e1b2
2019-12-04 07:45:10 -08:00
Pavankumar Nandeshwar
715fdc32ec qcacmn: remove ctrl_peer handle from dp peer
Remove ctrl_peer handle from dp peer and instead
use peer's mac address

Change-Id: I9e24fa94248749f9b4859bce4a1d79d70f32507e
2019-12-04 07:44:21 -08:00
Rakesh Pillai
3f13c071b9 qcacmn: Fix compilation errors in DP_PRINT
Fix compilation error in DP_PRINT which is
seen when compiled for lithium datapath.

CRs-Fixed: 2567068
Change-Id: I4bb7bb14a2e521645be6e2677a44a78fa79fcb0b
2019-11-18 10:33:17 -08:00
Saket Jha
b0cea9a251 qcacmn: Reduce excessive warning logging in RX defrag path
Expecting a fresh skb from reo exception ring with skb->len of 0 but are
unexpectedly receiving one with len greater than 0, so will drop the
packet.

Change-Id: I1079b40dbb3180dd1ccd87f47668f75d10003934
CRs-Fixed: 2556164
2019-11-07 21:09:37 -08:00
Jinwei Chen
cb37d704f8 qcacmn: Fix dst_ring_desc memory leak in defrag case
For RX defrag, if incorrect SW peer ID is got from REO exception
ring descriptor, the expectation maybe is AP BSS peer ID but it
is replaced by other peer ID which like SAP self peer that won't
do dp_peer_rx_init, then in dp_rx_defrag_cleanup no chance to
run dp_rx_clear_saved_desc_info to free dst_ring_desc since
rx_tid[].array is NULL, memory leak happened.
  Call dp_rx_clear_saved_desc_info always in dp_rx_defrag_cleanup.

Change-Id: Ib1ebfbd976c817d5238ee48196388a8c88189ebc
CRs-Fixed: 2549913
2019-10-29 04:07:07 -07:00
Jia Ding
fef509bc58 qcacmn: Properly handle RX REO reinject packets
Currently for REO reinject path, first fragment is in the
linear part of the skb buffer while other fragments are
appended to skb buffer as non-linear paged data. The other
point is that for REO reinject buffer, l3_header_padding is
not there, meaning ethernet header is right after struct
rx_pkt_tlvs.

Above implementation will have issues when WLAN IPA path is
enabled.

Firstly, IPA assumes data buffers are linear. Thus need to
linearize skb buffer before reinjecting into REO.

Secondly, when WLAN does IPA pipe connection, RX pkt offset
is hard-coded to RX_PKT_TLVS_LEN + L3_HEADER_PADDING. Thus
need to pad L3_HEADER_PADDING before ethernet header and
after struct rx_pkt_tlvs.

Change-Id: I36d41bc91d28c2580775a1d2e431e139ff02e19e
CRs-Fixed: 2469315
2019-10-21 03:46:39 -07:00
Saket Jha
8ce125ec51 qcacmn: Remove false assert during cleanup in STA mode
During cleanup path in STA mode, remove false assert as there is just self
dp_peer with no TX and RX TIDS setup.

Change-Id: Id6be7a6b3823c41ddbff67926bda240a4e9b6bd0
CRs-Fixed: 2547680
2019-10-19 20:46:56 -07:00
Venkata Sharath Chandra Manchala
8227240793 qcacmn: Add HAL macros in dp_rx_defrag.c
Add the following HAL macros:
1. HAL_RX_MSDU0_BUFFER_ADDR_LSB
2. HAL_RX_MSDU_DESC_INFO_PTR_GET
3. HAL_ENT_MPDU_DESC_INFO
4. HAL_DST_MPDU_DESC_INFO

Add relevant function pointers to retrieve
descriptor info from the macros based
on chipsets.

Change-Id: I99ce7566a668180c7849eedea915b6f23a8dbf35
CRs-Fixed: 2522133
2019-10-17 15:10:16 -07:00
Venkata Sharath Chandra Manchala
68d6f0d585 qcacmn: Add hal_rx_get_mpdu_sequence_control_valid API
Implement hal_rx_get_mpdu_sequence_control_valid
API based on the chipset as
the macro to retrieve sequence control valid
value is chipset dependent.

Change-Id: I01a006094d0330060e9ff1a91200c48c2426f38d
CRs-Fixed: 2522133
2019-10-17 15:08:54 -07:00
Venkata Sharath Chandra Manchala
aa7628361e qcacmn: Add hal_rx_mpdu_get_addr4 API
Implement hal_rx_mpdu_get_addr4 API based
on the chipset as the macro to retrieve
addr4 value is chipset dependent.

Change-Id: Ie35d01de1619a8ab540bb1b2019a15b436efb7d4
CRs-Fixed: 2522133
2019-10-17 15:08:45 -07:00
Venkata Sharath Chandra Manchala
7c868259ff qcacmn: Add hal_rx_mpdu_get_addr3 API
Implement hal_rx_mpdu_get_addr3 API
based on the chipset as
the macro to retrieve addr3 value is
chipset dependent.

Change-Id: I3983599b656e82170de5905c08daee3ec164e7a0
CRs-Fixed: 2522133
2019-10-17 15:08:38 -07:00
Venkata Sharath Chandra Manchala
a81a2fed42 qcacmn: Add hal_rx_mpdu_get_addr2 API
Implement hal_rx_mpdu_get_addr2 API
based on the chipset as
the macro to retrieve addr2 value is
chipset dependent.

Change-Id: I4026db892d4f2f41db72c50f780ba898b8a17fa7
CRs-Fixed: 2522133
2019-10-17 15:08:31 -07:00
Venkata Sharath Chandra Manchala
e3ae3193f9 qcacmn: Add hal_rx_mpdu_get_addr1 API
Implement hal_rx_mpdu_get_addr1 API
based on the chipset as the macro to
retrieve addr1 value is
chipset dependent.

Change-Id: I7ed88f2243d397c9d605a08d3b93e17f0004c63d
CRs-Fixed: 2522133
2019-10-17 15:08:22 -07:00
Venkata Sharath Chandra Manchala
25ba7b8c4f qcacmn: Add hal_rx_get_mpdu_frame_control_valid API
Implement hal_rx_get_mpdu_frame_control_valid API
based on the chipset as the macro to retrieve
frame control valid value is chipset dependent.

Change-Id: I49d16ae44b2e9567ff746d2088058f0c1025ea40
CRs-Fixed: 2522133
2019-10-17 15:08:12 -07:00
Venkata Sharath Chandra Manchala
1e3a479fdf qcacmn: Add hal_rx_mpdu_get_fr_ds API
Implement hal_rx_mpdu_get_fr_ds API
based on the chipset as the macro to
retrieve for_ds value is chipset
dependent.

Change-Id: I6d41d02ac50cae752567d98645f0447cc122a84f
CRs-Fixed: 2522133
2019-10-17 15:08:06 -07:00
Venkata Sharath Chandra Manchala
e7924fd2da qcacmn: Add hal_rx_mpdu_get_to_ds API
Implement hal_rx_mpdu_get_to_ds API based
on the chipset as the macro to retrieve
to_ds bit value is chipset dependent.

Change-Id: I36d9d14e226bcc604b91d8aecbe52836c5a12272
CRs-Fixed: 2522133
2019-10-17 15:07:57 -07:00
Saket Jha
ce8c3108d5 qcacmn: Clear defrag waitlist in all cases
Rx defrag waitlist was not getting cleared during dp_peer_rx_cleanup in
the case of STA mode even though the tid was getting deleted. This
created a scenario where the next time dp_rx_defrag_waitlist_remove was
called, it was trying to access now invalid memory. If a vdev was
disconnected in the middle of receiving traffic, then the tid would be
deleted but the rx frag waitlist would not. Upon reconnecting, the
reception of the next frag would cause a crash due to the now invalid
memory in the waitlist.

Change-Id: I5bb1a31f38fa45128d0f35fafaddaf729c99489d
CRs-Fixed: 2538879
2019-10-15 22:58:32 -07:00
Sravan Goud
184a4d99d9 qcacmn: Fix double unmap issue for rx frag packets
Currently as part of rx frag packets handling, nbuf is unmapped,
but the corresponding rx desc unmapped bit is not set. The fragment
is stored until all the frags are received. Only after all the frags
are received defrag packet is reinjected back to reo. While in between
if driver is unloaded, as part of unload rx desc buffer pool is freed.
During buffer free corresponding rx desc unmapped bit is checked and
if the bit is not set buffer is unampped and then freed. This leads
of double unmap in case of the stored frag list buffers. As part of
this change set the unmapped bit during nbuf unmap.

Change-Id: I24cf1e88f3102bc985f95d2dc325509308a7bef9
CRs-Fixed: 2532302
2019-10-02 01:23:14 -07:00
Akshay Kosigi
a870c6181a qcacmn: Change to clean up of void pointers
Add code to cleanup usages of void pointer usages
in DP code.

Change-Id: I0736bcc0a547d858ed02f1ee59084a44e5fe4bec
CRs-Fixed: 2487249
2019-07-27 13:43:04 -07:00
Akshay Kosigi
91c56523d3 qcacmn: Remove void pointer usage for ring desc's
Make change to remove usage of void pointers for
ring descriptors and instead use a opaque pointer
dp_ring_desc_t.

Change-Id: Ia1e9a3da9eaa3cccf297b2135b52a72f2fe21431
CRs-Fixed: 2484409
2019-07-27 13:42:37 -07:00
Rakshith Suresh Patkar
d863f8d6b7 qcacmn: Add new API for registering rx mic error callback
Add new CDP API cdp_register_rx_mic_error_ind_handler to
register rx mic error callback. Also, define new structure
cdp_rx_mic_err_info for holding MIC error information.

Change-Id: I4d5d6426b1d5f04848afd48f6dbf51edba291a20
CRs-Fixed: 2488424
2019-07-22 11:36:23 -07:00
Jinwei Chen
63705259d2 qcacmn: fix dp_rx_defrag_add_last_frag peer tid array invalid access
In some case, HW will fill in unexpected peer_id into RX PKT TLV,
if this peer_id related peer is valid by coincidence, but actually
this peer won't do dp_peer_rx_init(like SAP Vdev self peer),
then invalid accessing to peer rx tid will happen.

do SW WAR that add checking about peer tid array, if not initialed,
free the rx nbuf.

Change-Id: Icf196b4f92eb341e1ace5128c681d24c41dff6cd
CRs-Fixed: 2468537
2019-07-08 08:48:31 -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
Ankit Kumar
0ae4abc97b qcacmn: Replace QDF_DMA_BIDIRECTIONAL to QDF_DMA_FROM_DEVICE in rx
In Rx path, We really don't need to flush data and invalidate.
Hence replacing map/unmap flag to QDF_DMA_FROM_DEVICE.

Change-Id: I3de0c73e11a08a875114167a55fe9fe4432f1dd4
CRs-fixed: 2449712
2019-05-20 11:22:21 -07:00
Tallapragada Kalyan
7147b3ccbf qcacmn: RX optimization changes to reduce cache misses
certain fields are now retrieved from reo_destination
ring to nbuf cb. This avoids accessing the RX_TLVs
which are spread across two cache lines. This is
helping improve small pkt (64 byte) performance.

Change-Id: Iee95813356c3dd90ab2e8a2756913def89710fb1
CRs-Fixed: 2426703
2019-05-08 04:47:16 -07:00
Srinivas Girigowda
2751b6d2b3 qcacmn: Consolidate multiple MAC_ADDR_LEN to QDF_MAC_ADDR_SIZE
Consolidate multiple (redundant) MAC_ADDR_LEN to QDF_MAC_ADDR_SIZE
CDP_MAC_ADDR_LEN
OL_TXRX_MAC_ADDR_LEN
DP_MAC_ADDR_LEN
HTT_MAC_ADDR_LEN
IEEE80211_ADDR_LEN
DEFRAG_IEEE80211_ADDR_LEN
ETHER_ADDR_LEN
HAL_MAC_ADDR_LEN
WLAN_MACADDR_LEN

CRs-Fixed: 2406591
Change-Id: I4a87f8ff556920c7b341bdbba99ec43c97b873f4
2019-03-28 16:50:32 -07:00
Jeff Johnson
a8edf330f0 qcacmn: dp: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within dp replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: I61f3adab1208682d36235421f44a048e35df346d
CRs-Fixed: 2418258
2019-03-27 06:10:00 -07:00
Tallapragada Kalyan
f990490712 qcacmn: Fix msdu link descriptor leak in fragment handler
msdu link desctriptor leak got introduced because two
gerrits got merged at the same time.

Change-Id: I65dbbab016e2e31c0943c37d614e6613193a56fd
2019-03-21 23:04:46 -07:00
Srinivas Girigowda
9cf1aa027b qcacmn: Modify IEEE80211_FC0_SUBTYPE_QOS to QDF_IEEE80211_FC0_SUBTYPE_QOS
Modify IEEE80211_FC0_SUBTYPE_QOS to QDF_IEEE80211_FC0_SUBTYPE_QOS.

Change-Id: I93eb546c04798e82c7be4660d1fe127ce13dc754
CRs-Fixed: 2408226
2019-03-06 11:00:03 -08:00
Tallapragada Kalyan
fe278d5425 qcacmn: discard fragmented pkts if msdu count is greater than 1
discard fragmented pkts if msdu count is greater than 1
and also some code clean up

Change-Id: I1d0857b5e22f0e4763cfa355b8c92bde697d7540
CRs-Fixed: 2382353
2019-03-03 22:25:00 -08:00
Karunakar Dasineni
f8ec0cbe57 qcacmn: Fix defrag waitlist flush issues
Check if peer is valid before access during flush.

Check waitlist during peer cleanup even if REO queue was
not allocated, since these are independent.

Add a timeout to avoid calling flush function too frequently.

Change-Id: Ib8da2014f81a48ccc3ca6a330209a942ac0998a2
2019-02-24 01:30:00 -08:00
Manjunathappa Prakash
a5a3a1e49d qcacmn: Ignore fragmented packet before peer TID setup
peer->rx_tid[tid].array is initiailized when peer TID is setup.
It seems like we are processing the fragmented Rx packet before peer
TID is setup. Drop the fragmented packet in this case.

Change-Id: Ic076e59a9074efff9fed9f9154aa973c41f67341
CRs-Fixed: 2388684
2019-02-07 20:36:13 -08:00
Venkata Sharath Chandra Manchala
368fb3aff9 qcacmn: Reduce the log level for fragmented packets
Reduce log level from info to debug level for
received fragmented packets in dp_rx_defrag path.

Change-Id: I0d1c7bf91e0337a56ea9e52565e0cbdf47a1772d
CRs-Fixed: 2385483
2019-01-31 19:58:39 -08:00
Karunakar Dasineni
6fb46e2759 qcacmn: Release link descriptors on defrag errors
Link descriptors should be returned to WBM release ring if
fragments are not reinjected due to defrag errors.

Change-Id: Ia37db9f195f6848092918cf7cc221dc50e827ac5
2018-12-12 01:45:50 -08:00
chenguo
5fc91d835e qcacmn: Safely cleanup reorder frag list during RX defrag flush
Need to use tid_lock to protect the rx_tid data structure in the
dp_rx_reorder_flush_frag function. Or else there will be race
condition issues.

CRs-Fixed: 2357226
Change-Id: I860a64b529f0548eced7b537c4180a2c57175a56
2018-12-03 11:01:30 -08:00
Jinwei Chen
1adbd73547 qcacmn: fix excessive logging about rx defrag
Change rx defrag related log level from info to debug,
it's not necessary to print normal rx defrag operation related
log default, this can avoid panic caused by excessive logging
when receive lot of fragment data.

Change-Id: Id712d546a760377a6f59b321f73d7ae5ca4af564
CRs-Fixed: 2353869
2018-11-26 15:52:48 -08:00
jiad
095729006f qcacmn: Fix switch-unreachable build error
This change fixes build errors with compiler option
-Werror=switch-unreachable.

Change-Id: I731267648689a4c68fe1822c7b5f89918923cdcf
CRs-Fixed: 2346023
2018-11-13 01:11:43 -08:00
Pamidipati, Vijay
b75e8108a1 qcacmn: Fix the buffer replenish ring for REO errors
Currently buffers reaped in REO exception ring handler are being
replenished into 5G MAC ring always.
Fix this by using appropriate MAC ring for replenish

Change-Id: I04f5a1179a7df4b018b6a0b435e2a0421ef534e5
2018-11-09 13:11:27 -08:00
jiad
4320219982 qcacmn: Fix format build error
This change fixes build errors with compiler option
-Werror=format=.

Change-Id: I98b93f776c7d58a12d93e1be3a6acf34486ddfab
CRs-Fixed: 2344756
2018-11-08 09:40:18 -08:00
Lin Bai
2a78c0054c qcacmn: Avoid excessive defrag log in spinlock
The excessive/unnecessary ERROR level log during defrag_flush will
cause WDOG timeout on MSM platform. Also, it will lead to the
spinlock be held too long.
Move them out of spinlock, and de-priority/remove unnecessary one.

Change-Id: I3501e0e40a268f073c80ab36abfe762a007e5672
CRs-Fixed: 2342065
2018-11-07 01:35:55 -08:00
Pramod Simha
068e6b92df qcacmn: Fix mic header derivation for 4 addr format packets
Extract the QoS field for 4 address format packets from the correct offset.

Change-Id: Icae4750026c2834bc84eebccbe6fa835212ccb18
CRs-Fixed: 2257255
2018-10-29 16:47:10 -07:00
Sravan Kumar Kairam
118f53494f qcacmn: Return error for HAL src ring next entry desc is NULL
In rx defrag reo inject frame when next hop and cached tail pointer
becomes equal src ring next entry desc returned will be NULL. There
is no NULL check and NULL pointer is dereferenced. In this change
add NULL check and return error status when the next entry desc is
NULL.

Change-Id: I79ca6ba6e6501f03c0c5d188780745b6931102fe
CRs-Fixed: 2318701
2018-10-13 03:19:49 -07:00
Venkata Sharath Chandra Manchala
d18887ee9f qcacmn: Compilation fixes for SM8150 platform
1. Address out of bounds array access while
   populating mcs rates.
2. Use cdp_sec_type enum inplace of htt_sec_type
   for common code.

Change-Id: I0ae1e0acaf7422e73dc26befc9f066f3f424ec6b
CRs-Fixed: 2327153
2018-10-11 10:39:55 -07:00
Sravan Kumar Kairam
26d471ec56 qcacmn: Take peer ref count and dec it after using
Currently peer reference is used with out taking any ref count.
In parallel context execution on different core peer reference may
be cleaned up in peer unmap event. So take ref count while using
the peer reference and decrement after done with it.

Change-Id: I02ca172cbdc4309fabd3bbbad00940826662bbd3
CRs-Fixed: 2301963
2018-09-27 20:24:36 -07:00
Pramod Simha
fab0917d22 qcacmn: Set nbuf frag list to NULL
Set the frag list of the nbuf of a RX defragmented pkt to NULL.
This list will be used to stich the fragmentation list.

Change-Id: I341b0085c123a72dcd74d7f76a4979286e75dc8e
CRs-Fixed: 2297483
2018-09-06 16:13:27 -07:00
Venkata Sharath Chandra Manchala
a7d5874dba qcacmn: Account for fragmented packets
Account and print fragmented packets received
on the Rx error path.

Change-Id: I078b6524e8de279445bf5f1f156655c354a169b6
CRs-Fixed: 2303817
2018-09-06 11:48:16 -07:00