Commit Graph

186 Commits

Author SHA1 Message Date
Ananya Gupta
028bd45cbd qcacld-3.0: Free skb if fisa flow vdev not matches dp_vdev
Currently, there is a rcu stall when dp vdev obtained from
dp_soc does not match vdev present in fisa flow which has
same vdev_id.
To fix this, if vdev id matches for both the vdev, drop the
skb.

Change-Id: I8be4ea77bd0bdd3096ebbad627674f7b8a9801cf
CRs-Fixed: 3817471
2024-05-22 23:21:03 -07:00
Yu Tian
fa5001a4b5 qcacld-3.0: Give correct initial value of dp_link
When dp_link is allocated, the member variable is
not initialized correctly. Change is to give initial
value to avoid of crash.

Change-Id: I0d032b4a25f31768f2aa5e7161cc625abe867df5
CRs-Fixed: 3797243
2024-05-22 22:19:44 -07:00
Ananya Gupta
25b2dea7fd qcacld-3.0: Issue disconnect for STA if new interface is Mon intf
Currently, when Rx monitor mode interface is coming up, STA is
not disconnected causing RXDMA ring to be used as both error ring
and destination ring. This is causing backpressure in RXDMA ring.
To fix this, issue disconnect for STA when Rx monitor mode is
being added.

Change-Id: I95e73edd80472a8aae9092ebdbce5e514b1cd531
CRs-Fixed: 3799325
2024-05-21 09:29:59 -07:00
Rahul Gusain
20f383d502 qcacld-3.0: Fix NULL pointer dereference issue in DP
Pointer 'dp_ctx' returned from call to function 'dp_psoc_get_priv'
may be NULL in below APIs:
1. dp_reset_tcp_delack
2. dp_bus_bandwidth_init
3. dp_bus_bandwidth_deinit
4. dp_bus_bw_compute_timer_try_start
5. dp_bus_bw_compute_timer_try_stop
6. ucfg_dp_set_cmn_dp_handle
7. __dp_bus_bw_compute_timer_start

Fix is to add NULL check for dp_ctx before use.

Change-Id: I5f9ea6ae8ce3bb13631ad9a2dfe25d9c3686a33b
CRs-Fixed: 3767091
2024-04-12 06:39:24 -07:00
Yu Tian
8f7cd16ea9 qcacld-3.0: Add debug log to show vdev states
Add debug log to show vdev status during vdev deleting

Change-Id: I17ae2504e482177c30c4bee212048f97dd5bbaa5
CRs-Fixed: 3762585
2024-04-11 01:19:22 -07:00
Rakesh Pillai
7ae89179e1 qcacld-3.0: Replace is_dp_link_valid with dp_link null check
As a part of vdev destroy is_dp_link_valid can return failure,
since the interface maybe down. This will lead to memory leak
since the dp_link memory won't be freed.

Fix this by replacing is_dp_link_valid with dp_link null check.

Change-Id: Ief03c1e42d62b4b89f1414f0c5642e592ee39fa2
CRs-Fixed: 3750214
2024-04-08 09:11:06 -07:00
Rakesh Pillai
52cc76d329 qcacld-3.0: Add magic number in wlan_dp_link
Add magic number field in wlan_dp_link which is to
be used to identify the validity of dp_link.

Add logs in the dp_link free handler/callback.

Change-Id: I76e3149e1d72a9f5e69478734b6dbab5b4d8d922
CRs-Fixed: 3744331
2024-04-08 09:10:55 -07:00
Abhinav Kumar
0ac3ad4233 qcacld-3.0: Fix NULL pointer dereference issue in DP
Pointer 'dp_ctx' returned from call to function 'dp_psoc_get_priv'
may be NULL in below APIs:
ucfg_dp_set_hif_handle
ucfg_dp_update_config
ucfg_dp_get_rx_softirq_yield_duration
ucfg_dp_register_rx_mic_error_ind_handler
ucfg_dp_is_roam_after_nud_enabled

Fix is to add NULL check for dp_ctx before use.

Change-Id: I040f1a6ed92ad572e625663eee9ea1dd0c5e8530
CRs-Fixed: 3770367
2024-03-29 15:50:10 -07:00
Nijun Gong
6cfd908441 qcacld-3.0: initialize spinlock before using it
Init dp_link_del_lock to avoid bad magic issue.

