Commit Graph

827 Commits

Author SHA1 Message Date
Surabhi Vishnoi
878eeb8f5d qcacmn: Add extension2 data to radiotap header
There is a requirement to get sequence number and tid for tx
data packets in packet capture mode. These fields are not
received as part of WBM tx completion, but are obtained from
FW in ppdu stats. As WBM tx completion and FW ppdu stats are
two different events, the ppdu_stats of previously sent ppdu
are filled in the radiotap header of current tx ppdu in packet
capture mode.

Enhance code to add required fields such as ppdu_id of tx current
ppdu and ppdu_id, tid, start_seq, ba_bitmap of previously sent ppdu
as extension2 to radiotap header. These fields will be added in
radiotap header only when add_rtap_ext2 is set.

Change-Id: I448a9c03a770b61ab802d855bc5f1a6587bd01b3
CRs-Fixed: 3004472
2021-09-06 00:55:05 -07:00
Paul Zhang
17818ac91e qcacmn: Revise to include walt.h header
Since walt is msm-only scheduler group of features,
not upstreamed. Include walt.h header when CONFIG_SCHED_WALT
has been enabled.

CRs-Fixed: 3023820
Change-Id: Ib1aacae83ca4168eff958341f0feebe8ab37a4e7
2021-09-03 05:51:01 -07:00
Vignesh Viswanathan
1a7abca3c0 qcacmn: Add option to disable Cached Descriptor support
Some platforms do not support cached descripts for DP Rings.
Add support to set WLAN_CFG_DST_RING_CACHED_DESC to 0 and make
__qdf_nbuf_dma_inv_range as stub if DP_NO_CACHE_DESC_SUPPORT flag is
enabled during compilation.

Change-Id: Ic6b483be25c32f3f3c79b170fb7d7557a232b4ac
CRs-Fixed: 3027649
2021-09-03 05:50:56 -07:00
Jianmin Zhu
cc74d108d0 qcacmn: Fix array out of bounds issue
In qdf_mem_multi_page_link, pages->cacheable_pages is array with elem num
pages->num_pages, but pages->cacheable_pages[pages->num_pages] is read,
out of bounds error will report if KASAN enabled.

When ini dp_tx_ext_desc is 6144 and DP_TX_DESC_POOL_SIZE is 6144,
Size in bytes of TX TSO Num Seg Desc is 16, page size is 4096, so TX TSO
Num Seq Desc need 24 pages (6144*16/4096), each address need 8 bytes,
so TSO Num Seq Desc need kmalloc 192 bytes to save address of 24 pages.

BUG: KASAN: slab-out-of-bounds in qdf_mem_multi_page_link+0x190/0x1f4
Read of size 8 at addr ffffff816b4d60c0 by task kworker/u16:0/8

CPU: 7 PID: 8 Comm: kworker/u16:0 Tainted: G S      W  O
Workqueue: cnss_driver_event cnss_driver_event_work
Call trace:
 dump_backtrace+0x0/0x204
 show_stack+0x18/0x24
 dump_stack+0xcc/0x11c
 print_address_description+0x88/0x578
 __kasan_report+0x1ac/0x20c
 kasan_report+0x14/0x20
 __asan_load8+0x98/0x9c
 qdf_mem_multi_page_link+0x190/0x1f4 [wlan]
 dp_tx_tso_num_seg_pool_init+0x84/0x170 [wlan]
 dp_soc_tx_desc_sw_pools_init+0xb4/0x128 [wlan]
 dp_soc_init+0xf78/0x18c8 [wlan]
 dp_soc_init_wifi3+0x14/0x20 [wlan]
 cds_open+0x7e8/0x15fc [wlan]
 hdd_wlan_start_modules+0x7d8/0xf10 [wlan]
 hdd_wlan_startup+0x17c/0xbd4 [wlan]
 wlan_hdd_pld_probe+0x234/0x370 [wlan]
 pld_pcie_probe+0x6c/0x88 [wlan]
 cnss_pci_call_driver_probe+0xd8/0x358
 cnss_bus_call_driver_probe+0x38/0x6c
 cnss_driver_event_work+0xf14/0x1188
 process_one_work+0x53c/0x8b8
 worker_thread+0x4f8/0x928
 kthread+0x1e8/0x200
 ret_from_fork+0x10/0x18

