Commit Graph

265 Commits

Author SHA1 Message Date
Amir Patel
136b01ad6b qcacmn: Introduce monitor 2.0 packet processing flag
QCA_MONITOR_2_0_PKT_SUPPORT is introduced for packet
processing code.

Change-Id: Ib4de57e3e74ca9161d0cb7e3507f9c28d06b8654
CRs-Fixed: 3647037
2023-11-03 10:09:48 -07:00
Amir Patel
768fbdfce9 qcacmn: Fix assert in TxMON reap path
Avoid logic to detect duplicate cookie in TxMON

Change-Id: Ib3296aff72b016adababb9eb2818420ec49fbb79
CRs-Fixed: 3648225
2023-10-29 03:33:31 -07:00
Jeevan Kukkalli
959b66b917 qcacmn: Avoid memzero operation in monitor interrupt handling
Avoid ppdu info structure memzero operation while handling
monitor interrupts. ppdu info structure can be memzeroed
from workqueue context

Change-Id: If2436f7448780926f685ed6a00e14efa68cbfc6d
CRs-Fixed: 3619199
2023-10-19 14:43:06 -07:00
Anirban Sirkhell
aa8c23c911 qcacmn: Fix OOB array access
User-ID starts from 0 and can go upto HAL_MAX_UL_MU_USERS-1.

Change-Id: Iedbc48f03d7375496f34f541c1cca25fef9336df
CRs-Fixed: 3629330
2023-10-18 22:47:23 -07:00
Ruben Columbus
ab8c55ec38 qcacmn: correct casting and array write index
- correct uint32_t* casting to uint16_t* given that it can overwrite values
after is dereferenced
- correct check for "for loop" max iteration as it could pass and
overwrite max array size.

Change-Id: Id2b02d1eea8c4ce4d962160bea99358fe3ab5cf7
CRs-Fixed: 3622399
2023-10-06 18:25:57 -07:00
Amir Patel
ce99e4ef10 qcacmn: Add debug to catch non-consecutive duplicate descriptor
Add debug to catch non-consecutive duplicate descriptor in monitor

Change-Id: I253cecf472d5d75154f5791f85761da2f6d9076e
CRs-Fixed: 3628868
2023-10-06 15:30:22 -07:00
Amir Patel
a7be27e5de qcacmn: Fine tune monitor dup desc WAR
In existing host WAR, we set pre_desc to NULL. Due to this
duplicacy across PPDUs is not caught. remove setting prev_desc to
NULL.

Change-Id: Ib2c903eb768fa399c37e9b1d17b661b9ae1c1d2a
CRs-Fixed: 3629867
2023-10-06 03:04:45 -07:00
Jeevan Kukkalli
dc9d363e5b qcacmn: Add check for invalid frame ctrl version
Add check for invalid frame control version while handling
raw frames with FCS errors in monitor version 2 path

Change-Id: Ia46de15a235ec5ab2f0b67ff9769cb0b5c38aeee
CRs-Fixed: 3620872
2023-09-30 22:10:38 -07:00
Amir Patel
f03c62102b qcacmn: Update per-MPDU fcs err in radiotap hdr
Update per-MPDU fcs err in radiotap hdr

Change-Id: I3570ec94435746538cccc07ec052e26a19ab6452
CRs-Fixed: 3619376
2023-09-29 16:30:51 -07:00
aloksing
712dc13309 qcacmn: Fix duplicate mon desc issue
We are caching status desc till truncated end reason.
Now if quota gets over before non truncated end reason
will exit from srng processing.
And before next napi if wifi down happens then during
pdev deinit we are not flushing cached status and packet desc.
which leads to duplicate desc because after
init we are resetting freelist to start of desc pool and
we still process previously cached descs.

Flushing all status and packet descs during mon pdev deinit.

Change-Id: Iaea1115f1660d0b35bf284d9b485ac86bfccf5c6
CRs-Fixed: 3587299
2023-09-26 14:41:32 -07:00
aloksing
37f00a180c qcacmn: Add Word mask MPDU END TLV for monitor
Receiving MPDU end TLV length as 0
because TLV compaction is enabled and
wmask for mpdu end tlv is set to 0.

