Commit Graph

54 Commits

Author SHA1 Message Date
wei yang
3491a58edd qcacld-3.0: fix compilation issue with dp_rx_napi_gro_flush
If CONFIG_WLAN_FEATURE_DP_RX_THREADS is not defined then
dp_rx_napi_gro_flush function will not get compiled from
dp_rx_thread.c, report compilation failure.

Modify dp_rx_napi_gro_flush to static inline type out of
dp_rx_thread.c.

Change-Id: Iad7619e29f6175bc80f2618b3675feafd7f3260d
CRs-Fixed: 2732503
2020-07-16 02:05:20 -07:00
Jinwei Chen
ebda2c45c3 qcacld-3.0: stop fisa aggregation if cumulative_ip_len not match msdu_len
If current msdu length - l4 header offset value is not matched with
cumulative IP length delta fetched from HW TLV, stop current fisa
aggregation.

Change-Id: Ia686a638a698d705db3c6bda58e85e4d94f323a1
CRs-Fixed: 2727291
2020-07-09 11:32:48 -07:00
Jinwei Chen
e3c87d96ac qcacld-3.0: refine FISA aggregation
Refine FISA aggregation as below,
(1) add aggregate count checking, if current msdu aggregate count
is not equal to last msdu aggregate count + 1, stop current fisa
flow aggregation.
(2) only if current msdu cumultive ip length is > last
msdu cumultive ip length and <= last msdu cumultive ip length
+ 1478, then continue the FISA aggregation.
(3) support variable GSO size UDP aggregation.

Change-Id: Ie86b46c09b1cd8ca5a5c7ad3c1349d4e0d876203
CRs-Fixed: 2724215
2020-07-08 02:14:07 -07:00
Manjunathappa Prakash
d269df54b3 qcacld-3.0: Reduce FSE cache invalidation messages
Current flow learning algorithm invalidates the cache for every time
flow is learnt. This results in multiple invalidation when there
multiple flows in quick succession of single NAPI soft IRQ processing.
FW has restriction on number simultaneous message processing.
Delay cache invalidation message so that single message serves multiple
flow learning.

Change-Id: Iee8cb5f12546890f2da32195dc3c4878e7a39ffd
CRs-Fixed: 2718968
2020-07-02 05:55:31 -07:00
Yeshwanth Sriram Guntuka
cec526afda qcacld-3.0: Add support to dynamically control fisa aggregation
Add support to dynamically control fisa aggregation in
the rx direction based on the dp_aggregation sysfs entry.

Change-Id: I677b8b5f05e6cd849671a058b5e6ef07fc14a969
CRs-Fixed: 2718132
2020-06-25 16:46:43 -07:00
Jinwei Chen
678c4d4648 qcacld-3.0: degrade log level for FISA debug
Currently when enable FISA debug, the default log level is
QDF_TRACE_LEVEL_ERROR which will output excessive logging
to kernel console, back pressure for RX might happen.

Degrade log level to QDF_TRACE_LEVEL_INFO_HIGH.

Change-Id: I5e910a6fc12d29179d3737f0c1d6c61b1383110b
CRs-Fixed: 2716688
2020-06-24 00:15:22 -07:00
Jinwei Chen
3f4590be9a qcacld-3.0: flush batched GRO_NORMAL packets
Kernel 5.4 has applied batched GRO_NORMAL packets processing
for all napi_gro_receive() users. this requires NAPI users to
call napi_complete_done() or napi_complete() at the end of every
polling to flush batched GRO_NORMAL packets.
However, by current wlan driver design, napi_gro_recevie()
is not happened in same NAPI polling context and done in another
thread context, it likely packets which have not been flushed from
napi->rx_list will get stall until next RX cycle.

Fix this by adding a manual flushing of the list right after
napi_gro_flush() call to mimic napi_complete() logics.

Change-Id: Id8c1b9360c380c9631c85f5e048ae2cd2798f65b
CRs-Fixed: 2673959
2020-06-14 22:14:05 -07:00
Saket Jha
160fab39e1 qcacld-3.0: Correct arguments for fisa rx flow setup
Due to recent changes, hal_rx_flow_setup_fse() should receive hal_soc as
argument during rx_flow setup.

