Commit Graph

100 Commits

Author SHA1 Message Date
Chaithanya Garrepalli
e2b00339f3 qcacmn: add APIs to iterate the peers at vdev level
Add new APIs to iterate through the vdev peer list
by taking the peer reference.

A call back has to be passed to these APIs which will
be called for every peer in the lisst

dp_vdev_iterate_peer() -> iterates through peer_list of vdev
dp_pdev_iterate_peer() -> iterates through peer_list of all
                          vdevs in pdev
dp_soc_iterate_peer() -> iterates through peer_lists of all vdevs
                         in soc

Additonal APIs are added to for itearations where the callback
will be called outside the vdev->peer_list_lock, as these APIs
have additional memory allocations suggested to use only in case
the iteration need to happen outside lock

dp_vdev_iterate_peer_lock_safe()
dp_pdev_iterate_peer_lock_safe()
dp_soc_iterate_peer_lock_safe

Change-Id: I24632fe611355cc3e93b7f16d90913d4b8686ca9
2020-08-15 01:26:23 -07:00
Chaithanya Garrepalli
1322dc7949 qcacmn: add state to data path peer
Add states to data path peer and appropriate
checks for transistion of states

Change-Id: Ieaadbf4b406351d48aece7fd3552abe42d61db1e
2020-08-15 01:26:20 -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
86d3df0605 qcacmn: use granular locks to protect peer structures
Remove the global soc->peer_ref_mutex lock to protect
peer access

Instead use granular locks to protect the individual
peer DBs

1) soc→peer_hash_lock : To protect peer hash table
2) soc→peer_map_lock : To protect id to objmap array
3) vdev→peer_list_lock : To protect vdev level peer list

Change-Id: I9f044c4d71fe1155817a2b22a5a050545ec37445
2020-08-15 01:26:03 -07:00
Nitin Shetty
279435cff4 qcacmn: clearing jitter statistics
adding support for clearing jitter statistics
for command "cfg80211tool athX txrx_stats 257"

Change-Id: Iaac9a6e6a849bbb08935ca581fa58c93ef51bdbd
2020-08-13 17:12:45 -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
Jinwei Chen
d552bfa2cb qcacmn: add rx nbuf ipa smmu map/unmap trace
Currently in_use and unmapped flag from rx_desc can not know is
the rx nbuf has done IPA smmu map/unmap accurately.
add rx nbuf IPA smmu map/unmap flag in qdf_nbuf_cb, and use
this flag to check if IPA smmu map/unmap need to be done or not.

Change-Id: I19bbc6cc69ba752ef7c58d41fbe26299ca96d29e
CRs-Fixed: 2731313
2020-08-11 00:35:34 -07:00
Adil Saeed Musthafa
eca6d16539 qcacmn: Move RU and MCS strings to cdp header file
Move RU and MCS strings from dp_stats.c to cdp header file so that these
strings can be used in user applications including the CDP header. This
will remove redundant definitions of these strings in user application

Change-Id: Ie74283f54131378447324b927e19e9716ef7519a
CRs-Fixed: 2749062
2020-08-10 01:58:06 -07:00
Jinwei Chen
d555d146a4 qcacmn: add duplicate link desc check when refill
Same back to back link descriptor address/cookie is observed in
WBM idle link desc ring.
add duplicate link desc check when host
refill link descriptor to WBM through SW2WBM release ring,
also REO reinject ring.

Change-Id: Iaf9defd87670776fa9488d7f650efa3c08fefa60
CRs-Fixed: 2739879
2020-08-04 08:02:35 -07:00
nobelj
4dd08941dd qcacmn: add fix to send ppdu in sequential order
logic of holding ppdu info list is modified to store it
in sequential order.

Change-Id: I179e76f4bb1663e141e48df5f274ac5fd1b81bbc
2020-08-03 13:28:35 -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
Rakesh Pillai
19a0a18573 qcacmn: Ratelimit defrag path error logs and add stats
Ratelimit the defrag path error logs and add the stats
for fragmented packets received out-of-order which
inturn leads to sequence number mistamtch in defrag path.