Adding word mask for MPDU END TLV.

Change-Id: If065cbf19f979734123a433e467a8a9bb8a1013a
CRs-Fixed: 3613053
2023-09-19 02:28:35 -07:00
Amir Patel
dd839c2135 qcacmn: Fix compilation issues
Fix compilation issues when below macro are undefined
a) WLAN_PKT_CAPTURE_TX_2_0
b) WLAN_TX_PKT_CAPTURE_ENH_BE
c) BE_PKTLOG_SUPPORT
d) DP_RX_MOM_MEM_FRAG.

CRs-Fixed: 3571652
Change-Id: I066ace0b51fd628d31b2d7161765bf9d0c405549
2023-08-31 18:36:29 -07:00
Jeevan Kukkalli
d2a9cfa5ed qcacmn: Address asserts in rx monitor path
Remove unnecessary asserts in rx monitor path

Change-Id: Iafce86bc0c1938b0227e89e4032e36eedd9d8dc7
CRs-Fixed: 3591989
2023-08-31 18:36:08 -07:00
Amir Patel
32c2f949a6 qcacmn: Address asserts in monitor path
Address asserts in monitor path

CRs-Fixed: 3591470
Change-Id: I4a5fbda57e91da6579ca945ecfcb12488b4413f1
2023-08-31 18:35:58 -07:00
Santosh Anbu
9bfc041802 qcacmn: Use lockless SRNG access for rxdma_mon_dst ring
Since rxdma mon dst srng processing interrupt is tied to single CPU core,
locking is not required to access the srng.

Hence move to lockless srng access.

Change-Id: I58ef7b4c92919bbccea5c86c266738799c0dac85
CRs-Fixed: 3592154
2023-08-28 05:43:53 -07:00
Adwait Nayak
7ce350b5a0 qcacmn: Do not enable word compaction for pktlog
Recently, Word compaction is by default enabled as part
of all monitor mode realated features. Due to which, while
parsing the pktlog data, multiple TLV parsing errors are seen.
Hence, with this change word compaction is disabled if pktlog
is enabled.

Change-Id: I35153f74da2de5978b225ced7f8c1112f3aff3b2
CRs-Fixed: 3551975
2023-08-15 17:52:45 -07:00
Amir Patel
8af70480b3 qcacmn: Fix compilation issues
Fix compilation issues when QCA_KMEM_CACHE_SUPPORT
is not defined

CRs-Fixed: 3577327
Change-Id: I0715e6d5702aab793823a0b42c1eea5322eadb74
2023-08-03 13:17:47 -07:00
Jeevan Kukkalli
07824cbd75 qcacmn: Fix indentation
Fix indentation in status tlv processing function

Change-Id: Ie575c71ebdf3def30ec2a914cdca44442a6a9fa3
CRs-Fixed: 3575953
2023-08-01 20:29:53 -07:00
Amir Patel
dae2d5c316 qcacmn: Adjust mon ring fill level based on num_entries
Adjust mon ring fill level based on num_entries in ring

Change-Id: Iaa6fa2f1c3742a60b5980bbf153ddc7b03733168
CRs-Fixed: 3575947
2023-08-01 20:29:33 -07:00
Sushant Butta
8b9b8a9a16 qcacmn: Add check to validate length of packet buffer
Add check to validate length of the packet
buffer before adding to skb.

Change-Id: I78cf436c4bf6a00b1aa08ef82cb790c2b3478733
CRs-Fixed: 3553974
2023-07-25 15:21:59 -07:00
Srinivas Girigowda
afd51dc121 qcacmn: Add local packet capture type based filtering
For the control frames regenerated by the host driver based on the
TxMon TLV, add the local packet capture type based filtering.

Change-Id: If6b47368ce36524e1c84c51c298278ced671b915
CRs-Fixed: 3531895
2023-07-18 22:55:44 -07:00
Jinwei Chen
6081fb19d6 qcacmn: Support dp monitor desc pool memory pre-allocation
Support dp monitor desc pool memory pre-allocation.

