Commit Graph

727 Commits

Author SHA1 Message Date
Ben Wang
909e4e1893 qcacmn: Keep rx_refill_buf_ring using index pdev->lmac_id under MCL case
Fix static analysis issue of rx_refill_buf_ring buffer overflow.
rx_refill_buf_ring length is different for WIN/MCL. For MCL length is 1,
WIN is 3. So rx_refill_buf_ring should always use index pdev->lmac_id to
replenish rx buffer for different MACs under MCL.

Change-Id: I00af069c09c01a81ae4aa54bad5beb79dc6fcff5
CRs-Fixed: 2703683
2020-06-23 04:01:12 -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
Sridhar Selvaraj
3ae6b5c3fe qcacmn: Update REO Remap config API as platform specific
Update REO Remap config API as platform specific

Change-Id: I6a38b87e9181e8bc939e49e3eb55fcd6cace626d
2020-06-12 19:29:39 -07:00
Nisha Menon
0bbaedb23c qcacmn: Log memory stats in host driver
Add logs in driver to log current memory footprint
in init functions. Add wlan_mem_stats to sysfs node
in both perf and defconfig builds.
The stats are included under MCL feature
DCONFIG_WLAN_SYSFS_MEM_STATS.

Change-Id: I79c6d418a5762cddf52ab3bc0b0c93993fa7fd84
CRs-Fixed: 2635192
2020-06-11 02:04:46 -07:00
Yeshwanth Sriram Guntuka
b725ca6210 qcacmn: Update few connectivity stats on tx completion
Update connectivity related tx_host_fw_sent and
tx_ack_count stats on tx completion.

Change-Id: Id0143d934379d8831c58160aa357817c05fcbc71
CRs-Fixed: 2657703
2020-06-10 23:58:58 -07:00
Yeshwanth Sriram Guntuka
b72685beaa qcacmn: Decrement peer ref count on rx hw stats req failure
Peer ref count incremented in dp_request_rx_hw_stats
is not decremented back in case of error scenarios
resulting in possible ref leak and failure in peer
deletion.

Fix is to invoke dp_peer_unref_delete for error
scenarios in dp_request_rx_hw_stats error.

Change-Id: I81ecf60a97ff5c804445fd713ed779c478df8521
CRs-Fixed: 2706596
2020-06-10 13:57:48 -07:00
Karthik Kantamneni
e53dbab838 qcacmn: Fix uninitialized srng access in monitor mode
In monitor mode buffer replenish ring is accessed without
getting initialized for configuring low threshold value.
Add check to avoid uninitialized srng pointer access.

Change-Id: If5dc98d4c1db939ef762749392ec42d46a4ae1f3
CRs-Fixed: 2704586
2020-06-08 18:37:10 -07:00
Basamma Yakkanahalli
2ea729852e qcacmn: reset hw ring intr mask to skip unused WMAC irq for ipq5018
IPQ5018 platform has one LMAC.
Disable registering unused interrupts for LMAC1 and LMAC2.

Change-Id: Ie8f67d7bbf7259288e3644e1c83c49f09a87427b
2020-06-07 10:13:29 -07:00
Nandha Kishore Easwaran
3e8172d58b qcacmn: Set low threshold for monitor ring
Configure low threshold for monitor ring only when monitor
vap is created. This is needed to avoid spurious low threshold
interrupts on monitor ring since the low threshold condition always
evaluates to true.

Change-Id: I452c0ada84e0a4f18e410c865d8a6a7f50329aef
2020-06-05 00:48:39 -07:00
Balaganapathy Palanisamy
a497ea80aa qcacmn: Add peer isolation support per vap
Configure the client as isolated peer if part of isolation
list while creating/associating the node or adding the peer
to the isolation list.
Do not forward the packets to and from clients in isolation
list instead accelerate to upper stack.

CRs-Fixed: 2689868

Change-Id: I67fd4dee0fb76c993746cdd66c70c241d407239a
2020-06-03 08:08:13 -07:00
Chaithanya Garrepalli
1d144f88bd qcacmn: store peer_id instead of peer_ids array in dp_peer
In lithium a peer will have only single peer_id hence remove
peer_ids array from dp_peer structure

Change-Id: Ib98270b7fd98f1199b862e4608f990687914b7cc
2020-05-29 13:13:37 -07:00
phadiman
9789bab0d9 qcacmn: Replace dp_srng_setup with dp_srng_alloc/init in debug logs
dp_srng_setup was split into dp_srng_alloc and
dp_srng_init as part of lithium DP init and de
init improvements but the debug prints remain
unchanged

