Commit Graph

354 Commits

Author SHA1 Message Date
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
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
Rakesh Pillai
6ee7aeb0bd qcacmn: Avoid logging in packet transmission path
Currently if the driver is in runtime suspend/suspending
state, any packet transmission will request for resume
via hif_pm_runtime_get.

Unfortunately there is a logging in the above API which
will lead to more time consumption in the NET_TX softirq
context. This can lead to other delay in processing other
softirqs in the system.

Fix this by skipping the logging in the packet transmission
path.

Change-Id: Icc9f5b67794f7666243eb059f2e07a06a987002e
CRs-Fixed: 2844126
2021-01-12 14:34:40 -08:00
Chaithanya Garrepalli
3ab152450d qcacmn: fix print format compilation errors
Fix print format compilation errors and remove
no-format compilation flag

Change-Id: I69cd0c2eedaa4f2b4189275bf639f48a2fa6b80b
2021-01-07 23:29:09 -08:00
Ruben Columbus
60e9a2d116 qcacmn: add extra stats pdev and vdev lvl
stats added for descriptor alloc fail and tx outstanding too many

Change-Id: Ie2c676979f21e8f0ab217e8c666a8cdf3efbf7f1
2021-01-04 13:51:41 -08:00
Vulupala Shashank Reddy
0366025b7f qcacmn: Add WDI event for tx completion for packet capture mode
Add WDI event and call wdi event handler for tx completion for
packet capture mode.

Change-Id: I99225dda53effc6ab5a80a32aa8aa082543855b2
CRs-Fixed: 2844724
2020-12-24 09:52:38 -08:00
Chaithanya Garrepalli
078584f12d qcacmn: fix vdev ref leak in tx exception path
Fix vdev ref leak issue in SG processing in Tx exception path

Change-Id: I8416b738f0c583276ec341e66685de947e419e6c
2020-12-21 04:49:57 -08:00
Shikha Bakshi
7ae3ccdc47 qcacmn: Modify logs for QDF_MODULE_ID_DP_TX and QDF_MODULE_ID_DP_TX_COMP
Add macros like dp_tx_info, dp_tx_comp_info,
dp_tx_debug, dp_tx_comp_debug, dp_tx_err,
dp_tx_comp_err, etc.  to define logs

Change-Id: If0eef8112db1f8e99fb95ee943d5ddbff94425b8
CRs-Fixed: 2830563
2020-12-19 12:46:07 -08:00
phadiman
d1bb528ae7 qcacmn: Host Static Memory Optimization (in NSS offload mode)
Low memory profiles like 256M and 16M profiles support
only NSS Wi-Fi offload mode and HOST data path APIs are
not used in NSS offload mode

Disable HOST data path APIs which are not used in both
NSS Wi-Fi offload mode and in HOST mode (in NSS offload mode)

CRs-Fixed: 2831478
Change-Id: I6895054a6c96bd446c2df7761ce65feef662a3cc
2020-12-15 13:34:26 -08:00
Tallapragada Kalyan
e6b821c40b qcacmn: get length of nbuf after pushing the meta data in mesh mode
get length of nbuf and set it in tx_desc after pushing the
meta header in mesh mode

Change-Id: Ide563a339eae392c7b3f512526d02f7ec2d6c1df
2020-11-27 08:51:34 -08:00
Varsha Mishra
d4463d47d9 qcacmn: Use vdev based ast_idx and hash for all tx frames
FW uses CCE rule to exception all mcast/bcast frames. Ast_idx
override does not help in sending them to TQM directly.

Change-Id: Iad6c1e8073f5c5d0513adb7097d5024177b7b7f5
2020-11-26 14:44:39 -08:00
Rakesh Pillai
e9899b2a2f qcacmn: Add support to send packet marked by upper layer to FW
Upper layer (OS_IF) can mark certain packets to be sent
to FW. Mark such packets as exception, so that it is sent
to the FW.

Change-Id: I44af2b06793712be7236f831b6b2604123d72bb1
CRs-Fixed: 2813172
2020-11-24 10:55:42 -08:00
Ananya Gupta
28998adf14 qcacmn: Changing log level in dp_tx_msdu_multiple
Excessive logging was detected in dp_tx_msdu_multiple.
To fix this, Reduce log level when tx_hw_enqueue fails.

Change-Id: I66d58d12aff037896c7623c6755a443092673a88
CRs-Fixed: 2823453
2020-11-23 15:22:33 -08:00
sandhu
f39a270b60 qcacmn: Add function to convert Hw to qdf status
Enhance qdf tx rx to hw tx completion status mapping .Function
to convert Hw to qdf status.Add a additional func arg to qdf_dp_trace_ptr.
Add dummy func argument to existing qdf_dp_trace_ptr func calls.