Change-Id: I7edd766a3f02be76c1e7342ac6a55c02b43474fa
CRs-Fixed: 3544435
2023-07-08 01:26:16 -07:00
Jeevan Kukkalli
89792f7221 qcacmn: Add check for invalid mon rx header
Add check for invalid rx header before processing
TLVs.

Change-Id: I57d3ff6ccc45723eb9b1ef7f048a5ea5a3718e50
CRs-Fixed: 3527793
2023-06-23 04:37:01 -07:00
Balaji Pothunoori
4bc335300f qcacmn: Fix compilation errors
dp_htt_process_smu_ppdu_stats_tlv API is defined inside
QCA_ENHANCED_STATS_SUPPORT along with WLAN_FEATURE_PKT_CAPTURE_V2
protection but API is called with WLAN_FEATURE_PKT_CAPTURE_V2.

There is a compilation error
a. if WLAN_FEATURE_PKT_CAPTURE_V2 is defined and if
QCA_ENHANCED_STATS_SUPPORT is not set.
b. if REMOVE_PKT_LOG and WLAN_FEATURE_PKT_CAPTURE_V2 is set.

This change is to move dp_htt_process_smu_ppdu_stats_tlv
out of QCA_ENHANCED_STATS_SUPPORT and add WLAN_FEATURE_PKT_CAPTURE_V2
protection to avoid compilation errors.

Change-Id: I50093ede0530afa34f501210e5a53fa88e61d863
CRs-Fixed: 3528736
2023-06-20 06:39:09 -07:00
Jeevan Kukkalli
aa280d43e6 qcacmn: Handle duplicate pkt desc in wkk monitor path
Sometimes we receive duplicate packet buffer descriptors.
This results in corruption of descriptor freelist.
Add check to handle duplicate packet monitor descriptors.

Change-Id: I1dd33575fba78a7816063c40bf29ba41f9bcf226
CRs-Fixed: 3519326
2023-06-16 15:03:34 -07:00
Kenvish Butani
8ab3e327e2 qcacmn: Fix the OOM issue seen in ol_stats disable path
currently in disable ol_stats path, if disable ol_stats
is triggered for any pdev, then due to MLO link stats we
disable ol_stats on all pdev's. if the pdev deinit is
already happened then we skip disabling it and dont send
h2t complete free nbuf message, creating OOM. Fix is to
remove the pdev deinit check and disable ol_stats only
for particular pdev and not pdev of MLO.

Change-Id: I6171c6f545ed823cdec211c6ac00b8e0ff93211a
CRs-Fixed: 3511913
2023-06-09 13:50:25 -07:00
Harsh Kumar Bijlani
e0e7eaeba6 qcacmn: Optimize Tx and Rx monitor stats update code
Optimize Tx and Rx monitor stats update code by replacing
multiple if checks with switch case statements

Change-Id: I07dd7784dccdfe0cf0e1ade822746d0c6f55cd95
CRs-Fixed: 3511037
2023-06-07 07:01:06 -07:00
aloksing
a0805fb4d0 qcacmn: Fix double free of frags
When decap type is invalid, freeing nbuf and while next monitor
buffer tlv picking last nbuf from queue. which has allocated frags
and valid data. expecting MPDU END TLV for previous mpdu
before monitor buffer tlv to allocate new nbuf.

Set rx_hdr_rcvd to false when we receive invalid decap type.

CRs-Fixed: 3503694
Change-Id: I97ede9e52df580769b78afc767ba9528914b3ea5
2023-06-05 03:40:10 -07:00
Mukul Dhiman
24fcc62ef2 qcacmn: Fix ol_stats enable if MLO is disabled for BE platforms.
On BE Platforms, currently if MLO is disabled, ol_stats does not
get enable on any soc. Fix is to enable ol_stats on particular
soc if MLO is disabled

Change-Id: I715f06776eda9539f68f440f86e3a403a6b14fa5
CRs-Fixed: 3508711
2023-06-02 16:50:02 -07:00
Jeevan Kukkalli
958704d20e qcacmn: Make dp_rx_mon_append_nbuf function public
Function dp_rx_mon_append_nbuf is now accessed outside
the file where it is declared hence make it public