Change-Id: Ic39f476b211417469e004d85cd03c6b868d97405
CRs-Fixed: 2706239
2020-06-10 18:13:33 -07:00
Jinwei Chen
d6165e65cb qcacld-3.0: update FISA entry vdev if flow search failed
If FISA flow search is failing by HW, but same FISA flow is
already present in host FISA SW table, vdev will not be updated
accordingly, so RX frame might be dropped due to vdev mismatch
when do FISA flush.

update vdev in FISA SW entry correctly.

Change-Id: I0907c6d2d1e25424fbebd6277f326346deba6569
CRs-Fixed: 2704610
2020-06-08 21:09:34 -07:00
Jinwei Chen
a6758b25d2 qcacld-3.0: Bypass FISA for RX DHCP frame
DHCP frame usually can not be aggregated, but if they go to FISA
path which will require FISA resource support for them, this looks
is not necessary.

Bypass FISA path for RX DHCP frame.

Change-Id: Ic1eac06abb5790813ee4d17ec1df6b215a1bcdb5
CRs-Fixed: 2691447
2020-06-08 10:30:23 -07:00
Rajesh Chauhan
b4a3dddcc6 Revert "qcacld-3.0: flush batched GRO_NORMAL packets"
This reverts Change-Id: Ib3e851c0822a85c4712a1b817cc19dfecf6d0e7a.
First we need to get ABI snapshot/Whitelist updated for the new
kernel API being used in this change and then only we can promote
this change. To unblock promotion, revert this change for now.

Change-Id: I8aae0fe64623034486c9db6275a16654119c06bd
CRs-Fixed: 2673959
2020-06-03 00:45:36 -07:00
Jinwei Chen
d3f4ccf4d6 qcacld-3.0: add vdev->osif_rx failure handling for fisa path
Currently there is no vdev->osif_rx result check in fisa path,
so if vdev->osif_rx returns failure, the RX skb may not have been
handled and it may be leaked.

Add vdev->osif_rx failure handling to avoid skb leak.

Change-Id: I6c194c31bbe71cba5c56c2b93f505225de439b72
CRs-Fixed: 2695084
2020-06-02 13:33:01 -07:00
Jinwei Chen
92f508a5eb qcacld-3.0: flush batched GRO_NORMAL packets
Kernel 5.4 has applied batched GRO_NORMAL packets processing
for all napi_gro_receive() users. this requires NAPI users to
call napi_complete_done() or napi_complete() at the end of every
polling to flush batched GRO_NORMAL packets.
However, by current wlan driver design, napi_gro_recevie()
is not happened in same NAPI polling context and done in another
thread context, it likely packets which have not been flushed from
napi->rx_list will get stall until next RX cycle.

Fix this by adding a manual flushing of the list right after
napi_gro_flush() call to mimic napi_complete() logics.

Change-Id: Ib3e851c0822a85c4712a1b817cc19dfecf6d0e7a
CRs-Fixed: 2673959
2020-05-26 01:40:38 -07:00
Jinwei Chen
b55574eb99 qcacld-3.0: Skip RX TLV header for RX fragment data
In dp_fisa_rx() function, L2 head pointer for fragment data is not
set correctly, actually it points to RX TLV header.
Skip RX TLV for RX fragment data.

Change-Id: Ie326734c657f45024a83792b103f931723148c92
CRs-Fixed: 2686851
2020-05-15 16:38:00 -07:00
Jinwei Chen
6409e4a8c5 qcacld-3.0: add FISA flush when vdev detach
In some case, FISA flush for one FISA entry is missed which
lead to some RX frames stay at FISA entry forever, this will
cause skb leak.
  Do FISA flush per vdev when vdev detach to avoid skb leak.

Change-Id: Ie6bdf885c740a99b089290257ea6936d5804d142
CRs-Fixed: 2679221
2020-05-15 05:24:30 -07:00
Jinwei Chen
bf047d7143 qcacld-3.0: Bypass FISA for non-regular RX delivering frame
Bypass FISA for non-regular RX delivering frame