Change-Id: I38865d63dc7383c55686d2d0187a262b3b6d5acc
CRs-Fixed: 2810601
2020-11-19 20:39:12 -08:00
Tallapragada Kalyan
b9d5c7d2b7 qcacmn: move the TX notify comp flag to MCL specific cb structure
The TX notify comp flag is used only by MCL, hence moving
to the MCL this field to the MCL specific cb private structure.

Change-Id: I707ab9252dea705552df9678eedd8501f479672e
2020-11-19 06:58:26 -08:00
Nisha Menon
4677d5bdf5 qcacmn: Memory stats for SKB usage and Tx desc cnt in datapath
Add sysfs node for DP level memory stats:
/sys/kernel/wifi/wlan/wlan_dp_mem_stats
These include Tx, Rx SKB memory allocated, Tx/Rx
buffer count, outstanding Tx desc count.

Change-Id: I839a5f2ec4e763ca11cdea2093368ca6dc52d8cf
CRs-Fixed: 2724460
2020-11-18 16:23:53 -08:00
Tallapragada Kalyan
c0396e72ea qcacmn: use qdf_nbuf_headlen API to get the length in TX path
currently qdf_nbuf_len is being used to get the length of
the tx pkt, but this API also interprets the nbuf CB field
to adjust the length if extra_frags are present.
The concept of extra_frags is applicable only for legacy
drivers but in lithium as cb is not reset in the driver the
qdf_nbuf_len API is mis-calculating the length if extra_frag
field in cb is set by any network stack protocol.
To avoid this qdf_nbuf_headlen API is used to get the length
of the TX pkt.

Change-Id: Ie1e0b4b2168daf93ae77f4c995f5c3476a27b433
2020-11-15 23:15:52 -08:00
Tallapragada Kalyan
c0d82e2d46 qcacmn: remove the additional intra-bss check for NAWDS in tx path
remove the additional intra-bss check for NAWDS in tx path
as it is a redundant check.

Change-Id: I92be5c615ac396939e2a6542af41aea158ffc05f
2020-11-15 23:15:48 -08:00
Mainak Sen
9f9dfdc2b4 qcacmn: Get dp vdev from HTT vdev id in MEC notify
In HTT MEC notification, wifi vdev should be mapped from
vdev_id provided in HTT WBM completion status word

Change-Id: Ic0a440efdbdc1ee99f27fb4797ee068599d06268
2020-11-12 08:08:02 -08:00
Ananya Gupta
0973853fd4 qcacmn: Change log level of null check for peer
Update log level of peer null check from err to info
in dp_tx_comp_process_tx_status as excessive logging
is detected.

CRs-Fixed: 2811236
Change-Id: I1b0ae723adb90b4b915f11479b5408fde147864c
2020-11-10 00:58:25 -08:00
Yu Tian
e8889ab6b7 qcacmn: Refine code about ME buf's freeing
Part of change in 3382883 are deleted
unintentionally. Add them back

Change-Id: I2d806c800f0a238e154297c2e1c3b2fd56608252
CRs-Fixed: 2813756
2020-11-08 20:53:45 -08:00
Yu Tian
41dc191a51 qcacmn: Perform TSO seg unmap when HW enqueue failed
TSO segment struct is not unmapped and TSO buffer is
not got freed in HW enqueue failure case handler.
Implement similar unmap and free handling as TX comp
handling.
Change-Id: I83389fcc97a2e99497011e9e878f665be88f9f04
CRs-Fixed: 2795836
2020-11-04 22:46:47 -08:00
Debasis Das
a420fc8730 qcacmn: Dont unmap cloned ME buf's before freeing
For ME, cloned nbuf's are not mapped.Hence,these
should not be unmapped before freeing.

Change-Id: I998cd4924781944754a81df7d3675c0a34dc10a0
2020-10-28 05:05:35 -07:00
Rakesh Pillai
b91fda62d9 qcacmn: Increment skb users for TSO pkt before enqueue of first segment
TSO packet segments are enqueued to the HW individually.
The skb users count is incremented for each additional
segment, so that it is freed only when the TX completion
for the last segment is received.

Currently the skb users is incremented for the additional
TSO segments after the previous segment has been enqueued
to the HW. Due to this, there is a chance for the tx
completion for the first TSO segment to be received even
before the skb users is incremented to account for the
remaining TSO segments, thereby leading to use-after-free
scenarios.

Fix this by incrementing the skb users for additional
TSO segment before enqueueing the previous TSO segment
to the HW.

Change-Id: Idebc28719ba6f0223d5454e15c3cde349803816e
CRs-Fixed: 2801777
2020-10-22 22:10:52 -07:00
Varsha Mishra
ca0cf99f1d qcacmn: FR-64493 WDS Extended support
Use AST override feature to send out multicast packet in
4 address format. Pass per packet peer_id from osif layer.