Change-Id: Ia30e98d932cb6c5613f79b449f2b9d94ab43e756
CRs-Fixed: 3725021
2024-03-22 06:29:13 -07:00
Amit Mehta
4e253feb66 qcacld-3.0: Export API to store monitor interface flags
Currently STA+Mon mode is not supported in LPC case
as both mode uses monitor interface to capture
packets. So to distinguish between two different
monitor modes export new API to store monitor interface flags

Change-Id: I463353a1a01f53d48e004f60c52c24f1d8084154
CRs-Fixed: 3739289
2024-03-18 01:55:48 -07:00
Amit Mehta
1d0a7af857 qcacld-3.0: Export new API to update default link
Currently default link update is only done in link switch
or dynamic mac address update case.
There is other scenario also where default link case become
inactive and update to DP will not happen.

So, to handle those scenarios, expert new API to update
DP default link.

CRs-Fixed: 3733584
Change-Id: Iab24c38c454cc5cb9f568de680531b38e4d3da45
2024-03-11 09:07:47 -07:00
Yu Tian
05f7de06fc qcacld-3.0: Refine FISA FT lock to prevent race condition
FISA entry is updated by FISA RX and work queue, if the same
entry is hashed for different REO id, the lock may not work
as expected. Change is to hold the lock before work queue
waking up to prevent the race condition.

Change-Id: I16ba4439c1655bbb7bf83b13d9280cb3f7c56478
CRs-Fixed: 3674340
2024-02-02 02:01:16 -08:00
Yu Tian
b722764115 qcacld-3.0: Add FISA collision entry update aging
FISA entry may hit jitter when hash collision happens,
add aging logic to avoid frequent FST entry update.

Change-Id: I69f3634c933f5a71b830cd76e98462262690bdf4
CRs-Fixed: 3675855
2024-01-19 00:53:17 -08:00
Rakesh Pillai
c3b0114600 qcacld-3.0: Delete dp_link only after dp_vdev is freed
Currently the dp_link address is provided to CDP vdev
as a part of vdev register. Also, as per the vdev deletion
sequence, it is possible that dp_link can be destroyed
before CDP vdev is detached. This can lead to use-after-free
scenario when CDP vdev uses the osif_vdev handle (which is
the dp_link handle).

In order to fix this, do not free the dp_link till the CDP
vdev has been detached.

Change-Id: Ie5a1140a0d256b6115fa62e30e6bfd61d1dfc898
CRs-Fixed: 3696641
2024-01-17 03:09:56 -08:00
Yu Tian
f023bb3b27 qcacld-3.0: Separate Peer state get call from fast path
Peer state could be queried from both fast path and
slow path. Change separates this call and allows log
print from slow path call.

Change-Id: I888b67224752182b792e0165bd5cbacbb7e5f293
CRs-Fixed: 3691146
2024-01-17 00:37:08 -08:00
Amit Mehta
51d026afd1 qcacld-3.0: Optimize rx packet flush logic
Currently during vdev delete host will flush threads in serial
order, which can take upto 20 seconds for 5 threads in defconfig
build (Per thread wait timeout is 4 seconds in defconfig build),
this is turn can result in timeout in caller function, which has
maximum wait timeout of 10 seconds.

To optimize first flush all the threads nbuf list, after
flushing all the thread nbuf list wait for event completion
on threads.

CRs-Fixed: 3673505
Change-Id: I0c2979e7b08f27872da048c4a709800fc46eb526
2023-12-04 16:14:24 -08:00
Manikanta Pubbisetty
836a18a866 qcacld-3.0: Check for NULL before accessing dp_ctx or DP soc
Check for NULL before accessing dp_ctx or DP SOC in
__dp_bus_bw_compute_timer_stop().

Change-Id: I0d2862c4688f83c3d5f561baaa6ce62e96cca9c3
CRs-Fixed: 3659080
2023-11-14 12:10:23 -08:00
Yeshwanth Sriram Guntuka
7c5cc5e624 qcacld-3.0: Disable Direct Link CEs MSI on WFDS QMI server down
After direct link WFDS QMI server is down, host driver
unmaps the IPCC MSI address. There is a possibility
where FW can still enqueue entries to direct link CE
resulting in a SMMU fault when CE HW raises interrupt
after copy operation.