Rectify mistakes in debug prints accordingly
to match dp_srng_alloc or dp_srng_init

CRs-Fixed: 2696952
Change-Id: If6c41ffe80006852f9ac308ce65ceee69736fcb9
2020-05-29 00:28:33 -07:00
Nandha Kishore Easwaran
07df8d3deb qcacmn: Decrease monitor ring low threshold
Make the monitor ring low threshold to half of that of
MON_BUF_MIN_ENTRIES. This is needed so that spurious interrupts
because of reaching low threshold is avoided.

Change-Id: Idfc5dda2e96ad69bf35c3ab4f5cf81931104504e
2020-05-18 05:51:38 -07:00
Jinwei Chen
e1c2e73b6c qcacmn: move vdev_id_map[vdev_id] null setting after dp_rx_vdev_detach
In dp_vdev_detach_wifi3(), the vdev_id_map[vdev_id] set to
null is happened before dp_rx_vdev_detach(). but the call back
done by dp_rx_vdev_detach still need to get the vdev pointer by
vdev_id, it will return NULL by current logic.
  Move vdev_id_map[vdev_id] null setting after dp_rx_vdev_detach().

Change-Id: Ibaf506cfef83d68a21033e67395c37f53aeb4489
CRs-Fixed: 2681712
2020-05-15 00:36:50 -07:00
Basamma Yakkanahalli
0307ee6023 qcacmn: Add support to configure tso and reo desc for ipq5018 target
Added support to configure TSO and REO descriptors as part
of new datapath init-deint enhancement for ipq5018 target.

Change-Id: Ic6878dafa99cb09d6e45cf2d69de76cac0fe35c1
2020-05-13 08:37:38 -07:00
Prathyusha Guduri
dcb2fc98f6 qcacmn: Add Tx desc limit check for exception packets
Soc level exception descriptors limit is sent from FW in WMI service
ready TLV. Using that to check for exception packets limit

Change-Id: I99d20ecbb6a5bfd61b5a8a205775d34749eae880
2020-05-13 06:46:01 -07:00
Chaithanya Garrepalli
4fb5635434 qcacmn: in dp peer teardown add check of AP bss peer
In dp_peer_teardown avoid setting the delete in progress
flag only for AP bss peer

For STA bss peer as CP always allocated new peer for peer_create
set delete in progress in teardown

Change-Id: Id769678895a0953e731ce040399af7bddd4c373d
2020-05-13 04:57:17 -07:00
Ananya Gupta
4ef9913568 qcacmn: Cancel reap timer during driver unload
In case of driver unload, there can be a race condition
since the timer for processing monitor status ring can run
in parallel to the unload time wow ack response handler,
which is also flushing all the monitor status ring entries.
To avoid this race condition, stop the monitor reap timer
as a part of target suspend, and process all the outstanding
entries in the montior status ring.
This will make sure that the monitor status ring is
processed from only one context at any given time.

Change-Id: If61327c73fdddc414b3957b69ae986f2a26bb803
CRs-Fixed: 2677812
2020-05-08 14:25:48 -07:00
Ankit Kumar
8156bbf7fd qcacmn: Add sg formation check
Add check for sg formation.
Only enable chfrag_cont and msdu_continuation if reo
error code is HAL_RX_WBM_ERR_SRC_REO or rxdma_err_code
is HAL_RXDMA_ERR_UNENCRYPTED.

Also chain all nbuf in case of sg in separate buffer
and finally loop through that. This is added because
sometime we dont get desc in sync with hw.
To avoid such mismatch, this buffer is added.
We will process nbuf only when all msdus has been
received.

Change-Id: I3b154a68955db61f3acaa0cb8d130c8918a3d450
CRs-Fixed: 2672126
2020-05-05 00:51:56 -07:00
Christopher Chopp
6b17c700d4 qcacmn: Add TSF timestamp to MCAST pkts in TX Cap
Move dp_tx_peer_init before dp_peer check to init for
bss_peers as well for MCAST packets. Add TSF timestamp
for wbm completion path in TX Capture feature.

Change-Id: I7da500671e2c22a937cae8770ce5357b9bbe5364
2020-05-03 13:43:45 -07:00
phadiman
1f3652debc qcacmn: Datapath init-deinit changes
Do a logical split of dp_soc_attach and
dp_pdev_attach into Allocation and initialization
and dp_soc_detach and dp_pdev_detach into
de-initialization and free routines