Change-Id: Ic86120169c89e7972caa3cc8c967de72670314d0
CRs-Fixed: 2775051
2020-09-19 10:25:26 -07:00
Debasis Das
82de94ec39 qcacmn: Free cloned nbufs in error condition
While sending me packets, if failure is encountered
either while preparing tx desc or while enqueuing
to h/w,the cloned nbuf's must be freed.The unmap
must be done only if the failure is encountered
for all the me buffers.

Change-Id: I08dbae1fa1820b4fb31119f65e939aead829321b
2020-09-17 21:09:10 -07:00
Debasis Das
c1184913b7 qcacmn: Ensure nbuf count is less than no of segs
While preparing raw packets for transmission, the count
of nbuf belonging to one mpdu must be less than the
number of segments.This makes sure the frags array inside
seg_info does not go out of bounds.

Change-Id: I7fffba7f64da274aa73c558cfc63d90f4419a04d
2020-09-17 21:09:07 -07:00
Ankit Kumar
bdddeb7c22 qcacmn: Add frame vdev id check in tx
Drop frame if it is not for the vap, to which
client is connected.
Enable this check only for ap.

Change-Id: I33d7eb79267490bdb8697e4e45f789e9f6279f0e
CRs-Fixed: 2756304
2020-09-16 09:30:33 -07:00
Debasis Das
26833e494d qcacmn: Unmap previously mapped frags in case of failure
While creating sg frames,if map fails for a fragment,
the previously mapped fragments must be unmapped.
Also, the nbuf mapping should happen for headlength.

Change-Id: I218efa60be7100a661da7bc3783fa25e5203a273
2020-09-16 04:51:55 -07:00
Rakesh Pillai
c013de5747 qcacmn: Fix the identifier names for SWLM
The identifiers for SWLM are named incorrectly.
Fix these incorrect naming in SWLM.

Change-Id: I107c22df96c65997a349c0dc1a746e06f1c5b5fa
2020-09-11 16:17:46 -07:00
Rakesh Pillai
156a7ecfc0 qcacmn: Coalesc the tx head pointer writes
Add the support to coalesc the tx head pointer
register writes to reduce the number of PCIe
writes.

Change-Id: I4fea22464c2bf6930bac42dab72c1c2fc5fa18e2
CRs-Fixed: 2769017
2020-09-10 01:04:25 -07:00
Rakesh Pillai
21af5ba8cf qcacmn: Add data structures for SWLM
Add the necessary data structures for the
software latency manager.

Change-Id: Ibf55f0eef7ee6602b007de39a28f09c4622bd356
CRs-Fixed: 2769004
2020-09-10 01:04:20 -07:00
Mainak Sen
60cdb2185c qcacmn: Hlos tid override support in dp vdev
1. Add flag to support hlos id override feature in dp vdev
2. Update tid from nbuf->priority in dp_tx_send
3. Update tid to nbuf->priority in dp_rx_process

Change-Id: I66e8d77733a667f3f60b77e0d7bb444f7c5ad93d
2020-09-07 01:03:42 -07:00
phadiman
6510531b81 qcacmn: Remove dp_tx_pdev_detach API
dp_tx_pdev_detach API takes care of flushing
tx descriptors and multicast enhancement mem
cleanup

dp_pdev_deinit takes care of cleaning up the
above actions and dp_tx_pdev_detach is simply
a redundant piece of code

Hence remove dp_tx_pdev_detach API and call
dp_tx_desc_flush directly from dp_pdev_deinit

CRs-Fixed: 2769303
Change-Id: Ic798793e81eefc7dc905ca7552fdca13e9fddd8c
2020-09-05 10:27:22 -07:00
phadiman
dbb0787de4 qcacmn: Modify wlanstats context to RDK stats context
peer wlanstats context is used only for RDK Plume stats
but the name is misleading as wlan statistics

Hence rename peer's wlanstats_ctx to rdkstats_ctx and
the APIs the APIs around the same

CRs-Fixed: 2767192
Change-Id: I9e8955554b94fa29a3964fed729a95a4db67c8f6
2020-09-03 04:04:17 -07:00
Chaithanya Garrepalli
7db23eeca2 qcacmn: use batch peer reference in TX path
In Tx data path get the peer reference and use
until there is a peer_id mismatch. This is to avoid
per packet atomic operations

Change-Id: I59cdbef19001c694654f0967381a9242788d9cbc
2020-08-28 02:01:20 -07:00
Pavankumar Nandeshwar
0eeac59b4e qcacmn: VoW IGMP improvements
As part of the VoW IGMP improvements, which deals with
conversion of igmp packets to unicast packets, the
following changes are done when the new feature is enabled:

1. IGMP/MLD packets with special addresses (addresses not
   part of any multicast group) will be converted to all
   existing clients of the AP. These packets will be
   directly fed to igmp multicast to unicast conversion
   module.