Change-Id: I835229379779057f1b8cddcfffc3b3863137e5bc
CRs-Fixed: 2683727
2020-05-14 13:04:13 -07:00
Manjunathappa Prakash
ecade686b9 qcacld-3.0: Check for NULL dereference before access
Check for NULL dereference before accessing it.

Change-Id: Id2dc5f2c0f54f0c7681d2a26a53e7190ef46aba2
CRs-Fixed: 2668241
2020-05-08 16:10:35 -07:00
Manjunathappa Prakash
b6a71494fe qcacld-3.0: Use %pK format specifier in dp_rx_thread logs
Cleanup logging, usage of %p or %pk will lead to information leak.
Always use %pK instead when ever logging the address.

Change-Id: Id60782855f242175183f88e9f1c2efb9eb578404
CRs-Fixed: 2677373
2020-05-08 16:10:31 -07:00
Manjunathappa Prakash
52c3189299 qcacld-3.0: Use %pK format specifier in dp_rx_fisa logs
Cleanup logging, usage of %p or %pk will lead to information leak.
Always use %pK instead when ever logging the address.

Change-Id: Id11e1b52b394eb10bb2b32fc2ee2e04116f98026
CRs-Fixed: 2677373
2020-05-08 16:10:27 -07:00
bings
83c7c370d1 qcacld-3.0: Fix build error when WLAN_SUPPORT_RX_FISA defined
Fix print format in core/dp/txrx3.0/dp_fisa_rx.c
Both cds_ieee80211_common_i.h and net/ieee80211_radiotap.h define
IEEE80211_CHAN_*, so only one header is needed in wlan_hdd_tx_rx.c

Change-Id: Ie9c3a7ea04e9b71acf96f007515a7ae6c0def938
CRs-Fixed: 2644359
2020-03-20 17:05:31 -07:00
Jinwei Chen
bfe5d6b90c qcacld-3.0: fix skb leak possibility due to no failure handling
fix skb leak possibility due to no failure handling.

Change-Id: I0bd1e4cacdb408010057e35127a1ce9758c2e9c7
CRs-Fixed: 2627321
2020-03-13 06:47:03 -07:00
Jingxiang Ge
9a4d95c3fd qcacld-3.0: Fix dp_rx_thread hang issue
Issue happens as below scenaio:
1 suspend happens, but dp_rx_thread didn't finish in time,
  so timeout happens for suspend_event, here suspend will
  return success to kernel.
2 resume happens before dp_rx_thread to reset resume_event,
  and resume finished.
3 if dp_rx_thread finished and blocking with resume_event,
  and in following test, suspend didn't come(longer then
  hang detect time).
4 hang detect will alarm.

Fix is to return failure if dp_rx_thread can't be suspend
in time. Suspend can triger again later.

Change-Id: Ifbfdef5bb1c8d6e00b8fa5cc5e6dc74d3495c9ea
CRs-Fixed: 2626468
2020-02-24 00:20:35 -08:00
Manjunathappa Prakash
fa1ec29f1d qcacld-3.0: Get the required FISA TLVs back in fisa handling
FISA handling requires additional TLVs. dp_rx core handling
skips TLVs, recover back TLVs in FISA.

Change-Id: I6a4cbb91415facabae04e11d323b29673a7eade4
CRs-Fixed: 2618478
2020-02-20 06:39:07 -08:00
Manjunathappa Prakash
b1c5012090 qcacld-3.0: Update vdev in fisa_flow to takecare vdev change
Fisa flow in FT still exists even after vdev teardown. Same vdev
type is reinitialized with different vdev pointer.
So take care to update the fisa_flow vdev with current vdev.

Change-Id: Ib52c6d1ea5354532a42fd0065db740c96d78ebc6
CRs-Fixed: 2621691
2020-02-19 03:33:20 -08:00
Manjunathappa Prakash
a79c85f229 qcacld-3.0: Check for null deliver function in fisa
Consider case where vdev is valid but deliver function
callback is deregistered. Check for null delivery function.