Change-Id: I23bdca0ca86db42a4d0b2554cd60d99bb207a647
2020-05-02 21:59:42 -07:00
Pavankumar Nandeshwar
60561d5b3f qcacmn: remove the redundant API dp_peer_flush_ast_entry
Since the peer unmap handler removes all the associated
wds ast entries, the redundant API dp_peer_flush_ast_entry
can be removed.

Change-Id: Ib8fc19e846e07f9a60c73530cac66d357a00fd98
2020-04-29 16:03:41 -07:00
Himanshu Batra
879fd03fe1 qcacmn: Add support for Extended Mcopy Mode
Currently, mcopy mode delivers first msdu(fcs_passed 128 bytes) per-ppdu
to upper layer, add support for Extended mcopy mode to deliver first
msdu(128 bytes) per-MPDU(fcs_passed).

Change-Id: Ib345fc14a8d468788b9de78516d27e8dff24caa4
CRs-Fixed: 2644175
2020-04-29 08:19:46 -07:00
Jeevan Kukkalli
da011044aa qcacmn: Add NULL check for VAP self peer
Validate VAP self peer before accessing it

Change-Id: I7c685eabee4571bfc706ef0ac8bb50b67df122c4
CRs-Fixed: 2662387
2020-04-28 05:41:56 -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
phadiman
b133d310ec qcacmn: Split dp_rx_pdev_attach and dp_rx_pdev_detach
Split dp_rx_pdev_attach into dp_rx_pdev_desc_pool_alloc,
dp_rx_pdev_desc_pool_init, dp_rx_pdev_buffers_alloc and
dp_rx_pdev_detach into dp_rx_pdev_desc_pool_free, dp_rx
_pdev_desc_pool_deinit, dp_rx_pdev_buffers_free APIs

This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: Ib543ddae90b90f4706004080b1f2b7d0e5cfbfbc
CRs-Fixed: 2663595
2020-04-27 18:02:37 -07:00
phadiman
8db0b893b4 qcacmn: Split dp_hw_link_desc_pool_setup and cleanup APIs
Split dp_hw_link_desc_pool_setup into dp_hw_link_desc_pool_alloc,
dp_hw_link_desc_pool_init and dp_hw_link_desc_ring_init APIs, and
likewise split dp_hw_link_desc_pool_cleanup into deinit, ring_deinit
and dp_hw_link_desc_pool_free APIs

This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: I1682a59847db5d3441e85b00768667066bf5edf2
CRs-Fixed: 2663595
2020-04-27 18:02:27 -07:00
phadiman
730a5bdaa8 qcacmn: Split dp_srng_setup and dp_srng_cleanup APIs
Split dp_srng_setup into dp_srng_alloc and dp_srng_init
likewise split dp_srng_cleanup into dp_srng_deinit and
dp_srng_free
This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: I421fbd5bce074af6f75c147742f44e03568e6403
CRs-Fixed: 2663595
2020-04-27 18:02:21 -07:00
Manjunathappa Prakash
7de632a45c qcacmn: Decouple IPA TCLring and WBM ring size config
Decouple IPA TCLring and IPA WBM completion ring size from regular
Tx TCLring and WBM completion ring size configuration.
This is required as there is limitation on IPA GSI rin size
configuration.

Change-Id: I689d0e8ca72f069c5b68dc1789358e091c554d30
CRs-Fixed: 2665010
2020-04-23 11:32:27 -07:00
Radha Krishna Simha Jiguru
8ca2521ac8 qcacmn: Get Rx TLV offsets from structure
Size of the TLVs have changed across generation of chipsets
Offset values need to be configured into DMA register for preheader DMA
Added APIs to get offsets of each TLV based on chip type

Change-Id: Ic011332cbf3a1017f324f246e47c9e2c91441c70
2020-04-22 14:03:08 -07:00
Pavankumar Nandeshwar
d111e1ef43 qcacmn: Validate number of wds entries deleted during unmap
Validate number of wds entries deleted during peer unmap
handling with the number which firmware has sent in
peer unmap message, which indicates the number of
wds ast entries deleted by firmware after peer delete.

