Commit Graph

800 Commits

Author SHA1 Message Date
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
Nisha Menon
af829916ee qcacmn: Account for Tx nbuf memory in mapped unmapped TSO segs
During TCP Tx traffic account for the Tx nbuf memory mapped
and unmapped in the driver.

Change-Id: I40df92f124eec94f2fa3ddc8bcd910615f4539bf
CRs-Fixed: 2831015
2020-12-18 19:38:29 -08:00
Shikha Bakshi
89ce8c9600 qcacmn: DP Logging Enhancements
Add the below modules for Logging :

	QDF_MODULE_ID_DP_INIT
	QDF_MODULE_ID_DP_TX
	QDF_MODULE_ID_DP_TX_CAPTURE
	QDF_MODULE_ID_DP_RX
	QDF_MODULE_ID_DP_STATS
	QDF_MODULE_ID_DP_HTT
	QDF_MODULE_ID_DP_PEER
	QDF_MODULE_ID_DP_RX_ERROR
	QDF_MODULE_ID_DP_HTT_TX_STATS
	QDF_MODULE_ID_DP_RX_MON_STATUS
        QDF_MODULE_ID_DP_RX_MON_DEST
	QDF_MODULE_ID_DP_REO
	QDF_MODULE_ID_DP_TX_COMP
	QDF_MODULE_ID_DP_VDEV
	QDF_MODULE_ID_DP_CDP
	QDF_MODULE_ID_TSO
	QDF_MODULE_ID_ME
	QDF_MODULE_ID_QWRAP
	QDF_MODULE_ID_DBDC_REP
	QDF_MODULE_ID_EXT_AP

Change-Id: Id00e95bcc3720b6062326fa71f19a9698064c292
CRs-Fixed: 2827322
2020-12-18 09:36:34 -08:00
Shiva Krishna Pittala
bba4c15b50 qcacmn: Fix qdf_snprintf() wrapper
Current Linux version of qdf_snprintf() doesn't pass the additional
arguments(...) to snprintf(). As a result, the behavior is undefined.
Fix it by passing the additional arguments as a variable-argument-list to
vsnprintf().

Change-Id: Iea8ee0737907eaaea2df99631316d7d45a8e562f
CRs-Fixed: 2838962
2020-12-16 11:55:54 -08:00
Alan Chen
8a27ffb4ad qcacmn: Rate limit error logs from send_diag_netlink_data
Introduce proper logging APIs for diag module and also rate limit error
logs when skb allocation fails in low memory conditions to avoid excessive
logging side effects

Change-Id: Ia41ff7cfd526180825df61a43f1f59163947f257
CRs-Fixed: 2836681
2020-12-11 22:45:11 -08:00
Vivek
081f6f0549 qcacmn: Update timer modification API to return the status
The current timer modification API does not return the status
of the underlying OS specific API.

The return status of the underlying API could be useful
to detect if the timer was modified even before the timer
has expired before the last update to the timer.

Update the API to return the status of the underlying API.

CRs-Fixed: 2835319
Change-Id: Ieade0ff82386f959d7f29264a25b75a96a72e644
2020-12-11 07:25:45 -08:00
Vivek
3327a6a92b qcacmn: Add support for rate limiting QDF trace prints
The existing QDF implementation does the following
1. The QDF trace either prints to the console
2. The QDF trace message  is directed to the utils,
   which based on log level
	a. redirects to a user space daemon or
	b. redirects to console

There is excessive logging detection in the utils code
before redirecting the prints to  the console.
If the number of prints to console is more than
the configured threshold, we assert in development builds.

Moving the API for excessive logging detection from utils to
QDF trace.

The configuration for detection of excessive logging currently
is only for the number of prints per second.
Adding time configuration also to detection of excess logging
to the console.

CRs-Fixed: 2809752
Change-Id: Iecc408fc9b576fa900a6d7ee793639f1dde3110d
2020-12-02 10:45:34 -08:00
Nandha Kishore Easwaran
e04aeaeed8 qcacmn: Add cache invalidation for MIPS platforms
Add cache invalidation support for for MIPS platforms. The API
on mips platform takes start and size as input. Obtain size by
subtracting end and start.