Fix is to disable direct link CEs MSI on WFDS QMI
server down indication prior to unmapping the MSI
address.

CRs-Fixed: 3657146
Change-Id: I38ce3bcc143743884d5c464eae74c390bf32eab6
2023-11-10 14:35:56 -08:00
Yu Tian
b72c0f6d99 qcacld-3.0: Change ICMP req mark to FW logic for TX side
If ICMP is a fragment frame, the first fragment is routed to FW.
Other parts are routed to HW directly. This will lead fragment
out of order and some Network stack can't reassemble it. This
change is aimed to keep the ICMP notify FW logic, but route
the last fragment to FW, then the order can be kept.

CRs-Fixed: 3641824
Change-Id: If3e83943126a974d79f18824ff66b209cc4edd39
2023-11-03 10:03:32 -07:00
Chaoli Zhou
fe3d6b0ace qcacld-3.0: Allow deliver EAPOL with link address to stack
For the MLO SAP setup connection with legacy STA case,
the DA of the 2/4 or 4/4  EAPOL is possible with bssid
address(link address) not adapter address(mld address),
and we should not drop them inside driver.

So add this change to allow EAPOL to be delivered with
DA is equal to link address or mld address.

Change-Id: I629d24190a4fdef2ef6b3eddd76a345735ec0ff7
CRs-Fixed: 3650022
2023-10-30 20:20:19 -07:00
Karthik Kantamneni
a3838b9425 qcacld-3.0: Rate limit excessive logs in DP component per packet path
Excessive error logs in per packet path may flood the system with logs.
Avoid this by rate limiting excessive logs in DP component per packet
path.

Change-Id: I1c06db6e22eb5e234cee19b8c9968c8444792e6c
CRs-Fixed: 3648926
2023-10-29 14:23:57 -07:00
Manikanta Pubbisetty
64d11c36b2 qcacld-3.0: Fix VDEV NULL point dereference in DP TX
Currently in dp_get_transmit_mac_addr(), VDEV objmgr is referred without
incrementing the VDEV reference count, because of this there could be a
potential kernel NPE when VDEV deletion and dp_start_xmit() are in race.

Since taking VDEV references is discouraged in the per packet path due
to locking, a simple VDEV NULL check should solve the problem considering
the fact that DP VDEV object is already protected by
dp_intf::num_active_task.

Change-Id: I52229dc589feada1b1ffb261468915df88d1e486
CRs-Fixed: 3625809
2023-10-19 10:14:35 -07:00
Karthik Kantamneni
4d104a0264 qcacld-3.0: Fix missing break statement in sync profile API
Fix missing break statement in memory profile sync API.

Change-Id: Ibde931156b670367ed591f363c57ba84fdc69c70
CRs-Fixed: 3632739
2023-10-14 08:38:28 -07:00
Srinivas Girigowda
69428aa5c5 qcacld-3.0: Use appropriate nbuf push type for tx_mon/rx_mon
Currently for rx packet delivery whether it is from monitor mode or
local packet capture path, is handled in NAPI softirq context and
netif_receive_skb() is called without disabling local bh.

In case of local packet capture, for tx packets after the tx_mon tlvs are
parsed, ppdu queue is handled in workqueue context and nbuf is passed
up the stack in rx_mon callback. Because the nbuf push type NAPI is used
this is causing 'BUG: using __this_cpu_add() in preemptible' for
nbuf coming from tx_mon workqueue context.

Fix is to identify the appropriate nbuf push type based on the context.
if caller is from softirq context then use DP_NBUF_PUSH_NAPI or
if caller is from non irq context use DP_NBUF_PUSH_BH_DISABLE.

Change-Id: I71b3be70febed1c077e7d4d36274a4805a33b722
CRs-Fixed: 3631536
2023-10-06 15:30:01 -07:00
Srinivas Girigowda
67a72fb6cd qcacld-3.0: Update SNOC voting for NAN case
In case of NAN, if the tput levels are between mid to high range then
apply next SNOC voting level.

