Commit Graph

1558 Commits

Author SHA1 Message Date
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
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
Radha Krishna Simha Jiguru
0750a7c7c2 qcacmn: Fix compilation issue in batched inval desc API
Fix compilation issue in batched inval desc API

Change-Id: Iedd0a7554006ce11aceed8d1949d25458c0c127b
2020-05-01 23:29:21 -07:00
Nisha Menon
12cc7c6558 qcacmn: SKB buf memory Leak@ Func dp_pdev_nbuf_alloc_and_map
Fix the skb leak in dp_rx_process where rx descriptor cookie
validity fails. This skb should be cleaned up as part of the
rx desc and nbuf free function called during the driver unload.
However this will ensure that the skb released and added rx desc
added to the free list during dp_rx_process itself.

Add skb map, unmap functions, line numbers and if the nbuf is
mapped or unmapped to the nbuf tracking table. This debug info
will be logged once the skb is leaked.

Change-Id: I52dbf38922be20fc0aaea380e0e572af16de773e
CRs-Fixed: 2662992
2020-04-30 18:21:23 -07:00
Radha Krishna Simha Jiguru
41c0716617 qcacmn: Add a change to do fast transmit completion
Lot of checks in Tx completion path are for special handlings
such as when ol stats are enabled some protective debug checks etc..
Add a logic to fast free of buffer at transmit completion.
If extended stats not enabled(Typically needed for enterprise cases)
do the buffer free faster. This is controlled through a flag.

Change-Id: I04873b5e3643d8e93e5b248fcaf23504dcb7624f
2020-04-30 01:51:07 -07:00
Tallapragada Kalyan
8186e7d0cf qcacmn: fix qdf trace print during desc allocation
fix qdf trace print during desc allocation

Change-Id: I6d786a20a7bc65dcc67a62e784825f72a64a6565
2020-04-29 17:56:12 -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
Yue Ma
d77dcda3bc qcacmn: Tag HTT messages which do not have FW responses
For HTT messages (no matter they are test commands or not) which do not
have FW responses, tag them for runtime PM feature so that corresponding
usage count will be decrement right after sending them through HTC to
avoid usage count mismatch. Tag the missing ones in this change.

Change-Id: I3f78d21a5a490db6dff0dd2786d87c3ced66180c
CRs-fixed: 2672301
2020-04-29 16:03:34 -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
Jinwei Chen
446ac2d46e qcacmn: fix TX TDLS discover frame nbuf leak issue
crash scenario:
(1) during dp_vdev_detach_wifi3(), it will reset related outstanding
TX desc vdev pointer to NULL.
(2) In the meantime, if this vdev TX completion is received from HW,
dp_non_std_tx_comp_free_buff() do nothing for nbuf due to null vdev,
leak will happen.

add error handling in dp_non_std_tx_comp_free_buff() to fix it.

Change-Id: I942a3d690711c60e8299d86562f08f0fb77f0b32
CRs-Fixed: 2670186
2020-04-28 05:42:05 -07:00
Neha Bisht
9aa9221c98 qcacmn: Do Batched invalidate of tx completion descriptor
Do batched invalidate of tx completion descriptor to avoid
unnecessary D-cache miss for 32 byte size descriptor.

Change-Id: Ia580fe78dcef5b36f117aaad171a2df6d0e34966
2020-04-28 05:42:01 -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
Yeshwanth Sriram Guntuka
7dad533e6c qcacmn: Handle scattered msdu in OOR error scenario
In OOR error handling scenario, msdu is spread across
two nbufs. Due to this, there is a mismatch between
msdu count fetched from MPDU desc detatils and count
fetched from rx link descriptor.

Fix is to create frag list for the case where msdu
is spread across multiple nbufs.

Change-Id: I1d600a0988b373e68aad6ef815fb2d775763b7cb
CRs-Fixed: 2665963
2020-04-28 03:59:14 -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
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
9798b16f3f qcacmn: Split dp_mon_link_desc_pool_setup to alloc and init APIs
Split dp_mon_link_desc_pool_setup to alloc and init APIs and
dp_mon_link_desc_pool_cleanup to deinit and 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: I36b2a98bd317010124916e0b2779938eba3883ea
CRs-Fixed: 2663595
2020-04-27 18:02:33 -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
Amir
76ab3fc618 qcacmn: Change monitor ring reap sequence for qcn9000
For qcn9000 in case of monitor mode, reap monitor destination
ring first and status ring later to avoid backpressure
on monitor destination ring

Change-Id: I4e1931afe0453221f1326ca7bdb7f0273cc7363d
CRs-Fixed: 2670656
2020-04-26 23:54:04 -07:00
Varsha Mishra
c71df5eef4 qcacmn: Restrict DMA Map/UnMap upto buffer size
Restrict DMA Map/UnMap upto buffer size for packets in rx process.
This gives 2-3% cpu gain in peak throughput.

Change-Id: Iaf5e9f6f734d80b6d2c234bd8e679cf2a81c7e2c
CRs-Fixed: 2660698
2020-04-23 16:26:49 -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
Ruben Columbus
4de3f492b0 qcacmn: enable/disable monitor other
monitor other gets disabled or enabled from input passed in set_monrxfilter

Change-Id: Ic6a00ce398ad0054b447f39f674eb6b9100b9d80
2020-04-23 02:17:57 -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
Linux Build Service Account
cf66f84918 Merge "qcacmn: Interrupt changes in MSI path" 2020-04-22 02:23:11 -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
Amir Patel
e919b20a34 qcacmn: Replenish last entry in monitor status ring
In current monitor status ring implementation,
on pdev_attach, (srng->num_entires – 1) entries
(to keep one entry slot between hp and tp)
are replenished and last entry is not replenished to HW.

