Commit Graph

982 Commits

Author SHA1 Message Date
Chaithanya Garrepalli
970948916a qcacmn: print backpressure stats in work queue context
Avoid backpressure event prints in irq context and
defer work queue context

Change-Id: Ib68237d6a9930ead38f53aa89ec1d9e9a2f4147d
2021-04-29 14:29:33 -07:00
Karthik Kantamneni
3bc4b99247 qcacmn: Add support for Rx refill ring history
Add support for Rx refill ring history, maintain records of refill info
during RXDMA ring replenish.

Change-Id: I034014eacfc510ec6f416fca601fa864326de9c2
CRs-Fixed: 2930005
2021-04-29 04:37:47 -07:00
Will Huang
aab2fe978c qcacmn: Fix possible spinlock vdev->peer_list_lock recursion
It is possible to hit spinlock vdev->peer_list_lock recursion if
running SSR case, the call stack is as following:
dp_vdev_flush_peers
    dp_vdev_iterate_peer
    qdf_spin_lock_bh(&vdev->peer_list_lock);  -> first time lock
        dp_peer_delete
            dp_peer_delete_wifi3
                dp_peer_vdev_list_remove
                    qdf_spin_lock_bh(&vdev->peer_list_lock) ->
lock again in same thread.

Replace it with dp_vdev_iterate_peer_lock_safe.

Change-Id: I40fe492d43b376b404b855a7e86aa2cd66ba1d22
CRs-Fixed: 2926284
2021-04-26 22:54:27 -07:00
Amir Patel
fda11e2e76 qcacmn: Configure monitor rings for special vap case
configure monitor ring for special vap case

Change-Id: Idebcfecf61dceb2cad5b7ea07297b5f682778c43
2021-04-23 06:43:05 -07:00
Tiger Yu
2cd64402c6 qcacmn: Support IPA WDI 3.0 with two tx pipes
Currently a set of IPA2TCL and WBM2IPA rings is used for
IPA TX data path. Issue is when wlan is configured as
SAP-SAP DBS mode, slow 2G traffic will consume much more
TX resources and thus 5G traffic will have starvation,
which leads to severe degradation of DBS KPI.

Therefore separate IPA2TCL (SW2TCL2) and WBM2IPA (WBM2SW4)
rings are added to support alternative IPA TX pipe for 2G
traffic.

Change-Id: I4b648d0bcacbcde0b9b0a824516c1f06e3b0c7ad
CRs-Fixed: 2750079
2021-04-21 11:03:45 -07:00
Amir Patel
a255cb4196 qcacmn: Avoid enabling full monitor mode if already enabled
Avoid enabling full monitor mode if already enabled

Change-Id: I728105006af497d18174bc7eba33a2508990caa2
2021-04-21 06:32:07 -07:00
Manikanta Pubbisetty
5a19bd0c38 qcacmn: do a dummy read to flush pending writes
Currently before suspending the device, we are draining
out the TX/RX SRNGs. The HP/TP updates which are done as
part of this will be posted writes(there won't be any link
levelccompletions for write transactions), there are chances
that we might end up updating HP/TP after the device enters
low power mode leading to system crashes.

In order to avoid this scenario, do a dummy read before
device is suspended; this will ensure all pendings writes are
flushed before read returns.

CRs-Fixed: 2919459

Change-Id: I5ab77f91fe14c506444bdea1587acfb34224fc69
2021-04-15 07:03:29 -07:00
Mohit Khanna
9f35babf04 qcacmn: Set LRO hash keys based on PDEV flag
Currently dp_lro_hash_setup is being done in dp_vdev_attach_wifi3 when
pdev->vdev_count==1. However, this counter is not getting decremented and
may overflow on repeated VDEV attach/detach calls. This may result in
LRO keys being programmed again.
Use a PDEV flag to determine whether to configure LRO or not. Fix
pdev->vdev_count by decrementing it during VDEV detach.