Change-Id: I09e1c41bab19cd023e7a83baf1e90d51aab4229e
CRs-fixed: 2667445
2020-04-22 06:23:30 -07:00
Nandha Kishore Easwaran
0d69530ee2 qcacmn: Interrupt changes in MSI path
1) Modified MSI interrupt mask for QCN9000 so that rx and tx
interrupts can be decoupled.

2) Removed lmac interrupts from polling mode and switched
them to msi interrupts. Added MSI masks for lmac rings.

3) Enable monitor mode LWM interrupt. This was already enabled in
integrated ahb interrupts but missing in msi. Replenish buffers in
RXDMA refill ring based on low threshold interrupts in addition to
regular Rx processing. Also made interrupt batch counter threshold as 8
for monitor status ring since ppdu end interrupts are not available in
PCI chipset and require srng msi interrupts to reap monitor status ring

Change-Id: I5c84b14d6b0a9c26fb3f0d67c349e79751a60861
2020-04-20 06:58:08 -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
Rakesh Pillai
f77acaf949 qcacmn: Fix memory leak in case of pdev attach failure
The cleanup done in case of pdev attach failure
does not deinitialize the IPA tx and rx buffers.
Also the tx descriptors are not freed in this
cleanup path.
Due to this, the tx descriptors and IPA tx/rx
buffers memory is neither freed not unmapped.

Fix this pdev attach failure cleanup path to
avoid memory leaks.

Change-Id: I570e3618f0f48f56749466fce5bcba5a4ef1c161
CRs-Fixed: 2663036
2020-04-18 16:28:55 -07:00
Rakesh Pillai
d1f8fbb225 qcacmn: Clear the peer when it is deleted
The peer rx packets should be flushed when
deleting the peer and its state should be reset
to DISCONNECT, when deleting the peer.

If the state of peer is not set to DISCONNECT,
then the flushing of rx packets for the peer
which is being deleted will call the rx callback
and submit these packet to the stack, which can
cause unwanted behaviour.

This way the UMAC does not need to specifically
call clear peer before deleting the peer.

Change-Id: I3b5a737126350a361d968f6349aef6291b2e3f56
CRs-Fixed: 2659629
2020-04-14 19:03:58 -07:00
Sravan Goud
b7f1c6fa92 qcacmn: Set the peer ref count to one
For wlan stop modules any pending vdevs flush happens as part
of pdev deinit. If in case of any peer ref count leak, driver
is stuck in dp_pdev_flush_pending_vdevs as the vdev is not getting
cleaned up. This is due to vdev's peer is not deleted. So during
force flush of vdev's peers set the ref count to one before peer
unmap handler.

Change-Id: Ie54996522eac870d00ea7a75c8db40a1cce09d2d
CRs-Fixed: 2658032
2020-04-14 14:11:59 -07:00
Amir
8ca8f32971 qcacmn: Enable full monitor mode support for qcn9000
Read ini param 'full_mon_mode' and enable full
monitor mode support for qcn9000

CRs-Fixed: 2655293
Change-Id: I6550765246f6541453006fe2db28e01c8e06670c
2020-04-13 14:33:53 -07:00
Nisha Menon
046f3623de qcacmn: Back pressure in REO2SW1 ring resulting in REO panic
Update QCA_NAPI_DEF_SCALE_BIN_SHIFT for defconfig builds to
the same value as the perf build.
Move the WLAN ext irqs to gold cores for defconfig builds.
Disable cpu isolation before moving the IRQs to gold cores.
Add the ability to move IRQs to gold cores when the cpus
hotplug in.

Change-Id: I4cfecd02a1a2200dc99adee9a324b90c877c13fd
CRs-Fixed: 2638820
2020-04-09 05:21:20 -07:00
Rakesh Pillai
73749d2d18 qcacmn: Fix the yield status for timer yield check
The dp_should_timer_irq_yield should return the
status DP_TIMER_NO_YIELD when no yield condition
has been met. Currently its returning the status
DP_TIMER_TIME_EXHAUST which causes the timer to yield
before the expected time.

Fix the return status from dp_should_timer_irq_yield

Change-Id: Ia57aae635789f34e79285c27f5312ea38e07df5c
CRs-Fixed: 2659900
2020-04-09 03:37:21 -07:00
Nandha Kishore Easwaran
1039ae6642 qcacmn: Support for IPQ8074 2G PHYB mode 2/3
This mode is supported through hw_mode_id 7. A special mode for
IPQ8074 platform alone to bring up single pdev alone on 2G mode.
FW would advertise the mode 7 support through the WMI service
ready message and this mode will be the default mode for AP-HK10 alone.