Allocated by task 8:
 __kasan_kmalloc+0x100/0x1c0
 kasan_kmalloc+0x10/0x1c
 __kmalloc+0x130/0x448
 kzalloc+0x14/0x20 [wlan]
 __qdf_mem_malloc+0xcc/0x120 [wlan]
 qdf_mem_multi_pages_alloc+0xc0/0x580 [wlan]
 dp_prealloc_init+0x1b0/0x48c [wlan]
 wlan_hdd_pld_probe+0x200/0x370 [wlan]
 pld_pcie_probe+0x6c/0x88 [wlan]
 cnss_pci_call_driver_probe+0xd8/0x358
 cnss_bus_call_driver_probe+0x38/0x6c
 cnss_driver_event_work+0xf14/0x1188
 process_one_work+0x53c/0x8b8
 worker_thread+0x4f8/0x928
 kthread+0x1e8/0x200
 ret_from_fork+0x10/0x18

The bad address belongs to the object
which belongs to the cache kmalloc-192 of size 192
The bad address is located 0 bytes to the right of
f816b4d60c0).

Change-Id: I6569c22bc8f900296f49a4426f085912a33aa452
CRs-Fixed: 3014390
2021-08-17 15:46:43 -07:00
Kiran Venkatappa
a41cb25122 qcacmn: Remove get API under QDF_TIMER_MULTIPLIER_FRAC
Set QDF_TIMER_MULTIPLIER_FRAC to default multiplier if it is defined.
Remove get API under this feature flag so that this can be modified using
set dynamically based on the emulation target detect.

Change-Id: If0743e6b571832ebf3319f9895350685a5cd53f0
CRs-Fixed: 2995514
2021-08-16 03:18:34 -07:00
aloksing
be3cc56202 qcacmn: Add separate ID for Monitor trace prints
Add a separate module ID for Monitor error/debug Information.

Change-Id: Ie784430da8000b8a527f07261e039b6d3f903503
CRs-Fixed: 3006497
2021-08-12 05:32:52 -07:00
Paul Zhang
4b21f23fdd qcacmn: Align 8 bytes for qdf_mem_header address
In the function list_empty(), there is macro READ_ONCE() and
assembler instruction "ldar" will be used. It requests 8 byptes
alignment for qdf_mem_header address or data abort will happen.

To resolve this issue, align the qdf_mem_header address when
invoking function qdf_mem_dma_get_header().

CRs-Fixed: 2997107
Change-Id: I3d079c3c7e0f3634d85f891327284aefb7a65711
2021-08-11 22:38:41 -07:00
Harsh Kumar Bijlani
43da5b8892 qcacmn: Add API for unmap with physical and virtual addr of nbuf
Tx data transfer in host mode with nbuf map_unmap debug frmwk
enabled and enhanced stats disabled results in an assert.
This is because on Tx completion path, nbuf unmap is done using API
qdf_mem_unmap_nbytes_single which takes physical address of nbuf
for unmap and does not remove nbuf from map_unmap tracking list and
when nbuf is freed, it results in assert as the tracking list still
contains that nbuf entry.

In order to fix this, define a new API for nbuf unmap passing physical
and virtual address of nbuf as arguments. Physical address is passed
as an argument in order to avoid cache miss in per packet path which
eventually helps in improving the KPI.

Change-Id: I77ab6ac3ac98556b9caff8aa3ee82bc23cd26de7
CRs-Fixed: 3006671
2021-08-09 22:25:29 -07:00
Ananya Gupta
f2851b458b qcacmn: Affine rx_err srng to all CPUs except 0
IPA and rx_err ring are processed in same CPU resulting
in low Tput.
To fix this, not allow processing of rx_err ring in
CPU 0