Change-Id: Ifb77c8f627b5fc565767aac4baa3629b12a37582
CRs-Fixed: 3611715
2023-10-05 10:17:52 -07:00
Amit Mehta
8a31f0903d qcacld-3.0: Add DP FISA to SSR dump
Add DP FISA to SSR dump

Change-Id: I9d5c22dbbb6de6b89edff47e0805278e03a60f00
CRs-Fixed: 3604895
2023-09-21 14:35:42 -07:00
Rakesh Pillai
fcb4c977a8 qcacld-3.0: Skip FISA for small packets
Certain application, which send small packets with
critical info, are unable to process the FISA aggregated
UDP data.

Skip FISA aggregation for packets with UDP payload length
below 64 bytes.

Change-Id: I878f67688dd2b17cbd92322d8c51aedb4e7a5223
CRs-Fixed: 3613115
2023-09-12 23:34:27 -07:00
Jinwei Chen
9a1879b2e2 qcacld-3.0: Fix invalid dp_vdev accessing during FST update
scenario:
(1) DP FST update node with dp_vdev A has been inserted into
DP FST update list, but FST update work has not been queued due
runtime PM or it has not been scheduled for long time.
(2) dp vdev A get deleted after disconnection, but DP FST node with
dp vdev A still exists in list.
(3) new connection established, DP FST update work get scheduled,
invalid accessing to stale dp vdev A in
dp_fisa_rx_get_dp_intf_for_vdev() and hit panic.

solution:
(1) re-queue DP FST update work when runtime PM resume.
(2) validate dp vdev in dp_fisa_rx_fst_update_work() before
using it.

Change-Id: I7073a9d744806c33ddb5a7cbe9f7960890511eec
CRs-Fixed: 3607437
2023-09-09 19:31:49 -07:00
Vinod Kumar Pirla
6343b8c5f9 qcacld-3.0: Accept new function argument in link switch
Link switch notification now can be called multiple times
with different reason. Use notify reason to take appropriate
steps corresponding to state of link switch.

Change-Id: Ib3a37e887903305d9bb8472112e0d92520724835
CRs-Fixed: 3606670
2023-09-08 04:09:38 -07:00
Karthik Kantamneni
6f177b8539 qcacld-3.0: Fix race condition in refill thread cleanup
During refill thread cleanup shutdown event is posted and
we wait for thread to handle the shutdown event and exit.
But while posting shutdown event if refill thread is in running
state then there is chance of shutdown event not getting handled
and thread cleanup will be waiting indefinitely for thread to
exit.

Change-Id: I45bdad8d6a85b110ed7c7e206d3c79c5c03e9d98
CRs-Fixed: 3599295
2023-08-29 05:20:33 -07:00
Jinwei Chen
179f23968f qcacld-3.0: fix use after free issue in RX fisa path
scenario:
fisa_flow->head_skb freed in dp_fisa_rx_get_flow_flush_vdev_ref(),
but fisa_flow_vdev returned from dp_fisa_rx_get_flow_flush_vdev_ref()
is not NULL, dp_rx_fisa_flush_udp_flow() will still try to deliver
fisa_flow->head_skb to stack, use after free.

return NULL if dp_fisa_rx_get_flow_flush_vdev_ref() has freed
fisa_flow->head_skb.

Change-Id: I5a467db63377e6b5f36c4bb1dfa0e3f35b73a442
CRs-Fixed: 3596691
2023-08-25 09:06:19 -07:00
Jinwei Chen
5368fdf91e qcacld-3.0: skip sending DHCP indication message if host suspended
Scenario:
(1) Host entered into system suspend.
(2) FW received DHCP Req and trigger WOW wake up.
(3) Host send WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID to FW.
(4) FW reinject RX DHCP Req to REO, send WMI_WOW_WAKEUP_HOST_EVENTID
    to host.
(5) Since DP RX thread has been disabled, host DP receives DHCP Req
    and do DHCP inspection directly, send DHCP indication message
    to FW, but wmi_handle->is_target_suspended is true,
    trigger crash.
(6) Host set wmi_handle->is_target_suspended to false only after receiving
    WMI_WOW_WAKEUP_HOST_EVENTID.

Solution:
skip sending DHCP indication message if host suspended and DP RX
thread is not enabled, do not update sta_info->dhcp_nego_status,
then TX DHCP ACK won't do dp_post_dhcp_ind() in this case as well.