Change-Id: I17d4c1cff214a8c8a05abf576701824b293d2883
CRs-Fixed: 2740805
2020-07-27 15:58:56 -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
Yeshwanth Sriram Guntuka
8007762d6a qcacmn: Set invalid bit in cookie for exception ring descriptor
On returning the msdu link descriptor to HW via WBM
release ring, the rx exception ring contents are not
zeroed. This could result in host reading stale ring
descriptor content in the scenario when HP is updated
even before the latest values are reflected in the ring
descriptor.

Fix is to set invalid bit in cookie for exception ring
descriptor and add cookie sanity check.

Change-Id: I01a294c92b260ebe8e584ef20e9550b1febec913
CRs-Fixed: 2730759
2020-07-22 03:21:44 -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
Aniruddha Paul
9088f48e99 qcacmn: Print the DP delay histogram
Prints the dp delay histogram on peer basis. This stats
are print as part of the fc_peer_delay command.

Change-Id: I9be971f5b5aa42f40741ee403a0f82dae97981c3
2020-07-15 03:52:22 -07:00
Mohit Khanna
42a8d7ef31 qcacmn: Add P2P UDP/TCP checksum offload INI entry
Add support to enable disable TCP/UDP checksum offload for P2p modes.

CRs-Fixed: 2725395
Change-Id: Id482649e501a8f9a8900a92e3e03a48f0e99603c
2020-07-12 01:49:34 -07:00
Harsh Kumar Bijlani
12f0270968 qcacmn: Align host TLV structures similar to FW TLV structures
FW keeps adding members to htt structure. In order to avoid overflow,
align host tlv structures similar to fw tlv structures and also
validate size of htt_stats tlv before memcpy.

Change-Id: I4719804cd1e65ad14dfcee36685ee2a4ae4f2379
CRs-Fixed: 2700191
2020-07-10 19:49:30 -07:00
Chaoli Zhou
7c40c9d475 qcacmn: Fix compile error while enable CONFIG_REMOVE_PKT_LOG
Cleanup the code to fix the compile error while setting
CONFIG_REMOVE_PKT_LOG=y & CONFIG_WDI_EVENT_ENABLE=n
with Hasting

Change-Id: I493fbddec865fe20789022445b0f155201772119
2020-07-09 09:24:09 -07:00
Tallapragada Kalyan
0ee16f8b94 qcacmn: use proper printk specifier for printing 261 stats
change the printk specifier from %d to %u to print
261 (rx_stats) stats

CRs-Fixed: 2722219
Change-Id: I714b5f018446911d57b34b21b3b4dd7595671a7a
2020-07-01 05:42:48 -07:00
Mohit Khanna
97200aab9c qcacmn: Add NAN TX checksum offload INI entry
Currently there is a single INI item tcp_udp_checksumoffload to enable
or disable this feature for all the adapters. In some cases, we want to
be able to enable this feature selectively for NAN mode.

Add nan_tcp_udp_checksumoffload ini item to enable or disable checksum
offload feature specifically for NAN mode. If
nan_tcp_udp_checksumoffload is 'true' and tcp_udp_checksumoffload is
false, hardware checksum offload will be enabled only for the NAN
adapter and not for other adapters.

CRs-Fixed: 2693638
Change-Id: I6e255ce68ddc7b01ebdefe4e5e8d2c985388fefe
2020-06-16 12:20:20 -07:00
Amir
d2e553e973 qcacmn: Add debug statistics for monitor mode
qcacmn: Add debug statistics for monitor mode

Change-Id: I3fe59af1c7f561bd22f502eb5b19265ecd49ee69
CRs-Fixed: 2677656
2020-05-07 08:44:20 -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
Saket Jha
87dac440fd qcacmn: Dump FW stats for MCS 12/13
Dump additional FW stats for MCS 12/13 due to additions in 4K QAM
support.

Change-Id: I8cf177cb93f484c69951a758c4542e4530617576
CRs-Fixed: 2656272
2020-04-28 03:59:05 -07:00
nobelj
01dcfedca1 qcacmn: Support MU in tx capture mode
Support fix for MU related data frame in tx capture mode.

Change-Id: I8b63eaf320463a3a068beb589089582cafe05001
CRs-Fixed: 2656346
2020-04-27 23:26:50 -07:00
Kai Chen
93d8e4ae42 qcacmn: enable monitor destination ring interrupt
Enable monitor destination ring interrupt to fix
packet is getting stuck in monitor mode.
Fix and add monitor mode debug count