Change-Id: Id53a03c9290607beb1a595c84bfb0fd8d9f5d105
CRs-Fixed: 2949569
2021-07-27 01:00:14 -07:00
Vivek
f8167f4dbc qcacmn: Call cfg80211 functions with context aware allocation flags
There are instances in the code where the response is sent from the
driver to the supplicant indicating the allocation flags which is
used by the supplicant to allocate memory.

In those situations, we should pass the allocation flags based on
the context in which the response is sent.

Send the response with the right allocation flags to the supplicant.

Change-Id: I85f1c29fc66ba51a9f9c645692712c3a25b7fed1
CRs-Fixed: 2987552
2021-07-26 13:54:14 -07:00
Vivek
3853650e2e qcacmn: Add new MBSS framework component
Add a new component for MBSS framework in object manager.

Add a new trace module for the new MBSS component framework.

Change-Id: I7ef3559d90a6bc7f558e3994a1a91f09985d90e9
CRs-Fixed: 2958764
2021-07-21 17:14:56 -07:00
Manjunathappa Prakash
036b05b69e qcacmn: Enable need idle functionality for 5.10 kernel
On 5.10 kernel need idle” functionality is moved from
<linux/sched.h> to walt (<Linux/sched/walt.h>), Replace
“PF_WAKE_UP_IDLE” checks with “IS_ENABLED(CONFIG_SCHED_WALT)”.

Change-Id: Icb89b0e6e9862ed5b82680379a1d2630c9b2b4d9
CRs-Fixed: 2990760
2021-07-15 14:34:06 -07:00
Krishna Rao
1ce921eb1a qcacmn: Add separate ID for ML IE trace prints
Add a separate module ID for Multi Link Operation (MLO) Information
Element protocol processing related QDF trace prints. These are for
use in processing of any IEs related to MLO. This would help separate
the tracing of MLO IE operations which are expected to be substantial,
and avoid confusion that might arise from reuse of MLO manager
tracing.

Change-Id: If55532a89452b6432101be07fcc6aff45045e822
CRs-Fixed: 2985731
2021-07-14 15:32:22 -07:00
sandhu
81272da21e qcacmn: Add support to log ICMP packet seq no and ID
Add support to log ICMP seq no and ID in DPTRACE.
Other protcols can use this private proto data to record
there private data accordingly. Currently it is set to 0.
Increase the record entry from 40 bytes to 50 bytes.

Change-Id: Ief5fb26a97408a364af486f3eaec2e108de71d52
CRs-Fixed: 2951916
2021-07-07 04:28:14 -07:00
Debasis Das
273d2795c6 qcacmn: Initialize variable that collects return status of functions
The variable used to collect the status of function calls
should be initialized.

Change-Id: I2716673455ca4b48c4945739f2e43343be488234
2021-07-01 11:23:30 -07:00
Arun Kumar Khandavalli
4d8b3bb683 qcacmn: Add the api to set smmu fault state
There is a time involved between the smmu fault initiated
and the eventual system panic. In this time there is a
possibility of the nbuf history being overwritten losing
the information on the nbuf which might has actually caused
the SMMU fault.

Set the ssmu state and dont track the nbuf's when the smmu
fault is detected.

Change-Id: I579da332766618161567764656005ef13667270e
CRs-Fixed: 2960070
2021-06-28 05:11:12 -07:00
Harsh Kumar Bijlani
0212730a84 qcacmn: Add check for memory_debug_disabled in nbuf APIs
Check for is_initial_mem_debug_disabled is missing in nbuf APIs.
Add check for is_initial_mem_debug_disabled in those APIs.

Change-Id: Ie85cae8029b5d47567da861dd84b86221a68b0f5
CRs-Fixed: 2962901
2021-06-09 05:17:30 -07:00
Himanshu Batra
0f0ee4c77c qcacmn: Add print APIs for MLO
Add print api definitions for MLO

Change-Id: I7761fe01fba85bd8fb97413f95f73d995f84c1aa
CRs-Fixed: 2958486
2021-06-08 03:16:37 -07:00
Amruta Kulkarni
6084c736c6 qcacmn: Use AES api's instead of the generic crypto api's
For Kernel version 5.4 and up use AES api's instead of
generic crypto api's referenced in qdf crypto module.