With qcn9000 monitor mode HW enhancements, status and destination ring
can be made lock-stepped.
for qcn9000 lock step is achieved by making monitor status ring
follow the monitor destination reap for a PPDU

However in existing flow during attach monitor status replenish logic
do not fill last entry but is filled up during first subsequent reap.
for first ppdu, i.e. after reaping destination ring,
when status ring is reaped, as first entry (hp = srng->num_entires – 1)
in status ring is NULL, so lock-stepping is not achieved.

To address this issue for qcn9000 as well as HK:
	a. Replenish last entry in monitor status ring during attach
	b. Modify src srng peek API to peek it from hp+1 entry
	c. Introduce new HAL API get cur desc and move next
	d. Remove WAR to skip status ring entries if DMA is not done

Change-Id: I60b8e7c075253d37e6b849a9b24f473c5afce82c
CRs-Fixed: 2626049
2020-04-20 05:54:54 -07:00
Pavankumar Nandeshwar
2d9f587695 qcacmn: Host-FW handshake improvements for WDS AST deletions
- For directly connected peers, during peer de-auth,
  a Single Peer delete request to the FW from host
  should delete all AST entries attached to the peer.
- This optimization is aimed at optimizing host-fw
  handshake messages

Change-Id: Iaebe2022f90ef9a10a6a0f37b21c409cf9e9ea39
CRs-fixed: 2647242
2020-04-20 05:54:48 -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
Vevek Venkatesan
00689c8b2f qcacmn: set SRNG_FLUSH_EVENT if runtime suspended
During dp_tx_hw_enqueue writing into HW SRNG,
if devcie is already runtime suspended, set the
SRNG_FLUSH_EVENT, so that it will be flushed
as part of dp runtime resume callback.

Change-Id: I95e74844cf74eb4f73862da3da9d93422f1eea8c
CRs-Fixed: 2664660
2020-04-18 22:32:36 -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
Ankit Kumar
002753cf61 qcacmn: Retrieve peer from mac addr
Retrieve peer from mac address to avoid accessing peer
even if peer is deleted.

Change-Id: I1c9740fc5d3090ef296c4dc4a5afe7022e83dca5
CRs-Fixed: 2663836
2020-04-16 05:38:13 -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
Srinivas Pitla
34b51d3dcc qcacmn: Free nbuf on bpr disabled case only
If tx capture, sniffer are not enabled, mgmt nbuf is freed.
It is causing use-after-free in bpr enabled case
Added change to free only when bpr is disabled

Change-Id: Ia56254ca371cd9fbc21f5d58fac7ea96792d0bee
CRs-Fixed: 2663098
2020-04-14 03:04:55 -07:00
Radha Krishna Simha Jiguru
c4ae3d34b6 qcacmn: Add support for lock less access of Tx rings
For 4 core CPU system, Tx access can be made lockless by associating
one Tx ring per CPU. Three Tx DATA rings and one SW2TX command ring
can be used for sending data to Tx.

Change-Id: I6e38cad52dffa4e46ff2b736cd6b949d061fa2a4
2020-04-13 21:16:09 -07:00
Varsha Mishra
681b2b4642 qcacmn: Make nbuf->next NULL before calling dp_rx_null_q_desc_handle
Invalid peer handler does double free of nbuf and leads to crash.
To avoid this make nbuf->next NULL before calling dp_rx_null_q_desc_handle.

Change-Id: Ia3f92cb5136dbdbfeb1e9cda8a52c474456a4e0c
CRs-Fixed: 2655792
2020-04-13 21:14:40 -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
Varsha Mishra
4c39342f6a qcacmn: Lockless access of reo destination rings
Remove lock to access REO destination rings because 4 rings are
accessed in 4 individual cores.

Change-Id: Ia3f92cc5136dbdbeea1e9cda8d52b474356a3e1a
CRs-Fixed: 2660901
2020-04-11 07:35:07 -07:00
Chaithanya Garrepalli
e6632c32fb qcacmn: use soc osdev for unmap in dp_tx_comp_free_buf
In pdev deinit path tx_desc->vdev can be NULL
in dp_tx_comp_free_buf use soc->osdev to unmap instead
of vdev

Change-Id: I8b390656d482fed3c8c85d928860222a88325ca1
2020-04-11 01:31:31 -07:00
Shivani Soni
3ba8fe5a21 qcacmn: NAWDS Tx reinject optimization
During the packet transfer from HOST to Transmit Classifier Layer,
if NAWDS is enabled, send peer id of NAWDS peer.
This is to avoid re-injection from FW to Host.

Change-Id: Ic0e5c46fff3bbe1a3e8ea3a01986478c925452f5
CRs-Fixed: 2628703
2020-04-09 05:21:43 -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
Linux Build Service Account
767adf23ae Merge "qcacmn: Return DP_SW2HW_MACID if per_pdev_lmac" 2020-04-08 15:48:31 -07:00
Linux Build Service Account
045f1d5432 Merge "qcacmn: Support for IPQ8074 2G PHYB mode 2/3" 2020-04-08 15:48:31 -07:00
Nandha Kishore Easwaran
3e4379cdd8 qcacmn: Return DP_SW2HW_MACID if per_pdev_lmac
Return DP_SW2HW_MACID if per_pdev_lmac is set.
This is needed when we need to get target pdev_id without
doing pdev lookup.

Change-Id: If83f29bbcf23175708ba7eaf58e01e040ccb5a45
2020-04-08 13:43:56 -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
Linux Build Service Account
782c0802c6 Merge "qcacmn: Enable SW2TCL_CMD ring for data" 2020-04-08 09:17:04 -07:00