Commit Graph

469 Commits

Author SHA1 Message Date
Ananya Gupta
789b303c02 qcacmn: Clear number of users per ppdu in monitor mode
Currently, when a new ppdu is received, num_users per ppdu is
not getting cleared after every ppdu is processed. Hence, in OFDMA
cases the number of users increments for each ppdu and asserts when
number of users exceed the OFDMA_NUM_USERS.
To fix this, clear num_users when the ppdu is processed from status
ring in monitor mode.

Change-Id: If2598486338650342b83d65f2d5410a73c38c006
CRs-Fixed: 3664999
2024-03-19 15:06:36 -07:00
Amit Mehta
03f346bc1e qcacmn: Add changes to distinguish between LPC and STA+MON
Currently there is no way to distinguish between
Local Packet Capture and STA+Mon mode as both mode
uses same monitor interface. So to distinguish between
two mode in local_packet_capture enable case use
mon_flags which can be passed during monitor interface
add time. If "flags otherbss" is passed during
monitor interface add driver will consider current mode
as STA+MON mode, LPC otherwise.

Change-Id: I56a724697bb187d0b809b6c43c7b5bf4b7d15ca7
CRs-Fixed: 3739438
2024-03-18 01:57:08 -07:00
Amit Mehta
117e50a841 qcacmn: Reset monitor mon filters to init state
Currently during local packet capture filter reset
mon_pdev monitor filters are not reset to default init
state, which can result in issue in STA+Mon case as
packets will not be routed to monitor rings.

So to fix the issue reset mon_pdev monitor filters
to init state on LPC filter reset.

Change-Id: I45c354381405427ef28eee6a31fae4f54c4ab5ab
CRs-Fixed: 3739278
2024-03-11 09:08:53 -07:00
Karthik Kantamneni
743218686f qcacmn: Fix uninitialized mon status desc pool lock issue
Currently Mon status ring resources allocation and cleanup
is not in sync, during cleanup we are freeing more than allocated
for single MAC solutions like QCA6750.

Fix this by cleaning mon status ring resources properly for single
mac QCA6750.

Change-Id: I8c8564d106fda29f7a6a36f887aa3adee9dc1edf
CRs-Fixed: 3693448
2024-01-08 01:33:28 -08:00
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
Jinwei Chen
ed6975b47a qcacmn: Reset Mon RX PPDU status at the end of Mon status processing
Scenario:
STA connected to AP and another monitor interface is up,
monitor status ring filter will be configured. If TLV TAG
WIFIPHYRX_GENERIC_EHT_SIG_E is reported in monitor status
buffer, each single status buffer processing will add 1 to
ppdu_info->rx_status.num_eht_user_info_valid, but it never be
reset to 0 in this case. once > 4 times this kind of monitor
status buffer is processed, num_eht_user_info_valid will be
OOB of array ppdu_info->rx_status.eht_user_info.

Reset PPDU RX status when finished processing PPDU RX status.

Change-Id: Ie58e45b3a39b7b88b0f72df2ac3076ddf659147b
CRs-Fixed: 3649604
2023-11-03 10:08:25 -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
Anirban Sirkhell
b69c6a113c qcacmn: Round-up average utilization of clients
Client utilization is computed as percentage. Round it
up to the closest integer value.

Change-Id: I324370db447fae8a462a146357b6a50510c7e0b7
CRs-Fixed: 3623584
2023-10-23 15:55:13 -07:00
Aman Mehta
d4bf137aa0 qcacmn: Update optimization flag for rx avg rate
Update the branch prediction compiler optimization flag for
rx avg rate calculation from unlikely to likely.

Change-Id: I0abe10d27070292995e07914e75b9a137c6c91b7
CRs-Fixed: 3628056
2023-10-20 08:00:19 -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
Karthik Kantamneni
6f36269b7a qcacmn: Don't return error when mon status ring replenish fails
Don't return error even when host fails to attach single
buffer to monitor status ring, because in ring process path
buffer attach should be taken care if not done in replenish path.

Change-Id: Id032959234a66d3eb4c35819f760d37eb92a08be
CRs-Fixed: 3634756
2023-10-18 00:53:02 -07:00
Aman Mehta
37e5a76c07 qcacmn: Add ini to control rate filter for rx avg
Adds ini field to control the filter for rx avg rate calculation.
	0     : Filter Disabled
	11000 : Max rate filter (in kbps) supported for filter