Change-Id: I03cba0d95c30831fbe8047828f7bb2cf4a869213
CRs-Fixed: 2906871
2021-04-13 16:44:03 -07:00
Nisha Menon
5d7e26e27f qcacmn: Dump the rx reo queue descs in ddr
Add iwpriv option 34 to dump the reo rx h/w descs
in DDR for debugging. This cmd will first send cache
flush cmd to REO for all rx tids and invalidate the h/w
cache. Henceforth ensuring that the reo status tlvs and
the DDR values are in sync.
iwpriv wlan0 txrx_stats 34 0
Add fix to ensure bar frame with 2k jump err code is
processed correctly using the REO error code instead of the
REO push reason.

Change-Id: Ia05be668343f3a5d4b3262b8d6a367a50875add5
CRs-Fixed: 2895965
2021-04-13 14:50:51 -07:00
Amir Patel
7efbf8cb35 qcacmn: Enable full monitor mode during vap up
Currently full monitor is enabled at vap create time and disabled
at vap deinit time, this results not configuring full monitor
mode during vap up time leading to backpressure on montor status ring.

To have symmetry, enable full monitor mode at during vap init.

Change-Id: I7828a7f2af400cfa094dc6d6139646760c932f09
2021-03-25 16:22:06 -07:00
Pavankumar Nandeshwar
f3998b3f1d Revert "qcacmn: Reset rxdma2host dst ring mask for ipq5018 target"
This reverts commit I513a78639898c6f2bd9ea5418def03d64d7232d0.

Change-Id: Ia5952dae9c08a2227b0f6369cfe652007df41919
2021-03-24 06:44:27 -07:00
Jeevan Kukkalli
c3c6473b36 qcacmn: Set mon delayed replenish entries
Set monitor delayed replenish entries for target type
QCA5018/QCN6122

Change-Id: I2042dfd2b1ff975907d829e1f111daf40f0f8e3c
CRs-Fixed: 2888346
2021-03-23 23:43:29 -07:00
Radha Krishna Simha Jiguru
12f0091fad qcacmn: Do not account rx_desc_alloc fails for Rx packet error
Rx desc alloc failures foes not really reflect rx packet errors.
So rx desc alloc failures shall not be counted as packet errors

Change-Id: I85ed478bbb3af24ff680a338aca86d3b4548ad8d
2021-03-23 21:39:34 -07:00
Ruben Columbus
2216aa520b qcacmn: lock on queue
Adding lock for dp_txrx_ppdu_stats_handler given
that insertion and deletion happen in different cores.

Change-Id: Ic0102d615f02cbfed70acc1114a314426466638e
2021-03-18 13:47:18 -07:00
Yeshwanth Sriram Guntuka
b23bcc8b6b qcacmn: Add support to reset SOC rx ext stats
Add CDP interface to support reset of soc rx ext stats.

Change-Id: I381f9b6b27d8d023b1932b7d8587df240c1ff4d0
CRs-Fixed: 2889565
2021-03-11 09:48:46 -08:00
Manikanta Pubbisetty
14d38b77fb qcacmn: disable EXT grp irqs and drain TXRX during suspend
Any update to the SRNG TP/HP when the device is in low power
state would result in system errors. It is recommended to disable
EXT grp irqs and drain TXRX before sending power save enter command
to the FW. This will ensure that no interrupts are received while
in power save mode and as a result there wont be any HP/TP updates.

Change-Id: Ibf952bbc2c6d13fb3e4ca6b4845bc9cc887fa694
CRs-Fixed: 2883135
2021-03-11 19:41:34 +05:30
Nisha Menon
ed3a77563a qcacmn: Add wbm head/tail pointer stats to dp_txrx_stats
Add wbm head/tail pointer stats to dp_txrx_stats and ring
usage percentage for all SRC and DST rings.
Stats added to the following cmd: iwpriv wlan0 txrx_stats 26 0

CRs-Fixed: 2865996
Change-Id: I7d144d87c5f3485ec9ba85f50b036b69a64e53c6
2021-03-11 18:01:27 +05:30
Aditya Kodukula
7679b0651a qcacmn: Add params to the wlan_minidump_remove function
For the minidump feature, the wlan_minidump_remove function
definition is modified. So, update the function parameters
accordingly at all instances of the wlan_minidump_remove function.