2. The IGMP/MLD packets with group specific addresses will
   first go to multicast enhancement module, where they
   will be allowed to pass and will be converted to unicast.
3. The new feature will be enabled only when multicast
   enhancement feature is enabled, which will be ensured
   at the configuration level.
FR : 61063

Change-Id: I2fd5a67766c806432fbe1a12cb9654a3600100f5
2020-08-28 02:00:48 -07:00
Srinivas Girigowda
b100ced3c7 qcacmn: dp: Change %pM/QDF_MAC_ADDR_STR/ARRAY to QDF_MAC_ADDR_FMT/REF
Change %pM/QDF_MAC_ADDR_STR/ARRAY to QDF_MAC_ADDR_FMT/REF.

CRs-Fixed: 2760938
Change-Id: Ib7999b69f79a65a67e1d9f7e24a04b7a7da0aebf
2020-08-23 23:09:31 -07:00
Chaithanya Garrepalli
926912fe86 qcacmn: store vdev_id in tx desc instead of vdev pointer
In tx desc store vdev_id to avoid unprotected access of
vdev memory.

In tx path pass VDEV as argument to all APIs

In completion path get vdev from peer as vdev reference
in peer is protected with reference, in places where peer
is invalid get vdev object using vdev_id stored in tx desc
with a reference count

Change-Id: I364ebb51143218872c0bc6f856772ab1df00bb17
2020-08-21 11:42:28 -07:00
Chaithanya Garrepalli
ddc9e59e8f qcacmn: Add VDEV refcount debug support
Add debug support for VDEV refcount to take
refcount by module id and decrement corresponding
refcount with same module id

Change-Id: I15c075816994ba70155fefbc0bce208b20fb9a59
2020-08-20 10:07:32 -07:00
Chaithanya Garrepalli
a718007f03 qcacmn: increment vdev refcount for search by id
Add new API dp_vdev_get_ref_by_id() which will return vdev
pointer by holding a reference. Caller of this API has
to ensure that this reference is released by calling
dp_vdev_unref_delete() API

New lock soc->vdev_map_lock is introduced to protect
vdev id to object array

Change-Id: I883e328932e35ef31254125492dbae20cebe0e00
2020-08-20 10:07:28 -07:00
Mohit Khanna
27f16faa4d qcacmn: Exclude HTT metadata length when not in use during TX
Currently, when an extension descriptor is used during TX datapath, we
use HTT metadata length + msdu extension descriptor length, even we
do not fill HTT meta data. This is inefficient and hardware will end up
doing DMA of extra HTT metadata, even when not needed.
Include length of metadata in TCLdata command only if HTT metadata is
filled in.

Change-Id: Idd1b053c1c6bd8b39880efe5743980667454df0d
CRs-Fixed: 2738733
2020-08-17 22:02:35 -07:00
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
f4701f13ec qcacmn: remove peer backpointer in DP ast entry
Remove the peer backpointer in ast entry and store
peer_id instead

Assign peer_id in AST entry in AST MAP event,
also add the ast entry to peers ast list

In AST map & AST unmap APIs use ast find by vdev_id

Change-Id: I74d9828dc309149d98f6f577b5c8304cb087fd76
2020-08-15 01:26:17 -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
113841906c qcacmn: increment refcount for peer find by id
Use unified version of dp_peer_find_by_id API
which will take peer reference

Also use unified peer ref release API dp_peer_unref_delete

Change-Id: Ibb516a933020a42a5584dbbbba59f8d9b72dcaa4
2020-08-15 01:26:10 -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
Yu Tian
a1264e5fea qcacmn: Fix static code analysis issues in DP
hdr_ptr is in skb_buffer data, it's assigned with 6B array,
use uint8_t point convert to avoid SA overflow warnning.

tid has asseration protect, but need to break execute to avoid
of SA warnning

Fix use-after-free of ast_entry

Change-Id: I0835f93291cf3da2b4fd57d8c9a90f20a60c11ee
CRs-Fixed: 2751678
2020-08-14 08:12:58 -07:00
nwzhao
ca9a332c4a qcacmn: [DP]TWT stats feature: add WMI Support for TWT stats event
Add WMI support for WMI_TWT_SESSION_STATS_EVENTID. This event
contains stats for a given TWT session.

Change-Id: I01d5f7b30da803ee713a14c1d1124b8af7161bca
CRs-Fixed: 2609951
2020-08-05 02:17:19 -07:00
Yeshwanth Sriram Guntuka
01c7242aca qcacmn: Update tx completion cb prototype to pass tx status
Update tx completion callback prototype to pass tx
status also as argument.

Change-Id: I33413a0943ec8050d6c8ae6b2ef3592d593cb063
CRs-Fixed: 2682028
2020-07-22 11:55:38 -07:00