Change-Id: I6ae88b7af3d4c1fae033101e77b308949e5b3d1e
CRs-Fixed: 3628056
2023-10-18 00:52:30 -07:00
Nandha Kishore Easwaran
15654da3ec qcacmn: Revert - Move lithium specific code into 1.0 files
This reverts commit I3504052e7d717bb6e26af1b3980c2bb926df9a9b

Reason for revert: 2.0 tx ops registration failure

Change-Id: I1c27fb337e33b6533185a52a809f2b13b09edf45
CRs-Fixed: 3636070
2023-10-10 19:37:47 -07:00
Nandha Kishore Easwaran
c779207718 qcacmn: Move lithium specific code into 1.0 files
Move lithium specific monitor code into monitor 1.0 files.
Donot include 1.0 specific files when CONFIG_LITHIUM is not defined.

Change-Id: I3504052e7d717bb6e26af1b3980c2bb926df9a9b
CRs-Fixed: 3615746
2023-10-09 02:13:18 -07:00
Venkateswara Naralasetty
55527a7c79 qcacmn: Changes required to enable monitor mode for Rhine architecture
Changes required to enable monitor for Rhine architecture.

Change-Id: Ib2558c9e61a3e55a68c0f612aed7a153feeb3f17
CRs-Fixed: 3631592
2023-10-07 00:01:33 -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
Karthik Kantamneni
3600a51a25 qcacmn: Fix RXDMA null buffer address access issue
During mon_pdev_init RX monitor status buffers will be attached
to status ring. In case of buffer allocation failure HP will be
pointing to null buffer address entry and during ring process
this index slot will be skipped. This will lead to RXDMA accessing
null buffer address descriptor.

Fix this by adjusting the HP of monitor status ring during RX
buffer allocation failures.

Change-Id: I290a724fefc6f65be058a84c97b9e6d51a08ef39
CRs-Fixed: 3268663
2023-10-05 07:01:00 -07:00
Vaishnavi Chekuru
c3697eb2a0 qcacmn: Changing the integer suffix from 1L to 1ULL
In expression 1L << err_code if the err_code is more than 32,
it is left shifting by more than 32 bits which will result in
undefined behavior and will be overflowed. So changing the suffix
from 1L to 1ULL as max value of err_code can go up to 63.

Change-Id: I6218a1634e982e4f25e5d92d55325ed9bb2658e9
CRs-Fixed: 3627050
2023-10-04 19:03:05 -07:00
Aman Mehta
d6ee46a496 qcacmn: Add support for average tx/rx rate
Apstats use to return last tx/rx rate for avg. tx/rx rates.
This change updates the behavior to return average tx/rx rates.

Change-Id: Idfff2ae9df7c5af1ef86ceb5688b1e01fd6dae21
CRs-Fixed: 3628056
2023-10-03 12:01: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
Aman Mehta
3694cff9dc qcacmn: Update mlo ctx stats API with xmit type
Update mlo ctx stats API with xmit type. MLO ctx ingress stats will
be stored as per the legacy/mlo xmit type.

Update stats incrementing mechanism on peer unmap.

Change-Id: I2f16b95e64e6a7697d18d9453e9f7c60631f80bb
CRs-Fixed: 3561679
2023-09-27 22:13:35 -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
Jinwei Chen
65fdbbce9a qcacmn: skip monitor reap timer if irq is enabled
For CFR test, monitor reap timer will start, meanwhile
irq for monitor status ring is also enabled, these two will
conflict and access mon_pdev->rx_status_q in the same time,
skb double free issue is reported.

If irq for monitor status ring has been enabled, skip to start
monitor reap timer which is unnecessary.

Change-Id: Ic015d370cb80604d7e4c261054ad529b64edca25
CRs-Fixed: 3614097
2023-09-17 02:36:28 -07:00
Sushant Butta
37c16635b1 qcacmn: Set fast_tx flag when ol_stats are disabled
Set fast_tx when ol_stats are disabled in
ultra_fastpath to avoid Tx completion overhead.
And also includes following fixes:
cdp support to get jitter stats
cdp support to set/get vow stats
cdp support to get Sojourn Stats

Change-Id: I8bdb176edbdf210b4dedfaa117f058f57bd17241
CRs-Fixed: 3604215
2023-09-16 07:45:49 -07:00
Jeevan Kukkalli
29bda86420 qcacmn: Avoid double monitor rings deinit
Avoid redundant call to monitor rings deinit during
pdev deinit.

Change-Id: Ib298203b1fee5897371d9d5e13d0fb4abe118077
CRs-Fixed: 3613036
2023-09-14 04:45:07 -07:00
Adwait Nayak
af00744c5d qcacmn: Update tlv hdr size to 8 Bytes for QCA5332 and QCN6432
Issue:
TX Monitor feature is broken recently in mainline (12.4)
for both QCA5332 and QCN6432.