Change-Id: Iaf2920b8fed2b2a2870682c6bf75c905cb8ca836
2020-12-02 06:33:58 -08:00
Sumedh Baikady
7a8d9d5da0 qcacmn: Change log level for packing radiotap in monitor mode
In monitor mode and other monitor mode features such as
smart monitor, in certain cases, Ex LM profiles there is not
enough headroom to fill radiotap. In this case frame is dropped.
The prints if error type floods and causes backpressure.
Hence change the print to debug only.

Change-Id: I7c0f786848237aaebba6f3282b9d82f0ef5d3f7b
2020-11-26 02:15:51 -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
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
3db73f1414 qcacmn: Add memory stats pertaining to DP usage
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.
Add and subtract the skb memory for Rx/Tx when
the map/unmap functions are invoked.

Change-Id: If62cc47bb60f7eb63f60e861f755f3417248677f
CRs-Fixed: 2724482
2020-11-18 16:23:49 -08:00
Debasis Das
d5b64eab69 qcacmn: Add wrappers to abtsract OS API's
Add wrapper API's to abstract various OS API's
related to network-device.

Change-Id: I0c8bc9091d32965a90025b9e7738ab6cfdc39d14
2020-11-03 06:23:36 -08:00
Jinwei Chen
56f94da675 qcacmn: Add reo destination indication info to skb
Get reo destination indication from REO2SW ring descriptor,
store it to qdf_nbuf_cb of skb.

Change-Id: I5a4c504b2550229a77a435b1f5ddb78c4abe51aa
CRs-Fixed: 2809080
2020-11-01 23:14:06 -08:00
Rajeev Kumar
c3f4e5678d qcacmn: Change QDF per packet proto log level to debug
QDF per packet proto logging is leading to excessive console
logging and hence change QDF per packet proto logging to
debug log level and avoid spamming precious kernel dmesg
log  buffer.

Change-Id: Iae562a8541c81e7708caa822a0ce293e7d6e47f3
CRs-Fixed: 2808600
2020-10-31 07:17:14 -07:00
Jianmin Zhu
6ce6be5c32 qcacmn: Add MACRO qdf_ceil
Add MACRO qdf_ceil(x, y) as DIV_ROUND_UP(x, y)

Change-Id: I92ecffbaf29c43809712e2b950a8064890e98136
CRs-Fixed: 2807611
2020-10-29 23:35:39 -07:00
Karthik Kantamneni
6ef375e0fb qcacmn: During qdf assert don't print generic failure information
During qdf assert generic failure information printed at last is misleading
failure reason, to avoid this don't print generic failure information.

Change-Id: I55359b2e41a3ee50de4e45e73183f2480c28a1eb
CRs-Fixed: 2789137
2020-10-13 02:06:05 -07:00
Ankit Kumar
a438cb3a4a qcacmn: Add out of boundary assert check
Add an assert check to __qdf_nbuf_add_rx_frag() to ensure
the number of fragments doesn't exceed the maximum number
of frags an skb can accommodate.

Change-Id: Idcfe8fdacaad581d7b2b0ce52fc7e8d757286ec8
CRs-Fixed: 2791955
2020-10-09 06:47:29 -07:00
Harsh Kumar Bijlani
e3907fda5d qcacmn: Account for frags attached to chained nbufs in frag_list
Page fragments can be attached to the chained nbufs present in the
frag_list of the parent nbuf. Update the debug entries for such fragments
in different scenarios.

Change-Id: Ib114ec43dcb6cbcd707552bcca19f1ac0d3c2a22
CRs-Fixed: 2791903
2020-10-09 00:06:51 -07:00
Guisen Yang
1f8975e467 qcacmn: Change ROME IPA pipe names
Change ROME IPA pipes from IPA_CLIENT_WLAN1_CONS and
IPA_CLIENT_WLAN1_PROD to IPA_CLIENT_WLAN3_CONS and
IPA_CLIENT_WLAN3_PROD. The MCC pipe is changed to
IPA_CLIENT_WLAN2_CONS