Change-Id: I5a346f6cdf423ece02fb08d68e4422251af54876
CRs-Fixed: 2860435
2021-03-09 21:07:01 -08:00
Basamma Yakkanahalli
4adab0e0a9 qcacmn: enable reo_status ring process in NSS offload mode
Add support to process reo_status rings in NSS offload mode
for lowmem profile.

Change-Id: If5aa3649f33fa8e1a9b328b8506dd398646d179c
2021-03-08 15:17:12 -08:00
Amir Patel
6c6f067b65 qcacmn: Fix monitor link descriptor memory alloc failure
In existing approach, monitor rings get initalized
on monitor vap init time,
For linux 5.4 kernel, physical contiguous memory(512Kb) is not
available on vap init time.
Initialize monitor related rings on monitor vap creation time
to get required memory.

Change-Id: I288c27cfcf77b3d224c2f21bbe8ac65670f32dda
CRs-Fixed: 2865141
2021-03-03 00:49:09 -08:00
Basamma Yakkanahalli
5c02cbbc5e qcacmn: Reset rxdma2host dst ring mask for ipq5018 target
During interrupt mask initialization bitmap of rxdma2host
destination ring mask is filled in host mode.
To avoid spurious interrupts reset this interrupt mask
when NSS offload is enabled.

Change-Id: I513a78639898c6f2bd9ea5418def03d64d7232d0
2021-02-23 23:40:23 -08:00
Kai Chen
2667f112d8 qcacmn: Add CBF support for pktlog
Fix issue on enabling packet log.
Fix issue on logging CBF pkt in AP/STA mode.
Fix issue on setting data length 4 bytes aligned in pktlog header
, htt stats indication message header and Rx management TLV header.
Add CBF support for pktlog WMI enable command for firmware to enable
CBF receive.

Change-Id: Ib0067f32d7414be96503c4c67846c1312a59586e
2021-02-10 20:27:29 -08:00
Vevek Venkatesan
07c4fc98d1 qcacmn: add lockless SRNG access support for Rx Rings
Add lockless SRNG access support for Rx rings.

Change-Id: Ia44f612cc5f6e50255aafaaf895044dea7a88aa7
CRs-Fixed: 2868991
2021-02-09 19:56:53 -08:00
Nitin Shetty
71e3244d46 qcacmn: skip MEC ast entry creation in wlan fw
MEC ast entry will be created only in software
and adding MEC entry to wlan fw is skipped.

Change-Id: I6991f9f12ceb22a7c599cdf3cc2a13c996d93671
2021-02-09 15:35:27 -08:00
Shwetha G K
335982bd3d qcacmn: Change dp_pdev_init as non-inline function
Change the dp_pdev_init as non-inline function for
code size reduction.

Change-Id: I5720ba2e5bdf221de584b722768e23ae6a6f2b79
2021-02-09 13:02:27 -08:00
Lihua Liu
74efc61848 qcacmn: Avoid using small buffer address
The memory below 0x2000 is reserved for the target use,
so any memory in this region should not used by host.
But on some third-party platforms, we observe such
memory is allocated for RX buffer, which cause HW/FW
NOC error, then RX is stuck. To address this,
re-allocate RX buffers when small buffer appear.

Change-Id: Iad118e82f3fe10f92cbf5f7388dc0960542fc03c
CRs-Fixed: 2707190
2021-02-04 06:43:41 -08:00
Amir Patel
50133e4345 qcacmn: Fix Smart monitor init issue
For smart monitor initialize monitor buffer ring,
Monitor direct mode onto monitor status ring expects monitor buffer
ring to initilized with at least 64 buffers.

CRs-Fixed: 2863316
Change-Id: Ie67ff465522184ad776a9ba76a68c00f02f92221
2021-02-03 01:50:24 -08:00
Himanshu Batra
ec2e7778ea qcacmn: Modify logs for QDF_MODULE_ID_CDP
Use macros like dp_cdp_debug, dp_cdp_err, dp_cdp_info to
print logs for QDF_MODULE_ID_CDP