Change-Id: I92031d469d0da657dce4dcb8c603c82a1e182f1d
CRs-Fixed: 2947476
2021-05-27 06:03:32 -07:00
Kai Chen
c089dc5216 qcacmn: remove duplicate definition for radiotap header
Move duplicate radiotap header definition to header file

Change-Id: Ieb833f26c6c433c7917cc2196d4957102501672c
2021-05-13 15:32:20 -07:00
Karthik Kantamneni
6370333013 qcacmn: Make QDF NBUF history size configurable
Some of the targets require more QDF nbuf history
size, so making the size configurable keeping
default same.

Change-Id: Ic4ac43a1eacb1e58c0a05b794349525d614d7fc8
CRs-Fixed: 2929968
2021-05-12 20:57:57 -07:00
Alan Chen
0fedc36000 qcacmn: Add ksize check for calling qdf_mem_prealloc_put
In perf builds, add a ksize check and call qdf_mem_prealloc_put()
only when size is greater than 4K to avoid lookup overhead.

Change-Id: If01a7cbeaf1ee7f514f16296340169a937dafa78
CRs-Fixed: 2936464
2021-05-07 22:53:58 -07:00
Ananya Gupta
9f3b9ca800 qcacmn: compiling WDI3 version of IPA
Depreciated IPA APIs are currently getting compiled.
To fix this, adding linux kernel version check

Change-Id: I2288db34c09d60047c67a5df9081de08a6c2f62b
CRs-Fixed: 2927413
2021-05-06 06:23:47 -07:00
Adwait Nayak
c2c89243d8 qcacmn: Parse and update qdf module params
Read the file wifi_module_param.ini, in which wifi module params
are present and compare these module params with qdf module params
in qdf module init function.

If any of the module params belongs to qdf module is present,
then that particular module param is updted during qdf module init.

Change-Id: I76ef876f6c7be3cdffd93b6050a190438d60bf39
2021-04-27 16:13:11 -07:00
Rajeev Kumar
c0a7a9dfe2 qcacmn: Replace request_firmware by firmware_request_nowarn
Replace request_firmware by firmware_request_nowarn to avoid warning
message when the file is not found and sysfs fallback mechanism is
enabled if direct filesystem lookup fails.