Change-Id: I74efdcf6a4373dd73e373285c8cd3aa5757cd0b2
2020-04-19 10:03:37 -07:00
Jingxiang Ge
e7d41574f3 qcacmn: Add dbgid for each runtime put/get
This is to enhance statics for runtime put/get, which is
to detect if there is mismatch for usage_count.

Change-Id: I24cddb9d10e4cb675c8375cbd0f589c7718bd680
CRs-Fixed: 2647972
2020-04-07 01:20:41 -07:00
Tiger Yu
33bf405da4 qcacmn: Use dp_info_rl instead of QDF_TRACE to avoid aggressive logging
There might be aggressive error logging in the dmesg if wbm_desc_rel_ring
is hang. So use the dp_info_rl instead of QDF_TRACE to reduce aggressive
logging to avaoid spin lock huge delay when processing the
reo_exception_ring.

Change-Id: I4622f28cd6d8771cf27643a867892b62860d1ddc
CRs-Fixed: 2648149
2020-03-31 11:39:39 -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
Aniruddha Paul
b869cb0dde qcacmn: Add jitter stats to per tid Object
Add average jitter, average delay, and total success
packet count stats to per TID object.

Change-Id: Ic3ae6d4c090a5fe82e09c085e92cd5eaea4d2056
2020-03-24 19:57:54 -07:00
Amir Patel
925a7d389c qcacmn: Add full monitor mode changes
Add following changes:
	a. Add CDP API to config full monitor mode
	b. HTT configuration changes
	c. Init/Deinit changes for full monitor mode resources

CRs-Fixed: 2632442
Change-Id: I06db5194031b3ea0f0c1e5deda20df4bc0faa0b9
2020-03-20 22:16:00 -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
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
Ankit Kumar
f63aaef3d3 qcacmn: Rename cmd ring to cmd_credit ring
Command ring is now renamed to credit ring on QCN9000
and used for credit based flow.
Renaming the ring to give meaningful name.

Change-Id: I726aed19477fcfb256e4e0cca8ddb9389035b58c
CRs-Fixed: 2562640
2020-02-15 00:32:25 -08:00
Adil Saeed Musthafa
bbc4de06d7 qcacmn: per-peer protocol count tracking
Maintain packet counters for each peer based on protocol. Following 3
protocols are supported
* ICMP (IPv4)
* ARP (IPv4)
* EAP

Change-Id: I56dd9bbedd7b6698b7d155a524b242e8cabd76c3
CRs-Fixed: 2604877
2020-02-04 14:17:14 -08:00
Shashikala Prabhu
03a9f5b19c qcacmn: Add framework to configure varying data/monitor buf size
Add a framework to configure varying buffer size for both data and monitor
buffers.
For example, with this framework, the user can configure 2K SKB for Data
buffers, monitor status rings, monitor descriptor rings, monitor
destination rings and 4K SKB for monitor buffers through compile time.

Change-Id: I212d04ff6907e71e9c80b69834aa07ecc6db4d2e
CRs-Fixed: 2604646
2020-01-29 18:08:33 -08:00
Jinwei Chen
0b92469595 qcacmn: fix invalid accessing to rx_tlv_hdr due to scattered msdu
long length msdu is received and looks this msdu is spread across
multiple nbufs, there is no corresbonding logic for this case.
qdf_set_pkt_len will invoke pskb_expand_head to renew skb->head
buffer, but the rx_tlv_hdr is still pointed to original skb->data
buffer, invalid accessing will happen.
  As a WAR, drop this msdu related nbufs after dp_rx_sg_create is done.

Change-Id: Iceb09fd04e4d768325018a8ddd4261ab4f75991a
CRs-Fixed: 2597927
2020-01-26 16:23:50 -08:00
Ankit Kumar
53581e92fd qcacmn: Update counter in mutipass rx packet drop
multipass_rx_pkt_drop is peer level stats counter
used to count multipass rx packet dropped frame.
Accumulate this counter at vdev and pdev level.

It also initializes multipass_en flag to false at
vdev attach.

Change-Id: Idaa85a71c80eefb9359abb026402b71aa28ad6a2
CRs-Fixed: 2595551
2020-01-17 19:50:47 -08:00
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
nobelj
4771edbadc qcacmn: support for tx capture stats
added support to print debug stats for tx capture

