Add support to change the number of elements in multi pages
alloc function. This is needed to increase the number of tx_descs.
Change-Id: I29ee2764c24c6f83b0c2cff1062ec7239dcc0b4b
CRs-Fixed: 3130833
Memory allocation in atomic context is not correct, as for
MEMORY_DEBUG profile the initial_memory_debug flag is set to
0 which leads in allocating memory with GFP_KERNEL flag
Issue is seen with SDX_PINE where the memory allocation is done
in sleeping context using GFP_KERNEL in interrupt context
Fix is create a new memory allocation API with GFP_ATOMIC flag
Change-Id: I3baa5b601b60f88fe2d9ff1f4008703c6507a267
Define QDF API for virtual memory allocation and free.
Also add new api to get time of the day in microseconds.
Change-Id: I2921055bbb6b5d2a1105d19448b2a10fa2d6ccc5
CRs-Fixed: 3038180
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
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
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
Add function qdf_mem_multi_pages_zero() to support multi-pages
memory zero operation.
Change-Id: I08b5c2722c02881550d3a1da27d5137c0957fd51
CRs-Fixed: 2776365
Add logs in driver to log current memory footprint
in init functions. Add wlan_mem_stats to sysfs node
in both perf and defconfig builds.
The stats are included under MCL feature
DCONFIG_WLAN_SYSFS_MEM_STATS.
Change-Id: I79c6d418a5762cddf52ab3bc0b0c93993fa7fd84
CRs-Fixed: 2635192
Break up the 2MB descriptor bank memory allocations for WBM
idle link ring. Use multiple page allocation and populate the
WBM idle link descriptor ring with physical addresses of each
DMA page allocated in the descriptor bank.
This is to ensure that no requests for contiguous memory
allocations are made that might result in allocation failures.
For MCL set the page size to 4KB and leave it to max_alloc_size
cfg ini param for WIN specific code.
Change-Id: Iec30321044827c0174366cc02df25a42d38309e0
CRs-Fixed: 2565817
Disable the mem_debug when qdf argument mem_debug_disabled=1 is passed
through uci command "uci set wireless.qcawifi.mem_debug_disabled=1".
CRs-Fixed: 2572159
Change-Id: I6ab5e1f28ce4c58d46c7467bac3853054f4cf56c
Replace printk with qdf_nofl_info in qdf folder.
So if we wish to change from printing on console
to other location, based on a logging daemon, we
can do that by only changing at the implementation
of QDF print API's
Change-Id: I27fa7dbd6081c2869d1f1782f34cdd0bb5a02fb4
CRs-Fixed: 2442689
1. Alloc size should be passed as input and output parameter since we need
to pass the exact alloc_size while freeing the memory.
2. use qdf_align() to calculate the aligned physical address.
3. In DBR component, pass correct arguments to qdf_aligned_malloc() to fix
the compilation errors.
Alloc size should be passed as input and output parameter since we need
to pass the exact alloc_size while freeing the DMA memory.
Change-Id: I83051b8aa54bbf3bb663902d8f17f2c3c55e57bf
CRs-Fixed: 2462441
Under memory debug, qdf_mem_multi_pages_alloc function is getting
reported as the culprit of memory leaks when there is no associated
qdf_mem_multi_pages_free call. qdf_mem_multi_pages_alloc is
just an allocator function which uses qdf_mem_malloc internally to
serve the requested allocation and is not the actual source of the leak.
As there are multiple users of qdf_mem_multi_pages_alloc in the code base,
add memory debug versions of qdf_mem_multi_pages_alloc/free to track the
actual users of the allocations.
Change-Id: I8b2159de842a3c5d7f9cdb244ca148cf6df37d0d
CRs-Fixed: 2474749
Add support to configure any HAL SRNG descriptor to
be allocated from cached memory area. This is to
optimize of CPU cycles spent on uncached
memory accesses. Also added prefetch of cached
descriptors
Change-Id: I2544e8596d48e2f5549bf687a764c16d73397545
CRs-fixed: 2267945
Several qdf_*_outline() APIs exist which are straight aliases to their
regular qdf_*() counterparts. Remove them, and update any callers to use
the regular APIs instead.
Change-Id: Ibe6e9cced521b93061e89690ab817ceafe49a469
CRs-Fixed: 2408267
It has been observed at that several issues have crept into mainline due
to qdf_mem_copy() gracefully returning when the source or destination
pointers are NULL. In order to prevent such regressions in the future,
change calls to qdf_mem_copy/move/set/zero/cmp() with NULL pointer
parameters so they panic in debug builds.
Change-Id: I6df4c42245ed1d0d8a85477f59552f8243488924
CRs-Fixed: 2408266
Add APIs for t(ree) alloc(ated) memory management.
These APIs allocate memory like malloc, but track those allocations via
a parent-child relationship, or tree. If the parent is freed while it
still has children, a panic will be triggered. This effectively gives
you the ability to limit the lifetime of an allocation by ensuring the
child allocation lifetime will be strictly less than the parent
allocation lifetime.
Change-Id: I6308c96061e125b2e5a9c424ec2d2298c1c503ab
CRs-Fixed: 2359469
qdf_mem_shared_mem_alloc invokes qdf_mem_dma_get_sgtable which will alloc
memory.
This memory should be free in qdf_mem_shared_mem_free by sg_free_table.
Change-Id: I3ad4bd2ff7a80d4051f15dcb04e0265707c2712d
CRs-Fixed: 2131270
Define qdf_aligned_mem_alloc_consistent() and qdf_aligned_malloc() which
allocates the memory and checks if allocated base address is aligned with
ring_base_align. If not, it frees the memory and re-allocates by adding
7 bytes to alloc_size and returns aligned address to the caller.
Change-Id: I412153c20e4e4566450b006356fe78d98f1fd3f0
Acked-by: Shashikala Prabhu <pshashik@codeaurora.org>
CRs-Fixed: 2336697
In qdf_mem_malloc() and qdf_mem_malloc_atomic(), pass function
name and line number, and log the same in case of failure, this
approach helps to remove error logs in caller function there by
reducing text segment.
Change-Id: Ia4586b112c6dd64aca5b397b43bb17499a0e6e30
CRs-Fixed: 2281983
Assign DMA address correctly to all scatterlist elements of scatter
gather table in qdf_mem_shared_mem_alloc() func.
Change-Id: I07988d0bc35e3e0fcf7b9f6df02a9e56a0e8b083
CRS-Fixed: 2110715
As WIN has multiple modules and QDF is the last one to be unloaded,
QDF is crashing when it tried to print the file name of an nbuf
allocated by other modules. To fix this, copy the file name in the
QDF nbuf tracker, rather than using the pointer to file name,
to avoid access to the invalid pointer.
CRs-Fixed: 2258770
Change-Id: I27ee76e58b0f5a976840783cfeba451784de85dd
In low memory environments using GFP_KERNEL flag may cause
scheduler thread to sleep. Scheduler thread callback handlers
are expected to be atomic in nature to ensure timely execution
of different commands. Move all allocations done by scan module
in scheduler thread context to atomic allocation.
Change-Id: Iee3eafbc00a3afea0687ba67b3041ec0816094cc
CRs-Fixed: 2232553
Add QDF APIs for DMA buffer allocation and sharing with SMMU
Stage 1 translation support. When SMMU Stage 1 is enabled,
DMA APIs return IO virtual address(IOVA) instead of physical
address. This IOVA needs to be mapped to physical address by
external module before accessing these buffers.
Change-Id: I88e938d8ebe1f32fdea79e3c3aa8a3638ddfd2b8
CRS-Fixed: 2072953
In order to migrate existing qdf_str_* APIs to qdf_str.h from
qdf_mem.h, qdf_mem.h included qdf_str.h. Now that consumers are
including qdf_str.h directly, remove this include.
Change-Id: I6b0ee3a4a2ad17db922b8e19087c1d730ad9b419
CRs-Fixed: 2196132
A set of files for string abstractions has recently been added to QDF.
Move any existing qdf_str_* APIs from qdf_mem to qdf_str.
Change-Id: I6e1e5d1edcdfae2af83a6497ebd872fba981cdec
CRs-Fixed: 2196098
strcmp() is regularly used to compare two strings for equality. However,
reading source code using strcmp in this manner can be prone to errors
because the return values are not obvious from the function's name. In
the best case, this leads to referring to the strcmp documentation more
often than one would like. In the worst case, this leads to difficult to
spot bugs. Add a thin wrapper for this use case to make intentions
abundantly clear to future readers. This wrapper is effectively sugar
for 'strcmp(left, right) == 0'.
For example:
if (!strcmp(left, right))
/* reads: if not string compare: left, right */
Becomes:
if (qdf_str_eq(left, right))
/* reads: if string equal: left, right */
Change-Id: Iabcb7c7e9f37dcb6cf1bdf5d7cc6c69ea926ba5c
CRs-Fixed: 2194508
Currently, the detected memory leaks would not dump
the caller of the function which is leaking the memory.
Add an extra parameter to the table to store the caller
address and print the function during an assert.
Change-Id: I6dc31b55fd4e78dc69df9eb6166ebb63086891c1
CRs-Fixed: 2177486
Add debug support to detect memory leaks and corruption
in DMA memory operations.
Change-Id: I1478973828ddc147367c4a579c97c3840c106f44
CRs-Fixed: 2155603
When memory debugging is enabled, qdf_mem_malloc and qdf_mem_free do a
number of memory corruption checks. Extract these checks into their own
functions to allow other memory allocation/free logic to leverage the
same logic.
Change-Id: I07802093119c90b3d8c40a50d5b4bb152cb8243f
CRs-Fixed: 2136659
In order to support memory leak detection during a specific period of
time, add APIs to allow setting the current memory domain. Each
allocation is tracked against the current memory domain at the time of
allocation. Consumers can then check to ensure the memory domain is
empty before each transition to a different domain.
Change-Id: I3a8d18ea0700122a2425eacb6051c6188b9aa5d6
CRs-Fixed: 2113614
Add platform CACHE_LINE_SZ so that it can be used to roundup the data
structures.
Change-Id: Iec45f5747956d0797411f76c2fec1368a13e7d6d
CRs-Fixed: 2046852
Add memory allocation statistics for perf builds where MEMORY_DEBUG is
not enabled. Part of this effort, re-structure some of the QDF memory
APIs. Memory stats shows real size allocated.
Change-Id: I1e8fe0f4080ea186b8bfa0ce0438b4a06dde5a66
CRs-Fixed: 2045476
Use normal allocation instead of alloc_consistent for REO descriptors to
allow freeing from interrupt context.
Also fixed an issue in ba_window_size setting in REO queues.
Change-Id: I91b06e04c0343eb7fe8580d8655c6bc5e33cfe06
Remove qdf print from QDF_TRACE
Change physical address type to qdf_dma_addr_t
Add qdf API to get min of two numbers
Change-Id: Ie4e0a98d603e56e1bdaf3b8b7c099c7dad5b1bac
CRs-Fixed: 2016072
Comment in the api specifies that qdf_mem_cmp api
return bool value which is not correct.
Replace bool to int to reflect the correct return
type of a qdf_mem_cmp api.
Change-Id: Iff83fbf588a072dcda8b0aaef3c6743e572b1ac5
CRs-Fixed: 1066946
Do following cleanup on fastpath code changes:
1) Do not reap off Tx HIF buffers in Rx handling, instead handle
reaping in Tx fastpath itself.
2) In ce_per_engine_service_fast check for more Rx packets after
packet processing.
3) Make stub functions as static inline for non-fastpath enabled case.
Change-Id: If07c4344a424ce13b94128bf28931a24255b661a
CRs-Fixed: 987182