Change-Id: If17f1d680a10c2009a910172a66cd8dcf7cdffbd
CRs-Fixed: 2613162
2020-02-15 10:11:20 -08:00
Manjunathappa Prakash
13dcee71cb qcacld-3.0: Return control after dropping NULL vdev msdus
Return control after dropping NULL vdev msdus and make sure to
NULL terminate the fisa_flow->head_skb.

Change-Id: I50e469f603b48cb578db30aaaaa9f974d469fde1
CRs-Fixed: 2613251
2020-02-12 11:57:26 -08:00
Manjunathappa Prakash
00cce59bcd qcacld-3.0: Check validity of dp_vdev while flushing
Validate vdev before delivering the packets for vdev.
Drop the packets if vdev is deleted.

Change-Id: If92d0fba04d96e3830bb4e6f04c395b4fcd54f84
CRs-Fixed: 2606760
2020-02-12 11:57:09 -08:00
Manjunathappa Prakash
db8c24946b qcacld-3.0: Aggregate the msdus of UDP flow
Aggregate the UDP flow msdu in to jumbo msdu and deliver to stack.
Stack handling of jumbo msdu saves the CPU mips.

Change-Id: I5a5d3fdbf3037d3b538f737bf4de8edc06260ab1
CRs-Fixed: 2600268
2020-02-12 11:56:17 -08:00
Manjunathappa Prakash
1fef6fba0c qcacld-3.0: Add logic to learn and program the flow in to FT
Check the HW TLVs to identify if the flow is already programmed.
If flow doesnot exist make an entry to SW and HW flow table.
Invalidate FSE cache to make fse read updated FT entry

Change-Id: I6acc539c5c7994e438ebb2af9cb3bb5ecbf6e120
CRs-Fixed: 2600268
2020-02-12 11:55:58 -08:00
Manjunathappa Prakash
77686579c1 qcacld-3.0: Allocate and initialize the FST for FISA
Add FST setup functions for allocating SW and DDR HW FT.

Change-Id: I13e7d5a40c7440f95d2308e0da5a883557b6b399
CRs-Fixed: 2600268
2020-02-12 11:55:44 -08:00
Jingxiang Ge
7ec9ead8d1 qcacld-3.0: Reset suspend_event before waiting for it
In dp_rx_tm_suspend, suspend_event should be reset before waiting
for it. otherwise, the suspend function will be break.

Change-Id: I9132f45b02386c54fb8e27f0f7c2c71205450c9d
CRs-Fixed: 2606227
2020-01-22 09:24:54 -08:00
Manjunathappa Prakash
a59028c1c9 qcacld-3.0: Update num_elem enqueued to rx_thread after head frag_list
Today we enqueue nbuf list to rx_thread via nbuf frags_list.
If deliver_head happens to have frags_list then it is delivered alone.
Remaining list of skbs are delivered using frags_list of next skb.
It does not takecare to update QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST of
the new head_skb with remaining num skbs, make sure to update it.

Also add nbuf_queued to take care of this accounting.

Change-Id: I5557b5c56576c46fc8564a87a27d167b8785bb95
CRs-Fixed: 2559875
2020-01-15 13:07:00 -08:00
Tiger Yu
0da98c48ee qcacld-3.0: Refine RX GRO flush when detach the vdev device
There might be race condition when doing RX GRO flush between dp_rx_thread
and vdev detach thread.

Only doing RX GRO flush in the dp_rx_thread context, and use the events to
sync with dp_rx_thread and vdev detach thread.

Change-Id: I2dbf92c2c11e950ca790dd7429c8bb235c239d0c
CRs-Fixed: 2601826
2020-01-14 02:01:44 -08:00
Tiger Yu
6bc77dc9c3 qcacld-3.0: Do RX GRO flush when detach the vdev device
If there are still RX packets pending in the napi gro_hash list, do RX GRO
flush after flushing the RX thread pending packets when detach the vdev to
avoid net_device might be invalid later which has been stored already in
the pending skb.