RCA:
As part of tx monitor processing, it is needed to iterate
through the status buffer queue to populate TX PPDU info.
Every TLV present in the status buffer is parsed one by
one. Moving from one to next TLV is done based on:
tlv + tlv length + tlv header size

And the TLV tag gets computed from the initial 4 Bytes of
the TLV; TLV tag is generally used for further TLV parsing
methodology at HOST.

In case of QCA5332 and QCN6432, the tlv header size should
be 8 Bytes, whereas it is 4 Bytes now. Hence, right after the
first TLV is parsed, we see the TLV tag being computed as 0
for the second TLV and since there is a miscalculation of
4 Bytes in every TLV parsing, all other TLV parsings are
improper. This is the reason why the TX DATA TLV is getting
invoked before TX MPDU START; which results into system crash.

Fix:
Update the TLV header size to 8 bytes

Change-Id: Ib2857ae55e309a78ed6ee9bdbe695ae6daa71a08
CRs-Fixed: 3588743
2023-09-11 15:51:07 -07:00
Bing Sun
e6bd68e884 qcacmn: Fix API with "no previous prototype" build error
If the function neither static nor declared before, it reports
build error "no previous prototype for"。
Define the function as static if it is not declared before.

Change-Id: I12294af372ff9586c99b726bcf755a4fa3e7ba28
CRs-Fixed: 3606048
2023-09-11 03:39:08 -07:00
Ruben Columbus
dcfc490267 qcacmn: debug and reset functionality for monitor
monitor reset functionality when bkpressure is seen.
debug logs added to inspect monitor ring in case of bp.

Change-Id: I8e79f97b315653f302da087ea8d82362ba02723d
CRs-Fixed: 3542923
2023-09-03 10:42:07 -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
Jeevan Kukkalli
89339b7e3a qcacmn: Add check for invalid frame ctrl version
Add check for invalid frame control version while
handling raw frames with FCS errors

Change-Id: I443bb20c5516604ff3ba797570118b3b2123dbd5
CRs-Fixed: 3589137
2023-08-31 11:01:07 -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
nobelj
7de7642831 qcacmn: Remove packet bandwidth offset from snr
Remove packet bandwidth offset from SNR. So that SNR derived from TLV
path and SNR derived from periodic stats looks same.

Change-Id: Iaed3e3321768bef16ac1ea164920dc35eea8f002
CRs-Fixed: 3585817
2023-08-26 05:24:51 -07:00
Venkateswara Naralasetty
c62ef80144 qcacmn: Change number of RXDMA_STATUS_RING allocations
Currently two RXDMA_STATUS rings are allocated for the station targets
irrespective of whether DBS supported or not. Only one RXDMA_STATUS_RING
being used for non-DBS targets like QCA6750 and WCN6450, hence change
the number of RXDMA_STATUS_RING allocations to 1 for non-DBS targets.

Change-Id: I4f14c8b5cee892979765f776b37d44e99ba2d558
CRs-Fixed: 3578733
2023-08-16 13:37:11 -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
nobelj
d26a05fafd qcacmn: Add fix to free buffer properly on error case
In rx monitor deliver, Buffer need to be free properly for any
failure after MPDU restitch.

Change-Id: I7d2f649e8266d91d50a429a92c07bc42d1d730eb
CRs-Fixed: 3580509
2023-08-08 06:11:04 -07:00
Jeevan Kukkalli
c92389fe5f qcacmn: Improve readability of monitor error messages
Improve readability of monitor filter update error messages.
This will help to avoid redundant error message printing from
caller.

Change-Id: I63dbc52be7a2f9537bf226fe0008c4efb51fe582
CRs-Fixed: 3576860
2023-08-08 00:01:41 -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
2e35a8785e qcacmn: Fix lite mon deallocation
Lite monitor deallocation should happen before mon rings deinit.
Call lite monitor dealloc function before mon rings deinit

Change-Id: I9b93945ccc092ff524555e8a4aa9cd2e3877f70f
CRs-Fixed: 3578630
2023-08-03 10:04:02 -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
aloksing
754c291a51 qcacmn: Do not update tx rate stats for fixed rate
Update rounded avg rate only for qos tid and if TX is
not at fixed rate.

CRs-Fixed: 3531181
Change-Id: I03a9a2b88b7859bd230672e6ac321d31a71defef
2023-07-17 22:37:23 -07:00