Change-Id: Id5533e076f9b5d3f15a392f61b4af5fdffa9efb0
2019-12-19 10:25:35 -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
Jinwei Chen
a9d46ad930 qcacmn: remove assert for invalid release source case
Remove host assert when receiving invalid release source entry from
WBM2SW0 ring.

Change-Id: Iae62ce3008024c55c1dde79e4dd0cd93d7e6f5a4
CRs-Fixed: 2571826
2019-12-01 19:17:10 -08:00
Kai Chen
a8cf59455e qcacmn: Add stats on OFDMA and MU-MIMO packet
Add MCS, NSS, MPDU FCS OK, MPDU FCS ERR stats
classified by SU, OFDMA and MU-MIMO.

Change-Id: I3ade03acc06bd924fdeb8dfcaf6b18fb01f01d68
2019-12-01 19:16:58 -08:00
Guisen Yang
17b5fed005 qcacmn: Change the print format for a size_t variable
A build error happens if "%lu" is applied to a size_t variable.
Change the format to "%zu" in dp_print_tso_stats().

Change-Id: Ib9e7ff5de91a8d5de091f8adae003f0ce0258acb
CRs-Fixed: 2560138
2019-11-18 00:45:58 -08:00
Nisha Menon
98c4dd401b qcacmn: Fix for SMMU fault on reo cmd desc address
Memory leak fixed in dp_rx_tid_delete_wifi3 in the case
where update cmd send fails. Add the desc to the front of
free desc list and set a flag to ensure that the update
cmd is resent from delete rx_tid callback. In the same
callback ensure that the update cmd desc is sent out first
and then proceed to free other descs by sending out the
flush cache cmd for each of those descs.

If the flush cache cmd is not sent successfully to REO,
add the REO descriptor back to the free desc list and
defer the deletion to the callback function. This update
is made under MCL feature flag REO_DESC_DEFER_FREE.

Add a soc level stat to indicate the reo send cmd failures.

Change-Id: I4e4cf47223d5325a53f2df22571895489d033ba3
CRs-Fixed: 2551028
2019-11-10 23:58:50 -08:00
Venkata Sharath Chandra Manchala
8a4812f7fc qcacmn: Enable TSO Stats for Lithium based products
Add support to account for TSO jumbo packets on the
Tx path and print the statistics using dumpStats 3.

Change-Id: I6cc446df5c84e3ac436d922935fcd559e0704ec5
CRs-Fixed: 2356244
2019-10-28 07:11:53 -07:00
Mohit Khanna
80002653b1 qcacmn: Check for ring approaching full during RX
Check if REO ring is near full at the end of dp_rx_process. In case the
ring is near full, reap the packets in the ring (and replenish, send to
upper layer) until the quota allows. Ignore the HIF yield time
limit in such cases.

This change is needed to prevent back pressure from the REO ring(in case
it gets full). Backpressure from REO ring (to LMAC) may lead to a
watchdog and eventually a FW crash. Hence, avoid such a scenario by
reaping as many packets as the 'quota' allows when the REO ring is in
aforementioned condition.

A sid-effect of this change would be that at times the RX softirq may run
longer (till the quota limit) than the configured HIF yield time.
However, this logic is not expected to kick-in in perf builds. The issue
is reported for a defconfig build where lots debug options are enabled
in the kernel which can slow the processing down.

Change-Id: I2eb6544c159ec5957d10386b1750fd96473fe13a
CRs-Fixed: 2540964
2019-10-23 12:04:39 -07:00
Pavankumar Nandeshwar
b86ddaf205 qcacmn: Handle wbm_internal_error in tx completions
Handle wbm_internal_error in tx completions by releasing
associated descriptors and buffers.

Change-Id: I94d334c90c0514674323430fe53da72fb5424576
2019-10-23 10:32:33 -07:00
Ruben Columbus
da4d1b37e3 qcacmn: tx completion handler with invalid release source
added stats counter to check invalid release reason other than
FW and TQM in tx completion path.
added assert to make sure host is not releasing descriptors with NULL
address.

Change-Id: I3a30bd0f0c3954ed6435489d9b21f16201d1b840
2019-09-29 04:50:13 -07:00