Change-Id: I6b596815a385ba367f70b9e5ea07c94520cca253
CRs-Fixed: 3488043
2023-05-29 12:54:57 -07:00
Aniruddha Mishra
ba55e0f2a8 qcacmn: Add Tx TLV Recording support
Add Tx TLV recording support for monitor 2.0
Also add support to control Rx and Tx TLV
recording

Change-Id: I27a0d2c9ea8bdfacd46e6b7188b45b08ed47bbcd
CRs-Fixed: 3422787
2023-05-16 11:43:14 -07:00
Srinivas Girigowda
08ea5c2b80 qcacmn: Add support for local packet capture running
Add support for local packet capture running.

Change-Id: Id954c57a32210c180a8e0f9107e2469f96491173
CRs-Fixed: 3415816
2023-05-10 11:51:09 -07:00
Srinivas Girigowda
13554f0cdc qcacmn: Add support for local packet capture stop
Add support for local packet capture stop.

Change-Id: Ib12574f5b418ea009ec35ef85e170bc8c592c86f
CRs-Fixed: 3415812
2023-05-10 11:50:54 -07:00
Srinivas Girigowda
d52311a2b1 qcacmn: Replace IEEE80211_* macros with with QDF_IEEE80211_* macros
IEEE80211_* macros are defined in WIN specific header file which is not
available on MCL side, Hence replace these macros with QDF_IEEE80211_*
macros available in common header file

Change-Id: Ic2caaebacd9edded23aebefab87cd82dbbb06974
CRs-Fixed: 3415721
2023-05-10 11:50:41 -07:00
Srinivas Girigowda
5d8e550bb7 qcacmn: Add support for local packet capture start
Add support for local packet capture start and relevant changes.

Change-Id: I709e41e0be09cf73e93694efc59bfefbf51fe359
CRs-Fixed: 3415788
2023-05-10 11:50:28 -07:00
Srinivas Girigowda
9c855c06e2 qcacmn: Separate out the implementation for RX 2.0 and TX 2.0
Separate out the common function implementing both RX 2.0 and TX 2.0
functionality in to RX 2.0 and TX 2.0 separate functions.

Change-Id: I29337aca9851dce1888a492a9534992277f595b5
CRs-Fixed: 3427301
2023-05-10 11:50:01 -07:00
Srinivas Girigowda
ce736a1d8d qcacmn: Rearrange the functions to appropriate files
Rearrange the functions to appropriate files based on TX and RX 2.0.

Change-Id: Ie8e562a7aecdc91257210b55a323dfe47e67878c
CRs-Fixed: 3427296
2023-05-10 11:49:36 -07:00
Srinivas Girigowda
0419d28f6e qcacmn: Move TX 2.0 code under WLAN_PKT_CAPTURE_TX_2_0 macro
Move TX 2.0 specific code under WLAN_PKT_CAPTURE_TX_2_0 macro.

Change-Id: I20bb1e49a902ec085fbc3df6828fef94a7c577d6
CRs-Fixed: 3415780
2023-05-10 11:48:59 -07:00
Srinivas Girigowda
ec3b9bdbce qcacmn: Move cmn code under QCA_MONITOR_2_0_SUPPORT to TX/RX 2.0 macro
Currently QCA_MONITOR_2_0_SUPPORT macro is used for both TX and RX 2.0.
but on MCC side, only RX 1.0 is supported and as part of this feature
TX 2.0 need to be supported.
Enabling QCA_MONITOR_2_0_SUPPORT will enable both RX 2.0 and TX 2.0, but
to support RX 1.0 and TX 2.0, we need to separate out code under
QCA_MONITOR_2_0_SUPPORT to TX and RX 2.0 macro.

As part of this change, introduce separate macros for TX 2.0 and RX 2.0
and move the common code under both macros.

Change-Id: I7ef7e488800934291538a0bca9acd21e28901214
CRs-Fixed: 3415740
2023-05-10 11:48:32 -07:00
Harsh Kumar Bijlani
2be2bf6a69 qcacmn: Fix memory leaks in Rx monitor path
Fix the following 2 memory leaks in Rx monitor path:

1. When MPDU queue is empty and MON_BUF_ADDR_TLV is received,
   then free page fragment memory.

2. In case of small size packets, 1 MPDU can have more than
   2*QDF_NBUF_MAX_FRAGS fragments wherein each nbuf can have maximum of
   QDF_NBUF_MAX_FRAGS frags. In this case, add the frags to nbuf in the
   following way.

   parent_nbuf (QDF_NBUF_MAX_FRAGS frags attached)
	|
	| (fraglist)
	|
	----> tmp_nbuf1 (QDF_NBUF_MAX_FRAGS frags attached) ----> tmp_nbuf2
							    (next)

Change-Id: I54e8162bf0b9da8629a3c80d123421fbeaf8df11
CRs-Fixed: 3453676
2023-04-27 04:08:30 -07:00
Linux Build Service Account
93bac8788e Merge "qcacmn: Move mon mac filter func to mon ops structure" 2023-04-21 12:47:52 -07:00
Linux Build Service Account
956f3ba2c7 Merge "qcacmn: Fix pad byte place holder calculation" 2023-04-21 09:15:32 -07:00
Jeevan Kukkalli
a913b30811 qcacmn: Move mon mac filter func to mon ops structure
Monitor ops functions are different for version 1 and 2.
Move mon mac filter func ptr to mon ops structure so that
its initialized properly according to monitor version.

Change-Id: Ie07ae3b7d3e9923e463db503aaa8b3500c1e1eac
CRs-Fixed: 3456620
2023-04-19 08:08:00 -07:00
Srinivas Girigowda
3228443af7 qcacmn: Set Tx ring packet type flag properly
Currently, HTT Tx ring packet type flag is set as bitwise operation
which is incorrect and results in "Debug Assert Caught".

Set this CTRL and DATA packet type flag with a value of 1.

Change-Id: I62e89fe637441fcc680ea8d5fe8d157d8e7142ae
CRs-Fixed: 3415733
2023-04-14 08:24:44 -07:00
Srinivas Girigowda
7a5a84d777 qcacmn: Fix compile error 'address of array will always evaluate to true'
address of array 'tx_ppdu_info->hal_txmon.rx_user_status' will always
evaluate to 'true' [-Werror,-Wpointer-bool-conversion]

Change-Id: Ic148f34b82ce756eb07173b43f8f155a7b4a12d9
CRs-Fixed: 3415726
2023-04-14 08:24:33 -07:00
Jeevan Kukkalli
2d6a71891c qcacmn: Fix pad byte place holder calculation
Fix pad byte place holder calculation during restitch

Change-Id: I577a9efe750ef519d2279d5e7426334549550628
CRs-Fixed: 3464890
2023-04-13 17:18:37 +05:30
Sushant Butta
623d334801 qcacmn: Fix typo while getting ppdu_info
Use ppdu_free_list_elem while getting
free ppdu_info from kmem_cache.

Change-Id: I4ea921deb962dafd3f751954d6e7d2f1f98d3125
CRs-Fixed: 3455202
2023-04-06 10:38:34 -07:00
Aniruddha Mishra
dc75883972 qcacmn: Free buffer after processing flush_tlvs
Buffer was freed before processing the TLVs
(while flushing) leading to use after free access.

CRs-Fixed: 3425044
Change-Id: Ida3bcf9add95041c43b2b1e8e3450853bd0ed88c
2023-04-02 06:53:24 -07:00
Jeevan Kukkalli
785b786014 qcacmn: Reduce log level to avoid console flooding
Reduce log level to debug from error to avoid console flooding
when low mem condition is hit.

Change-Id: I0341beed9059c4db2eba2cc481a797d67dd35b25
CRs-Fixed: 3442503
2023-03-31 06:06:54 -07:00
Nandha Kishore Easwaran
41d3710c17 qcacmn: Change monitor print to debug level
Change monitor print to debug level as this print causes flooding
and could potentially lead to CPU flooding.

Change-Id: I76cda51c9d3d0658ebd02b2112fba5310d8eb22c
CRs-Fixed: 3439802
2023-03-29 05:23:39 -07:00