Change-Id: Ie4c414357ed7547ee9b882f3ec659bfe91b6b20d
CRs-Fixed: 3585743
2023-08-16 13:35:31 -07:00
Yu Tian
a7de1ef33a qcacld-3.0: Fix crash when FISA is disabled
If FISA is not enabled in config file, driver will
crash. Change adds error handling for no_support
return case.

Change-Id: I82e886a16f51e4e6db049b9224547b30bb9a10b4
CRs-Fixed: 3582517
2023-08-11 14:58:44 -07:00
Rakesh Pillai
dd66925398 qcacld-3.0: Register link switch notifier from DP component
Register MLO link switch notifier from DP component.

Change-Id: Ib03ff9b16d3c8cd02acfbf9f1340c77aae9599cc
CRs-Fixed: 3521310
2023-08-02 04:53:48 -07:00
Srinivas Girigowda
be5651b42e qcacld-3.0: Introduce wlan_dp_is_local_pkt_capture_enabled()
Introduce wlan_dp_is_local_pkt_capture_enabled API.

Change-Id: I608c927301bf145bf8fd2e222c047ca20c58a72b
CRs-Fixed: 3576511
2023-08-01 09:37:31 -07:00
Rakesh Pillai
2461d6dc54 qcacld-3.0: Move fisa aggregation control flags to dp_intf
Currently the FISA aggregation control flags, based on GRO
settings, are part of dp_vdev.

Move these FISA aggregation control flags to dp_intf,
since these controls are on an interface level, and not
on a per link level.

Change-Id: I93d0e215f8954376a96967cce6d533bd4be2d3a6
CRs-Fixed: 3574036
2023-07-31 19:37:23 -07:00
Ananya Gupta
354552db23 qcacld-3.0: Vote PCIe link when Direct link server is up
Support only D0 wow when direct link is up when XPAN feature
is up in WHC or P2P modes.

Change-Id: Ifbae57e4e1c8701950e7cecc095830a374603034
CRs-Fixed: 3559061
2023-07-30 19:07:23 -07:00
Rakesh Pillai
d03053c1c7 qcacld-3.0: Handle MLO link switch case for FISA flow flush to stack
When FISA aggregated flow is flushed to n/w stack, there
is a vdev_id comparison between the flow and the head skb.
If this vdev_id check fails, the packets are dropped.

In case of MLO link switch during the FISA flow aggregation,
the packets might be received on different vdev (belonging to
the same MLD). Hence the vdev_id comparison will fail when
there is a MLO link switch in between the flow aggregation.

Since both the vdevs belong to the same MLD, add a MLD addr
validation to mitigate the above mentioned issue.

Change-Id: I0328dccff3f08da87f55758b469d773b9ea1169b
CRs-Fixed: 3568987
2023-07-30 19:07:17 -07:00
Rakesh Pillai
273eee3139 qcacld-3.0: Add support to reset def_link during dynamic mac addr update
Dynamic mac address update is a special case, where the
(sta)connection can change without the vdevs corresponding
to an interface. The tx/rx happens on the def_link of the
dp_intf, which does not get reset in case of dynamic mac
addr update. Due to this, all the tx of packets might be
attempted on an invalid dp_link, leading to drop of all
the packets queued for TX.

Add support to reset the def_link of an interface during
dynamic mac address update.

Change-Id: I1e87c083f39b56525f69c225117bcce538931dbb
CRs-Fixed: 3570440
2023-07-27 04:49:26 -07:00
Rakesh Pillai
f09727ebc7 qcacld-3.0: Fix incorrect arg passing to stats (ol_txrx_ops)
dp_tx_rx_collect_connectivity_stats_info expects dp_link
handle as an argument. Currently many of the direct callers
of this function is passing dp_intf as an argument to this func.

Fix this by passing dp_link as an argument to the function
dp_tx_rx_collect_connectivity_stats_info.

Change-Id: Icfedc1cc721de4ad0b536967dc32a6af53b86e9e
CRs-Fixed: 3571037
2023-07-26 21:24:24 -07:00
Rakesh Pillai
a074f04323 qcacld-3.0: Select tx_dp_link in datapath component
Currently datapath uses the vdev provided by UMAC for
tx of any packet. With the single-netdev-multi-vdev
model, there are chances that the vdev, in MLO case,
selected for packet TX in UMAC may not be the def_link
which datapath expects to use for tx/rx.