Change-Id: Ib55d257aa01c52523b1f1137165c842e139ce614
CRs-Fixed: 2912039
2021-04-02 12:02:49 -07:00
Jeff Johnson
79b61afd8f qcacmn: Do not export static functions
Linux kernel commit 15bfc2348d54 ("modpost: check for static
EXPORT_SYMBOL* functions") adds a check to make sure that static
functions are not exported.

With this in place the following fatal errors are reported:
FATAL: modpost: "__qdf_nbuf_get_ether_type" is a static EXPORT_SYMBOL
FATAL: modpost: "os_if_spectral_free_skb" is a static EXPORT_SYMBOL
FATAL: modpost: "qdf_nbuf_tx_desc_count_update" is a static EXPORT_SYMBOL
FATAL: modpost: "__qdf_nbuf_get_ip_offset" is a static EXPORT_SYMBOL

To fix these errors do not export the static functions.

Change-Id: Ib5caab904401900bafb23dee23b119daa76d4055
CRs-Fixed: 2910980
2021-03-31 10:07:30 -07:00
Jia Ding
4737cf81c4 qcacmn: Add qdf macros for IPA TX two pipes
Add qdf macros to support IPA TX two pipes configuration.

Change-Id: I9d8b960355c084c49a664efafa7aac3153602572
CRs-Fixed: 2750078
2021-03-24 09:48:30 -07:00
Li Feng
8055c97ed3 qcacmn: Use ktime_get_real_ts64() api from kernel v5.4.0
Use ktime_get_real_ts64() api from kernel v5.4.0.

Change-Id: Ica8b5d2daa7560472eed084145587e3ad189503f
CRs-Fixed: 2900092
2021-03-20 20:45:49 -07:00
Chaithanya Garrepalli
20500d66ae qcacmn: Fix double free false positive with qdf_nbuf_unshare
In qdf_nbuf_unshare_debug() API remove the refernce of old nbuf
before calling skb_unshare(). As skb_unshare() will free old nbuf
and allocate a new one for a cloned skb.

Change-Id: I2a2f0277934268a346e13a0779e204f02c9bcf5b
2021-03-19 18:51:26 -07:00
Aditya Kodukula
45e98f35da qcacmn: Enable the minidump API based on Kernel Version
The minidump API msm_minidump_remove_region() was added to the
msm-kernel from version 4.19 so, to avoid compilation failures in
older kernel versions, enable the feature flag WLAN_QCOM_MINIDUMP
for kernel beginnig with 4.19 version.

Change-Id: Iba7a293fb9ca3e5ffe967e8d610251df8c2a3969
CRs-Fixed: 2901746
2021-03-18 11:51:39 -07:00
Jingxiang Ge
2c6d25c0ad qcacmn: Add detection for tasklet delay
This feature is used to detect CE tasklet scheduling delay
and credit response delay issues.

Change-Id: I9a8fcb425edd5cf96fae5f6cd3bfc7f51172c814
CRs-Fixed: 2874874
2021-03-16 00:45:23 -07:00
Aditya Kodukula
20380cee21 qcacmn: Add QDF infra for the minidump feature
Add QDF infra for minidump feature and define the
minidump_log and minidump_remove functions.

Change-Id: I875b991b7a7d9295f8b2acd95a7551a747ec962c
CRs-Fixed: 2856193
2021-03-09 21:06:54 -08:00
Vevek Venkatesan
fdf0a167e5 qcacmn: change the return type of qdf_queue_work to bool
Currently the return type of qdf_queue_work is void,
whereas queue_work return type is bool denoting the status,
so changing the return type of qdf_queue_work to bool,
helps to check the status of the function.

Change-Id: Ifd07923a18641790314b88d38a7eba2a73e498b3
CRs-Fixed: 2876197
2021-02-12 12:27:25 -08:00
Bapiraju Alla
ded2573351 qcacmn: Add bug_on incase of skb set packet length failure
Add bug_on incase of set packet length failure for debugging purpose

Change-Id: Ie91da71c2420c585b27625ec241e62a2706606c4
CRs-Fixed: 2849081
2021-02-11 04:43:34 -08:00
Debasis Das
eba308d926 qcacmn: Include relevant header-file
Include relevant header-file to use QDF_BUG macro.

Change-Id: I9ad43a05410cf6641f76a94e0e9f40e323997c50
2021-02-04 08:50:31 -08:00
Yeshwanth Sriram Guntuka
28c395b59d qcacmn: Add iova to nbuf map history event
Record iova address in the nbuf map history
events.

Change-Id: I1bb415537ffe68c839c4c2f69901394ad047022b
CRs-Fixed: 2856038
2021-02-02 07:49:39 -08:00
Vivek
7d38880a19 qcacmn: Enable rate limiting on for prints in interrupt context
The current print rate limiting for prints to console is 
for all contexts.
There are some debug prints which come to console via work queues
which we don't want to rate limit and only rate limit coming via 
interrupt context or bottom halves which causes 
FW backpressure due to excessive prints.

So rate  limit prints coming to console if in 
interrupt context or bottom halves

CRs-Fixed: 2853590
Change-Id: I867b2c0d17b54037ee45eb6b7871a16c2668d7ba
2021-01-29 00:04:31 -08:00
Vivek
5589f598a5 qcacmn: Abstract the qdf_in_interrupt API
The qdf_in_interrupt API was defined in the internal
Linux util file.
Move the API from internal to qdf_util.h and provide
the appropriate abstraction

CRs-Fixed: 2853590
Change-Id: I512155776275684223c1901d789853d2529fcc83
2021-01-29 00:04:27 -08:00
Bapiraju Alla
2bd0e399d9 qcacmn: Fix compilation issues when WLAN_DEBUGFS feature is disabled
Fix compilation issue when WLAN_DEBUGFS feature is disabled.

Change-Id: Ifb186212e4d50f79f3492e194bbe82e3ed735ff7
CRs-Fixed: 2865197
2021-01-29 00:04:23 -08:00
Debasis Das
2c411d6e74 qcacmn: Make inline OS-abstraction APIs as non-inline
OS-abstraction API's are made non-inline to avoid direct
usage of kernel API's.

Change-Id: Ib35aa9271d98054ab582fc079e62714bb7fdae99
2021-01-22 05:31:44 -08:00
Debasis Das
aca02352ec qcacmn: Add non-inline OS-abstraction APIs
Use non-inline OS-abstraction APIs to avoid OS APIs usage directly in
driver.

Add new non-inline OS-abstraction APIs.

CRs-Fixed: 2742480
Change-Id: I177b41d69ca8f102fa67316d8901b6991dea3203
2021-01-21 03:43:37 -08:00
Alan Chen
64782f823f qcacmn: Return proper value of qdf timer multiplier
Return proper value of qdf timer multiplier based on this
Kbuild option QDF_TIMER_MULTIPLIER_FRAC.

Change-Id: I10c08ba900aad49fb9134d2e4d337f04a19dec7b
CRs-Fixed: 2855512
2021-01-19 23:24:33 -08:00
Ananya Gupta
a3152f3104 qcacmn: Add DP event history in non debug mode
Enable DP event history for perf mode.

Change-Id: I1b8863928f956aa39488ea357d56e182613aad8d
CRs-Fixed: 2846844
2021-01-19 19:02:49 -08:00
Vivek
69a1c93dc2 qcacmn: Rate limit prints to console from logging utility
The prints from the driver are rate limited based on the
configurations provided.

Also the prints which are redirected to user space daemon
and of certain log levels are also printed on the console.

Add a rate limiting version of the API for the prints coming
to console via the logging daemon.

CRs-Fixed: 2853590
Change-Id: I9683172ac0665b46581bad13a1050c6d70d72b5c
2021-01-19 03:52:13 -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
Yeshwanth Sriram Guntuka
cdd58a5a2d qcacmn: Change QDF per packet proto log level to info
QDF per packet proto log level is set to debug due to
which the info is not logged to console.

Fix is to change QDF per packet proto log level to info.

Change-Id: I64b6d577475ea6133ec0565ae459629b81c0929c
CRs-Fixed: 2847863
2021-01-08 09:57:12 -08:00
Karthik Kantamneni
dcba7b8baf qcacmn: Maintain counter for nbuf tracker nodes memory allocation failures
During nbuf free if entry is not found in debug tracker list
it is treated as double free or unallocated buffer free
which is not correct because there is possibility of nbuf
entry not being present in debug tracker list due to memory
allocation failures for tracker nodes in system low memory state.

Maintaian counter for nbuf debug tracker node memory
allocation failures, during nbuf free if entry is not found
in debug tracker list and tracker memory allocation failures
are present then don't raise issue for nbuf free.

Change-Id: I770cfc23bad35af7e7dbec34852a31cc68300ca5
CRs-Fixed: 2844059
2021-01-06 21:55:11 -08:00
Jinwei Chen
f3a732ed1c qcacmn: Add function to get gso_segs from skb
Add qdf function to get gso_segs from skb.

Change-Id: I92eca7fb4adf6d08454f27469a62f4d16ff1072c
CRs-Fixed: 2846442
2021-01-05 16:13:19 -08:00
Shikha Bakshi
84bbeeedec qcacmn: Rectify MODULE ID in display for qdf_cv_lvl
Rectify dispaly module ID for QDF_MODULE_ID_DP_RX_MON_DEST

Change-Id: I6aee8c38d67aad1a6a97325d2e9f1a16e1f4fbdd
2020-12-28 15:13:22 -08:00
Adwait Nayak
8ca19e58fe qcacmn: Add memory corruption check
Do not allocate memory if the ask is larger than the
maximum memory allowed for malloc. We have it limited to 4MB.

CRs-Fixed: 2828104
Change-Id: I5b463dd8eb640c76882653e82e6f6db7cb651cf2
2020-12-21 20:55:20 -08:00