Change-Id: I550eefa82c3417b8bf83378d4a9c6f382098fea6
CRs-Fixed: 2855937
2021-01-30 00:51:20 -08:00
Vijay Krishnan
4427314322 qcacmn: Setting up filters and destination ring for CBF logging
This change will set up monitor mode status and destination ring
filters for enbale CBF logging and will enable destination ring to
capture CBF frame. This change will get the CBF frame from the
destination ring and send it to the pktlog module for post processing
through WDI event. CBF is a compressed beamforming report.

Change-Id: I4cc419440ba8d60446dd1f01747340a89f023171
2021-01-29 16:48:58 -08:00
Rakesh Pillai
783f811315 qcacmn: Send ring sel cfg to configure rx pkt tlvs offset
Currently the FW configures the mac with appropriate
offsets for rx pkt tlvs using the structure defined in
te FW and the host does not send the ring selction config
HTT message. This can create a problem when FW stops subscribing
to tlvs or changes its rx pkt tlvs offset.

Fix this by configuring the rx pkt tlv offsets via HTT
ring selection config message.

Change-Id: I1a2865f91b34dd7bda1af8651d7831097dac0bee
CRs-Fixed: 2860504
2021-01-29 00:04:19 -08:00
Mainak Sen
059ed74e8b qcacmn: Placeholder for peer mesh latency changes
Add support to update per peer latency parameter
from datapath

Change-Id: I1096374ebd3aeb5dc11759f1512cdee744e170c6
2021-01-27 00:27:00 -08:00
Manikanta Pubbisetty
63e599de11 qcacmn: clean up inactive peers/vdevs during driver unload
DP references of the peer will be removed once we receive PEER
unmap message from the firmware. If the firmware has failed to
send the peer unmap message (due to an assert in FW), then the
peer entries will remain the inactive peer list and will trigger
a explicit QDF_BUG() during driver unload.

Force clean the inactive peer/vdev list during driver unload in such
cases.

Change-Id: Ib8a5f8179ce51378a825034e411f89ff024017e1
CRs-Fixed: 2847742
2021-01-19 12:57:46 -08:00
Chaithanya Garrepalli
76d4ea4287 qcacmn: fix use after free in WDS aging timer
In case of pdev attach failure reset pdev reference in
soc->pdev_list to NULL before free to avoid use after
free

Also initialize WDS aging timer only when ast hash is
allocated

Change-Id: I6a406bd94aa46a95d9e5bb970ae83b3dfde29d0a
2021-01-18 23:52:21 -08:00
Pavankumar Nandeshwar
d6c9f3ad8a qcacmn: change qcn9100 to qcn6122 in data path
Change the name of target type qcn9100
to qcn6122 in data path.

Change-Id: Ia1463ca276b7c107ca4c1ebce4ffc8b517134a5e
CRs-Fixed: 2849577
2021-01-18 21:45:30 -08:00
Jianmin Zhu
6ef2047d56 qcacmn: Fix long ping delay after enable RTPM
Issue1: Driver RTPM state is ON/NONE, Kernel state is RESUMING.
cdp_runtime_resume is already complete,
hif_pm_runtime_get return -E_INPROGRESS,
dp_tx_hw_enqueue will set the flush event,
but cdp_runtime_resume is already done,
this flush event will be handled only on next pkt tx.

Issue2: Driver RTPM state: Resuming
hif_pm_runtime_get returns -EBUSY,
dp_tx_hw_enqueue is interrupted by any IRQ,
cdp_runtime_resume is completed,
dp_tx_hw_enqueue will set the flush event,
This flush event will be handled only on next pkt tx.

Fix:
Introduce a link_state_up atomic variable in hif to track the link state
change by pld_cb.
Set atomic variable link_state_up=1 in pmo_core_psoc_bus_runtime_resume
just after pld_cb. pld_cb brings the PCIe bus out of suspend state.
Set atomic variable link_state_up=0 in pmo_core_psoc_bus_runtime_suspend
just before pld_cb. pld_cb puts the PCIe bus into suspend state.