Hence, to mitigate, this issue, datapath will not use
the vdev provided by UMAC, but instead select a dp_link,
inside the dp_component, for tx/rx

Change-Id: I5ff4a79365b3426e1bcc6d4cac31a44058ee18db
CRs-Fixed: 3568989
2023-07-25 22:29:19 -07:00
Rakesh Pillai
8f9d742ef5 qcacld-3.0: Cleanup datapath component code
Code cleanup in datapath component.

Change-Id: I03585bd319e835a28de37ae98fb8edafbc1820ee
CRs-Fixed: 3568991
2023-07-25 15:21:35 -07:00
Rakesh Pillai
cd187812d3 qcacld-3.0: Fix incorrect typecast in txrx_ops handlers
Currently the opaque context passed to txrx_ops handlers
is incorrectly typecasted to dp_intf. The context being passed
is dp_link handle. This leads to unwanted memory access.

Fix this by correctly typecasting the context passed to
all the txrx_ops handlers as dp_link handle.

Change-Id: I587b12056625bb68e86ecb54118bb2f6bfa62bd9
CRs-Fixed: 3569531
2023-07-25 15:21:30 -07:00
Rakesh Pillai
854bd8cafb qcacld-3.0: Fix incorrect arg passed in dp_rx_pkt_thread_enqueue_cbk
Currently dp_rx_pkt_thread_enqueue_cbk passed dp_intf to
dp_rx_packet_cbk, though it expects the caller to pass
dp_link context. This leads to an invalid memory access
due to incorrect typecasting.

Fix this by passing the correct dp_link context to
dp_rx_packet_cbk.

Change-Id: If37fd18d49a6d5464e01c07160a1be612e564ffb
CRs-Fixed: 3568233
2023-07-24 15:50:42 -07:00
Rakesh Pillai
2b1f8b6f81 qcacld-3.0: Avoid dereference of dp_link before NULL check
Fix issue by removing the dereference of dp_link
before NULL check.

Change-Id: I2e5987a2ec5652acabd8402b4c0c65106d37135d
CRs-Fixed: 3566033
2023-07-21 10:23:17 -07:00
Amit Mehta
2a87c33052 qcacld-3.0: Free dp_txrx_handle in dp_rx_refill_thread_init fail case
Currently in dp_txrx_init during dp_rx_refill_thread_init fail case
dp_txrx_handle is not freed which results in memory leak issue.

To fix the issue free dp_txrx_handle in dp_rx_refill_thread_init
fail case

Change-Id: I0804154519707d5d558940cccaa699f639ae6704
CRs-Fixed: 3563740
2023-07-21 01:16:07 -07:00
Rakesh Pillai
315a53eaa9 qcacld-3.0: Add ucfg API to update link mac addr
After moving to the single-netdev-multiple-vdev model,
the dp_link mac address needs to be updated as a part
of dynamic mac address update.

Add an ucfg API to update link mac address.

Change-Id: I96d3230f958c15cb576c881c02e60bd3a4fb0379
CRs-Fixed: 3563523
2023-07-20 13:39:04 -07:00
Rakesh Pillai
ecfe8c6f75 qcacld-3.0: Add API to find next def_link candidate
Add API to find the candidate for next default link.
This is used when the current default link is being
re-purposed or destroyed.

Change-Id: I98afd3ef2ac21d14ee6056f6329fbcf9a612959a
CRs-Fixed: 3519643
2023-07-20 13:38:58 -07:00
Rakesh Pillai
09e724c396 qcacld-3.0: Replace intf_id with link_id
Replace the usage of dp_intf->intf_id with
link_id from dp_link.

Change-Id: I1885ce300a0373172659ae8c38cb2ca54dda1a9c
CRs-Fixed: 3518898
2023-07-20 13:38:52 -07:00
Rakesh Pillai
1e093bec44 qcacld-3.0: Use dp_link in txrx path
Use dp_link in the core TX/RX path instead
of currently used dp_intf.

Change-Id: Id32a4053094fae844d190043d57f85a8e9659339
CRs-Fixed: 3518897
2023-07-20 13:38:46 -07:00