Added preferred_hw_mode and target_pdev_id into dp structures so that
they can be used to configure the dp rings for this particular mode.
Also changed the lmac_id to target_pdev_id mapping for mode 7.

Change-Id: I3aae46fea13132eebaf7d37cff68ef517253d229
2020-04-08 13:43:30 -07:00
Rakesh Pillai
962dd74800 qcacmn: Reap more monitor ring entries before rescheduling timer
Currently, in monitor mode, once the status ring is reaped
we do not check again if there are new entries added in the
ring during the monitor ring descriptor processing. This
can cause backpressure on monitor rings when there is very
high throughput or a bursty inflow of packets.

Add the logic to continue reaping the monitor rings, until
the work budget or a time quota is not exhausted.

Change-Id: Iee95ac8aec92eabb3a8037b1dd9cf0c6e1dbe10b
CRs-Fixed: 2650480
2020-04-07 20:19:53 -07:00
Rakesh Pillai
e0332f2ef5 qcacmn: Process only LMAC rings for monitor mode
Currently the timer handler, in monitor mode, is
try to process all the rings based on the mask. In
monitor mode only LMAC rings are to be processed
and the UMAC ring processing can be avoided.

Process only the LMAC rings for monitor mode.

Change-Id: Ie48722d80722350129b5c079b67ede06945f5849
CRs-Fixed: 2650480
2020-04-07 20:19:39 -07:00
Rakesh Pillai
726242759f qcacmn: Change the monitor mode timer interval to 5ms
The current time interval for monitor mode timer is
10 milliseconds. This time interval is a bit too high
in case of high throughput sniffing, thereby causes
the monitor rings to be full before the timer interrupt
comes and reaps the ring.

Decrease the timer interval to 5 milliseconds

Change-Id: Ib074ef0c09fde995a7481c056ad70eb809c5a89e
CRs-Fixed: 2650480
2020-04-07 20:19:16 -07:00
Jinwei Chen
248f7bd35a qcacmn: fix invalid net_dev fetched from gro queue skb
Dp_rx_vdev_detach() will flush all gro skb to make sure the
net_dev stored in skb is valid before this vdev is down, but
dp_rx_vdev_detach() is only invoked at the end of function
dp_vdev_detach_wifi3(). for some case, if there is still dp_peer
pending when execute dp_vdev_detach_wifi3(), dp_rx_vdev_detach()
won't be invoked.
  Move dp_rx_vdev_detach() before pending peer detection in
dp_vdev_detach_wifi3() so that gro queue skb flushing can be
executed each time.

Change-Id: I0feea5b77de7efab884c0e5822c8671119892f7d
CRs-fixed: 2649385
2020-03-27 22:40:43 -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
Wu Gao
577bdfe20e qcacmn: Add dp interface to enable/disable reap timer
Enhanced channel frequency response (CFR) based on monitor status
ring, need to enable mon reap timer before starting CFR and disable
the timer after stopping CFR capture. This change adds interface to
enable/disable monitor status ring's reap timer.

Change-Id: I843433ac07c4d55e14b42855ee22779eb7ecb678
CRs-Fixed: 2639307
2020-03-24 10:24:50 -07:00
Radha Krishna Simha Jiguru
d78c96c67c qcacmn: Restrict lock hold time in tx path
Restrict lock hold time in transmit path to only ring access time.
Also store lmac_id in vdev to avoid multi indirection.
Arrange fields in data structure for better alignment in data path access.

Change-Id: I1d32880ed88be486171be46281ec180d2a4906bf
2020-03-24 02:41:07 -07:00
Mainak Sen
aceafadc2e qcacmn: WBM msdu continuation for SG in QCN9000
In QCN9000, wbm release ring has msdu continuation bit
support for invld peer MPDUs. Host needs to form SG
buffer for packets with msdu continuation bit set

Change-Id: Ica03c78068d32d2c8dc609b9a50298b91dd48c0a
2020-03-23 16:07:47 -07:00
Basamma Yakkanahalli
9def5df14a qcacmn: device ID and target type checks for ipq5018 target
Initial changes for ipq5018 compilation.
Added device ID and target type checks for ipq5018 traget.

Change-Id: Ib86a371fbe66749fcb6d114e7a4a9931b684e03d
2020-03-20 23:45:43 -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