Change-Id: I329eadc28e5730f6e9f73325ba41d69102dc89c0
2020-10-07 15:16:28 -07:00
Ankit Kumar
45c8760063 qcacmn: Fix fraglist creation api to handle nr_frags
Handle skb fraglist creation if parent skb has nr_frags.

Currently it is being handled if parent skb has nr_frags
associated with it and results into acessing invalid skb
region.

e.g:
To understand example, consider below points:
1. Parent frag has 40 bytes of data(qdf_nbuf_data())
2. Assume each frag is of size 10 bytes.

 ----------------------------------------------------------
|Parent_SKB -----> 1st Fraglist SKB - Cons SKB chained     |
 ----------------------------------------------------------
| nbuf->Data    : 40B         |   Nbuf->Data: 0B           |
 ----------------------------------------------------------
| Nr Frags: 16                |   Nr Frags: 10             |
 ----------------------------------------------------------
| Data Len: 160B (16 * 10)    |   Data Len: 100B (10 * 10) |
 ----------------------------------------------------------
| Nbuf->len: 200B ( 40 + 160) |   Nbuf->len: 100B          |
 ----------------------------------------------------------

While creating fraglist,
Parent nbuf -> data_len will become 100 Bytes (Because of assignment '=').
Logically it should be (160B + 100B). '+='

This change incorporate above handling.

Change-Id: I9f63035aa44e6f85a803511cb19632178d3dc2e5
2020-10-07 12:49:00 -07:00
Vevek Venkatesan
5e487cc20a qcacmn: add support for DDR mapped IPA doorbell
Add support for DDR mapped IPA doorbell addresses.

Change-Id: I3a0d03ff4435ea12a6e07d4ae75012f2c85e32c9
CRs-Fixed: 2782267
2020-10-06 14:24:41 -07:00
Vevek Venkatesan
111e9faf76 Revert "qcacmn: Fix align issue for nbuf alloc"
This reverts Change-Id: I8eca9a085c0270f47318e64cefba686eac39a69a
That causes nbuf alloc size 64 bytes short of 2K, which leads
nbuf data to corrupt SKB shared info.

Change-Id: Iece451b4611c3fe9aaac00cc8aa7abbf79093b22
CRs-Fixed: 2779177
2020-09-22 12:15:49 -07:00
Jinwei Chen
d4da14a5ce qcacmn: Add 802.1Q/802.1AD support for DHCP/EAPOL/ARP data check
If the data ether header contains 802.1Q and 802.1AD tag,
current API to identify DHCP/ARP/EAPOL frame will not work properly,
for 802.1Q/802.1AD frame, there is extra 4 or 8 bytes in ether header.
Add 802.1Q and 802.1AD support for DHCP/EAPOL/ARP check.

Change-Id: Ibf00bd9e1497ba9700abca10d840104a73238f56
CRs-Fixed: 2771942
2020-09-22 07:59:28 -07:00
Jinwei Chen
21d6fd0ac6 qcacmn: add function for multi-pages memory zero operation
Add function qdf_mem_multi_pages_zero() to support multi-pages
memory zero operation.

Change-Id: I08b5c2722c02881550d3a1da27d5137c0957fd51
CRs-Fixed: 2776365
2020-09-21 01:33:12 -07:00
Saket Jha
91f3420b3d qcacmn: Always assert if TSO frag paddr is invalid
Always assert immediately in case of dma mapping error for TSO frags or
whenever paddr is set to 0. This will assert closer to the point of
failure in the future and point to the immediate operation causing this
behavior.

Change-Id: I8e3d58c1b4f18a8b7721b96686ea0ea4ff9c270b
CRs-Fixed: 2777588
2020-09-19 22:36:24 -07:00
Nisha Menon
aa434cb679 qcacmn: Add qdf api to return nbuf size from data to end ptr
Add api to qdf abstraction framework to return size of nbuf
from nbuf data pointer to end pointer.

Change-Id: I8a450306ddcaa7c6a85607425bc1c1fd26c4e1e4
CRs-Fixed: 2767763
2020-09-18 18:23:46 -07:00