Change-Id: Iff0a5cf49c87b91b8cae3dbcb541d1cf0bc480a6
CRs-Fixed: 2598149
2020-01-08 04:52:46 -08:00
Vevek Venkatesan
0ac759fc1c qcacld-3.0: cdp: Converge cdp_cmn_ops
Currently cdp ops are given pdev/vdev/peer
handle as its arguments which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev_id or vdev_id or peer mac address,
which will be used to get the respective handles,
and hence avoiding the unwanted access of the
handles if it has been deleted.

- txrx_data_tx_cb_set
- txrx_mgmt_tx_cb_set
- txrx_mgmt_send_ext
- txrx_pdev_attach_target
- txrx_pdev_detach
- txrx_vdev_attach
- txrx_vdev_register
- txrx_vdev_detach
- txrx_peer_create
- txrx_peer_delete
- txrx_peer_delete_sync
- txrx_fw_stats_get
- txrx_get_vdev_from_vdev_id
- txrx_pdev_set_ctrl_pdev
- txrx_pdev_attach
- txrx_get_vdev_mac_addr
- txrx_pdev_post_attach
- txrx_pdev_pre_detach
- txrx_get_ctrl_pdev_from_vdev
- txrx_get_mon_vdev_from_pdev

Change-Id: Ib8b0b1edd63e7c3f8813b11ca26b50ec121fe255
CRs-Fixed: 2541459
2019-12-27 03:24:09 -08:00
Rakesh Pillai
246f1dfdd2 qcacld-3.0: Add support to flush rx packets for a vdev
When a particular vdev is deleted, the corresponding rx
packets which have been queued to the rx thread are not
flushed. Hence when such packets are submitted to the
network stack, the dev for this skb will be invalid,
since we have already freed the adapter.

Flush out the packets in the rx thread queues, before
deleting the vdev.

CRs-Fixed: 2552140
Change-Id: Ia49af2c203c64077f7fd87524bb4caa4060e0044
2019-11-01 00:17:18 -07:00
Rakesh Pillai
6c5af2fc0a qcacld-3.0: Use pdev_id instead of global dp handle
As a part of cdp convergence the pdev_id
is used to obtain the pdev handle on need
basis.

Instead of the pdev handle, use the pdev_id to
retrieve datapath pdev handle.

CRs-Fixed: 2539733
Change-Id: I887ea2f1a312207cbb642b33435f4e7111068c62
2019-10-24 21:41:42 -07:00
Mohit Khanna
7a2116a8a7 qcacld-3.0: Resume DP threads during SSR
During SSR, DP RX threads need to be resumed so that they can be later
shutdown by posting RX_SHUTDOWN_EVENT to the threads. DP Threads
shutdown procedure waits on a completion event, which is completed by
the threads. In case the threads are not up, the caller may
be stuck waiting for DP threads to shutdown.

Check state before DP RX thread suspend/resume to avoid repetitive
suspend/resume requests.

Change-Id: Idb689e0dae7cf487e0bea45ef2dade369ae2f9f6
CRs-Fixed: 2529673
2019-09-30 14:40:47 -07:00
Rakshith Suresh Patkar
1a2bfd5e28 qcacld-3.0: Remove peer_local_id usage in dp_rx_thread_process_nbufq
Local peer_id is being cleaned up across DP, HDD and PS/WMA.
So, any references to local peer_id/sta_id will be replaced
by peer mac address and all interactions between the layers
will be based on peer mac address.

This change invloves removal of local_peer_id usage from
DP API dp_rx_thread_process_nbufq.

Change-Id: Ibfed421df3ace139808d16365ec5d54e9b013dfe
CRs-Fixed: 2512693
2019-09-06 22:24:47 -07:00
Mohit Khanna
ba8b3fe3a8 qcacld-3.0: Use different wait queues for threads
Currently DP RX threads are using the same wait_q for all operations.
The problem with this is that when there is traffic for only one
threads, we end up waking up other threads as well moementarily.
This wastes power and is in-efficient.

Use different wait queues for different threads.

CRs-Fixed: 2495719
Change-Id: I689659b7aa0ab93b7e2f009d2dc7fe741b66ee78
2019-08-13 20:25:57 -07:00
Mohit Khanna
f0620ce6ca qcacld-3.0: Add support for GRO flush indications
Add support for sending GRO flush indication to DP Rx Thread.