Introduce dp_runtime_get and dp_runtime_put.
dp_runtime_get get refcount with increment of an atomic variable.
dp_runtime_put return refcount with decrement of  this atomic variable.

If hif_pm_runtime_get returns -EBUSY or -EINPROGRESS,
take the dp runtime refcount using dp_runtime_get,
check if the link state is up, write TX ring HP,
return the dp runtime refcount using dp_runtime_put.

cdp_runtime_suspend should reject the suspend, if dp_runtime_get is non
zero.
cdp_runtime_resume should wait until dp_runtime_get becomes zero or time
out, then flush pending tx for runtime suspend.

Change-Id: I5b97d50cba710082f117f3845f7830712b86cda7
CRs-Fixed: 2844888
2021-01-14 07:46:48 -08:00
Amir Patel
e41f64cc9e qcacmn: Fix monitor mode init issue
During monitor vap creation time, do not allocate monitor buffer
and link descriptors memory if already initilized.
Check if pdev->pdev_mon_init flag is true and return.

CRs-Fixed: 2852399
Change-Id: I87ceaf0af771abed1bff651ef6f2b9ca21e038b9
2021-01-13 04:43:10 -08:00
bings
3f59477859 qcacmn: Do not check MSI group number for one MSI vector mode
Some platforms only permit the device to allocate 1 MSI interrupt, then
macro WLAN_ONE_MSI_VECTOR is added to support this one MSI vector mode.
There is only one MSI data count for one MSI vector mode, so it is valid
that 2 more MSI dp groups share one MSI data.

Change-Id: Iaab2a2ba538ea3750a32454855144a0cb0776eca
CRs-Fixed: 2843378
2021-01-12 22:14:08 -08:00
phadiman
e4eda79524 qcacmn: Move multipass deinit to vdev detach
Multipass init is called from vdev attach and
multipass deinit is called from tx vdev detach

To maintain symmetry between init and deinit
move multipass deinit to vdev detch

CRs-Fixed: 2840338
Change-Id: I18657497b9e09ec5cc75d245765f6d0fd7d061fd
2021-01-12 14:34:45 -08:00
Shwetha G K
b3fafa78c8 qcacmn: Cleanup rssi and snr used interchangeably
Cleanup rssi and snr used interchangeably

Change-Id: Idc78ca1ceb62af766aaf69e42ab5d6e8990a6f0b
2021-01-11 15:13:44 -08:00
Yu Tian
ab67bf289d qcacmn: Fix the error statistics field for CNE
rx_mpdu_missed statistics used by CNE records instances
of BA hole happens, not duplicated frames instances.
Fix this field with correct value to avoid incorrect
VOLTE switching.

Change-Id: I815b9a4caeb6eedf36be66f8650ca98d00542c60
CRs-Fixed: 2848460
2021-01-07 21:13:55 -08:00
Mainak Sen
37a91751be qcacmn: Enable Peer authorization support in RX path
In security mode, allow only EAPOL frames in receive path
when peer is not authorized. This feature is enabled per VAP
based on vdev flag and will be applicable for all peers in that
VAP

Change-Id: Ic5dea09c2083f31e8cd301a0cdc3565f247b735c
2021-01-07 16:48:52 -08:00
Pragaspapthi Thilagaraj
d5cfa3829a qcacmn: Reduce excessive kmsg logging in roaming path
Reduce excessive data path logging to kmsg during roaming and
change the logging level for such prints to debug/info
high.

Change-Id: I1e6506de83e59a31304234905a3dd38f6d8b03f3
CRs-Fixed: 2848624
2021-01-07 08:17:44 -08:00
Rakesh Pillai
f1aa992998 qcacmn: Pre-alloc rx rings history when feature is enabled
Currently the rx rings history is allocated dynamically
on load time. The memory requirement for saving these
history are more than a page (order 5 to 6 allocations).
Such big memory allocation can fail due to various
reasons, one of them being memory fragmentation.

Fix this by pre-allocating the rx ring history memory.
Also allocate the rx reinject history memory when the
HW accelerated path is used.