CRs-Fixed: 2495719
Change-Id: I8723dc696d8af705067a50dcf5f161ef4f28d485
2019-08-13 16:23:28 -07:00
Mohit Khanna
c77d69d19b qcacld-3.0: Affine threads to perf core in high tput
Affine DP RX Threads to perf cluster in high throughput scenarios.
High throughput is detected using existing logic from the bandwidth
timer.

Change-Id: Ieb98c6930807ba42be7f5b4d0b8a78dfb197ba27
CRs-Fixed: 2474322
2019-06-28 18:07:50 -07:00
Mohit Khanna
b7194395ee qcacld-3.0: Handle unregistered OS RX handles in DP RX Thread
On association completion, RX handles are registered with the DP layer
as a part of cdp_vdev_register. It is possible that immediately after
association, host receives RX packets, but RX handles have not been
registered for the vdev with DP layer.

Drop packets in DP RX Thread if OS RX handles are not found for the
vdev.

Change-Id: I3bbd489ec9c5e6f6267521818663b123a85bb3f9
CRs-Fixed: 2419376
2019-03-28 16:50:07 -07:00
Dustin Brown
207286b118 qcacld-3.0: Provide reason to QDF_DEBUG_PANIC()
A common pattern in WLAN to panic the driver is to log the reason and
then unconditionally panic. QDF_DEBUG_PANIC() takes a reason string to
help make the reason for the panic more obvious, but it is not always
used. Ensure all callers of QDF_DEBUG_PANIC() provide a reason string.

Change-Id: I3d23a8980adaeaa1a9798a4a6b0fba1f36eb52ad
CRs-Fixed: 2403829
2019-02-23 14:06:21 -08:00
hangtian
127c953c7f qcacld-3.0: Use qdf_mem_zero for zero initialization
Use qdf_mem_zero for zero initialization.

Change-Id: Ic2b8d907623cf67a4569aaf01398c1b3a2bff707
CRs-Fixed: 2376644
2019-01-14 08:38:03 -08:00
Mohit Khanna
c9649650d2 qcacld-3.0: Support to dump DP RX Thread stats
Add DP RX Thread Stats support. Stats can be retrieved using iwpriv
dumpStats command.
Remove print from hdd_gro_rx_dp_thread function. This condition is
expected when gro is disabled on low throughput. Print is not needed.

CRs-Fixed: 2346997
Change-Id: I3619844b66e845184a4b8c77763bf9f2d2ea0a38
2019-01-13 18:45:47 -08:00
Mohit Khanna
8141877926 qcacld-3.0: changes for GRO for TCP packets
Add support for GRO functionality for TCP packets.

CRs-Fixed: 2346997
Change-Id: I9d38c926af4114e90427f5b5c632cd02b9eb3160
2018-12-18 00:07:46 -08:00
Mohit Khanna
4079b4b464 qcacld-3.0: Remove un-initialized lock from DP thread
DP RX thread is using an un-initialized lock during suspend/resume
routine. This lock is not needed as the code is executed only by a
single execution context.

Remove usage of un-initialized lock.

CRs-Fixed: 2351010
Change-Id: I656562fe3ca73a5044163008a44ffae416a6a7fa
2018-11-29 18:11:58 -08:00
Nirav Shah
7c8c171e05 qcacld-3.0: Remove unnecessary prints from data path
1. Remove error prints for qdf_mem_malloc APIs.
2. Remove unnecessary __func__ from data path prints.

Change-Id: I6c4b110f626d84da055821c5f210a3d000b6ff15
CRs-Fixed: 2317315
2018-11-16 05:08:30 -08:00
Jianmin Zhu
13921e9f1e qcacld-3.0: Fix compiling issue of __DP_RX_THREAD__H
error: '__DP_RX_THREAD__H' is used as a header guard here,
followed by #define of a different macro [-Werror,
-Wheader-guard]

Change-Id: I21beca14c8ea98a9a6c4a4acd5f3c7428fd56e01
CRs-Fixed: 2315965
2018-09-18 23:39:56 -07:00