Change-Id: Id957cd5df91a2ca7f182dea691a0557b4e386f55
CRs-Fixed: 2844388
2021-01-06 21:55:07 -08:00
Manikanta Pubbisetty
a5c11aabcb qcacmn: avoid FSE cache flush messages during runtime suspend
When runtime power management is enabled, until the system is fully
resumed, we do not post any message to CE, instead they will be queued
in HTC. Once the device is fully resumed, all HTT messages in the queues
will be downloaded to CE at once. In some corner cases, it is found that
too many FSE caches flush messages getting queued during the runtime
resume; once the device is fully resumed, all these would be downloaded
to the FW/HW at once causing unintended crashes.

Avoid posting FSE cache flush messages until the device is fully resumed
to fix the issue.

Change-Id: I2be21406e8c7a9dcd86df3e93c2568797defcad0
CRs-Fixed: 2843541
2021-01-05 18:14:39 -08:00
Amir Patel
76b9febd3d qcacmn: Delay allocation of rings for monitor mode
In existing implementation, for monitor mode below allocation
are done at pdev attach and init time.

	a. 64 monitor buffer allocation for RxDMA monitor buffer ring
	b. Link descriptor memory allocation for monitor link descriptor ring

This memory is waste of memory for customers not using monitor mode and
low memory profile.

To optimize this memory, allocate all buffers and link descriptor memory
at monitor vdev creation time.

Change-Id: I873c76d2f625a782532a101037915b0353928a5b
CRs-Fixed: 2829402
2020-12-29 03:16:09 -08:00
Jinwei Chen
b3511e0844 qcacmn: support FSE cache flushing suspend/resume
scenario:
FISA new FST entry is initialed, host will start one timer to
send HTT MSG DP_HTT_FST_CACHE_INVALIDATE_FULL to FW in 5 ms,
WOW suspending happened in the same time, PCIe bus get suspended.
5 ms later, HTT msg sending will try to prevent PCIe L1 to update
CE SRNG HP register, hit assert as PCIe bus suspended already.

suspend and cancel the FSE cache flushing timer when dp_bus_suspend,
resume it when dp_bus_resume.

CRs-Fixed: 2843214
Change-Id: Ie2bc115a0de068335d6c46749f52d205cc21f5a3
2020-12-24 04:50:29 -08:00
Shikha Bakshi
3eeace37b2 qcacmn: Modify logs for QDF_MODULE_ID_DP_CDP and QDF_MODULE_ID_DP_VDEV
Add macros like dp_cdp_debug, dp_cdp_err, dp_cdp_info, dp_vdev_info,
dp_vdev_err, etc. to define logs

Change-Id: I176c0579af9b5ef2f14846fac1e8182309636464
CRs-Fixed: 2840489
2020-12-22 18:47:49 -08:00
Shikha Bakshi
c1e00a21ba qcacmn: Modify logs for QDF_MODULE_ID_DP_PEER
Add macros dp_peer_info, dp_peer_info_low,
dp_peer_info_high, dp_peer_alert, dp_peer_err,
dp_tx_capture_debug to define logs.

Change-Id: Icf71595c10b1a4f0dca53f6953af4df19210e924
CRs-Fixed: 2832004
2020-12-22 06:40:31 -08:00
Shikha Bakshi
89662c1eeb qcacmn: Modify Logs for QDF_MODULE_ID_DP_INIT
Add macros like dp_init_debug, dp_init_err, dp_init_info, etc. to
define logs

Change-Id: I5b0f48b2f0b4b5d6be19850e2fff928672d09ad1
CRs-Fixed: 2837411
2020-12-22 06:40:26 -08:00
Shikha Bakshi
7cdc796f7e qcacmn: Modify logs for QDF_MODULE_ID_DP_RX_MON_DEST
Add macros dp_rx_mon_dest_info, dp_rx_mon_dest_debug,
dp_rx_mon_dest_err,etc. to define logs

Change-Id: I2a016ee8e3e74b745e776f1f7266d94bb9698892
CRs-Fixed: 2830629
2020-12-22 02:45:52 -08:00