Refactor flush rx queue function call based on soc by adding an
interface to CDP funtion indirection table.
Change-Id: I2d05acd023baf156c5b0752447d76d0e9e92ff53
CRs-fixed: 2023399
qcacld-2.0 to qcacld-3.0 propagation
With ATH_11AC_TXCOMPACT defined, host to target message send-completion
won't be called and messages are stored in htt_htc_pkt_misclist after
sending to HTC layer which will be freed upon htt_detach. This list
doesn't have a size limit and outgrow with more messages.
Add a fix to limit the size of this list which gives enough time for
firmware to process these messages before releasing it.
Change-Id: I6feb2d5700abe81a21dd93303163202616c739f5
CRs-Fixed: 902909
Some of the packets like configuration messages and ipa stat
messages to fw are added in htt misc list. If these packets
fail to be transmitted, they are added in endpoint tx queue as well.
When driver is unloaded, as these packets are present in misc list
as well as in endpoint tx queue, double free will happen and crash
will be observed.
Use magic pattern to distinguish the packets that are stored in
endpoint tx queue as well.
Change-Id: I5d327049d0a2a1598f55ef3ec8a5628f9a01ccee
CRs-Fixed: 2016412
Separate out pdev detach processing as ol_txrx_pdev_detach()
and ol_txrx_pdev_pre_detach() corresponding to pdev attach
functions ol_txrx_pdev_attach() and ol_txrx_pdev_post_attach()
respectively.
Change-Id: I7fdbe70ad8262a57b61a742fcfb2779e323172af
CRs-Fixed: 2010653
Automated code style checker detected multiple instance of "no space
before tabs," so fix those issues.
Change-Id: I93248e3cfafa047c4fa8c9553769f9457086d01a
CRs-Fixed: 2021507
Change the return type to QDF_STATUS of htt_tx_desc_init function
to handle dma map and other error condition.
Free the tx descriptor if this function returns error.
CRs-Fixed: 2021634
Change-Id: Ib9154de308154c43c202ad8a88ecdfff04be47a2
When a packet is generated internally, host adds a debug
node entry to the table and deletes the entry once received
tx completion for that packet by calling qdf_nbuf_free.
But when a packet is coming from network stack, host doesn’t
add any debug entry to the table and on receiving tx completion,
it calls qdf_nbuf_tx_free which will simply free the skb.
In case of P2P GO mode where packets are forwarded internally,
host creates a private copy of skb and add debug node entry in
the table. But when receiving a tx completion for the same packet
host calls qdf_nbuf_tx_free which will free the skb but will not
remove this node entry from the table. Currently, this api is common
for all data tx completion packets.
Add an extra flag in control block to differentiate whether skb is
generated by driver or come from network stack. If flag is true,
that means generated internally and need to remove the entry from
debug node table.
CRs-Fixed: 2021277
Change-Id: I07c12b5bf134a3e56d13005dbe03778781cdf176
qcacld-2.0 to qcacld-3.0 propagation
tx_msdu_info.peer should be reset to NULL for
each MSDU. Each MSDU will be classified by
ol_tx_classify to get peer.
Change-Id: I68fe619435a6edfdd82fa083ad9cb81251705ad5
CRs-Fixed: 1109984
qcacld-2.0 to qcacld-3.0 propagation
Add below four keys to allow user to tune WRR TX scheduler params.
Each key is mapping to one AC defined in data path module through
OL_TX_SCHED_WRR_ADV_CAT_CFG_SPEC.
gEnableTxSchedWrrBE
gEnableTxSchedWrrBK
gEnableTxSchedWrrVI
gEnableTxSchedWrrVO
Change-Id: I5c34b604297d83673ea065243cc58c3f2180ff3e
CRs-Fixed: 1020141
qcacld-2.0 to qcacld-3.0 propagation
After calling ol_tx_msdu_complete, it will reset the tx desc's pakcet
type to ol_tx_frm_freed state. So there might be a race condition
if there is another thread try to allocate this tx description between
these two operations.
The ol_tx_msdu_complete doesn't always free the tx_desc according to the
tx desc type. So need to reset the tx desc's packet type only when the
ol_tx_msdu_complete hasn't freed it.
Change-Id: I0d96ef60d10048c524e93209469e8cdf20ce22c6
CRs-Fixed: 1087688
qcacld-2.0 to qcacld-3.0 propagation
The ol_tx_desc_free might access the invalid content of vdev referred by tx
desc, since this vdev might be detached in another thread asynchronous.
Go through tx desc pool to set corresponding tx desc's vdev to NULL
when detach this vdev, and add vdev checking in the ol_tx_desc_free to
avoid crash.
Change-Id: I3afa63659e047bbbf008440335fb71c8295ca353
CRs-Fixed: 1087690
Avoid NULL pointer dereferencing of mpdu_buf by putting NULL
check before using it in htt_rx_restitch_mpdu_from_msdus func.
Change-Id: I726891d4fc1f6928cbda911932dbbcd2ec681b63
CRs-Fixed: 2008901
For HL target, CONFIG_HL_SUPPORT is enabled, which
cause sevaral compilation errors.
1. Couldn't find the definition of adf_xxx APIs.
Replace adf_xxx APIs with qdf_xxx APIs.
2. ol_tx_msdu_id_storage() return a wrong value,
implementation and definition mismatch.
Correct the return value to: pointer to tx desc_id.
3. Some of CONFIG_HL_SUPPORT/FEATURE_WLAN_TDLS feature
related code are not embraced by the macro properly.
Embrace the code with right macro for each feature.
Change-Id: Ibf09fd78f85327200dede8c32bc215208e54b798
CRs-Fixed: 2004340
De-reference tso list element in ol_tso_seg_list_init and
ol_tso_num_seg_list_init functions after NULL check.
Change-Id: I89581e5c57275804d967ab734d6bcc714b6745e4
CRs-Fixed: 2004503
Access to TSO stats related parameters are not protected by spinlock.
Due to this, race condition is happening in concurrency scenario where
processing of 2 packets is going on simultaneously and crash is happening
as we are writing in out of bound memory and then tries to access it.
Use spinlock and local variable store to avoid race condition.
Change-Id: I37413ab7ccf6bd5171815af0038401925aa7831b
CRs-Fixed: 1114150
pktlog deinit should not use cds_get_context.
Using cds_get_context for the txrx context was
causing the device to crash on the next insmod
because the deinit is happenning durring the deinitialization
of the txrx context after it has allready been unlinked from
as a global context.
Change-Id: I487951a6dd50680884223e7027e5bce1c8ddfa07
CRs-Fixed: 2004404
Use functions directly for cloning instead of a func. pointer as
qdf_nbuf_clone API has different signature when MEMORY_DEBUG is
enabled and when it is not.
Change-Id: I95fa6e7b2789dd97c0c500d0854210240feaac17
CRs-Fixed: 1114632
rx_buff_list_lock, hdd_roc_req_q_lock, lim_frame_register_lock.
Adding lock stats print upon spinlock & mutex destroy. Without
the destroy api invoked the lock stats are not printed.
Change-Id: I26cad72e3f55b9ff5f1383d617859ff2b30d74f7
CRs-Fixed: 1100552
Fix to avoid deinit of tso seg list and tso num seg list
during pdev detach if the lists are not initialized during
pdev post attach.
Currently, if htt_attach() fails as part of ol_txrx_post_pdev_attach(),
then it immediately returns from the function and not initializes
tso seg lists and during pdev_detach(), host tries to de-initialize
tso seg list and end up in a crash.
CRs-Fixed: 1113347
Change-Id: I91e077496a15a69edb9d41574f846bc3d1b73b31
Converged pdev_detach is responsible for freeing the context.
Legacy api needs to conform. Now the removal of the pdev from
the cds context needs to be done with the api that does not free
the context.
Change-Id: I4430a3bae1658e4e1accc457a572c67c9ce6f58f
CRs-Fixed: 2000089
Add support to unmap tso segment when host receives
ol_tx_comletion_handler for a particular tso segment.
Host unmap all the fragments of corresponding tso segment
except 0th fragment.
0th fragment of each tso segment now points to EIT header
which is common across all the segments. So 0th fragment cannot
be unmapped until host receives tx completion for last tso segment.
Also, now with introduction of tso, skb map-unmap is not required
anymore for tcp packets as host anyway does map-unmap of each
tso segment before sending it.
CRs-Fixed: 1106688
Change-Id: I572c7dcd2d29cb19b398e13e0fe7ce6f88ee1641
In case of intra-bss forwarding, tx-path consumes all the tx descriptors
and pause netif queues. As a result, there would be some left for stack
triggered packets such as ARP packets which leads to ref STA disconnection.
To avoid this, reserved a pool of descriptors(OL_TX_NON_FWD_RESERVE = 100)
for high priority packets such as ARP/EAPOL etc and drop the packets
to be forwarded in host itself.
CRs-Fixed: 1095203
Change-Id: I7d473118ef3d986f79aa5b7a47286235d7adcab4
After control path scheduler componentization CDS message queue
APIs are no longer used hence remove obsolete CDS mq APIs from CDS
module.
Change-Id: I7d83783d9fd126bb8b17a5c3292eac91c0966280
CRs-Fixed: 1114375
Race condiiton is observed as deregistration of 32 tx/rx packetdump
feature and packetdump callback call is happening at the same time
causing NULL pointer dereference.
Use local variable to store packetdump callback to avoid this race
condition.
Change-Id: Id4246d85e3816c0a3b8d0d0c1ef21e5ff053b608
CRs-Fixed: 1112126
Currently ol_txrx.c generates warnings when compiled with the GCC
-Wmissing-prototypes switch because it does not include a header file
which exports a prototype for the following functions:
ol_txrx_set_curchan()
ol_txrx_get_vdev_struct_mac_addr()
ol_txrx_get_pdev_from_vdev()
ol_txrx_print_level_set()
ol_txrx_fw_stats_cfg()
ol_txrx_aggr_cfg()
What is interesting about these functions is that they currently are
unused. An "issue report" has been opened for each of these functions
so that the proper disposition can be determined by the Data Path
team. As a WAR so that the -Wmissing-prototypes switch can be enabled
until such time as the issues are correctly resolved, enclose each
function in conditional compilation which will exclude the functions
from the build.
Change-Id: I6220c5ff2c6c3cd40ad33d13bc5c504c75c52018
CRs-Fixed: 1113082
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code in ol_txrx.c which is generating warnings
because not all public APIs have prototypes defined. Define the
missing prototypes for all public functions, and make static all
functions which are only referenced internally to ol_txrx.c.
Change-Id: I0acb51d0d9b5f76ef9754ab9cdc0b9fa8fa70097
CRs-Fixed: 1113061
Currently ol_txrx.c generates warnings when compiled with the GCC
-Wmissing-prototypes switch because it does not include a header file
which exports a prototype for ol_txrx_soc_attach(). Currently the "dp
soc attach" APIs are defined in a strange manner, and there is not a
prototype which dp_main.c can include. So as a WAR define the
prototype internal to ol_txrx.c itself.
Of course the whole point of -Wmissing-prototypes is to prevent
mismatches between callers of an interface and the implementation of
an interface, and this WAR explicitly bypasses that protection. This
WAR should be superceded in the future by a proper registration
mechanism where the architecture-specific DP implementation attaches
to the Converged Data Path (CDP).
Change-Id: I5d090a6cd54be7808ffb9f542c135edcfe9d0b42
CRs-Fixed: 1110919
Fix to add TSO magic cookie and freelist flag to last tso element during
ol_tso_seg_list_init() to avoid any crash during WIFI OFF.
CRs-Fixed: 1111760
Change-Id: I4504a7f4e9ecfe99337a4f544bc2d3cc8a8c3a27
Add a field in qdf_tso_seg_t. This cookie helps to check
double memory free or memory corruption case.
When double mem free hits, it will result into QDF_BUG.
Change-Id: I3c60f2603bce23b47224ae9a5d88881c2fbb8e01
CRs-Fixed: 1102423
API cds_flush_cache_rx_queue() is added as part of propagation
from qcacld-2.0. This function does not belong in CDS but
instead belongs in TXRX because corresponding function in
qcacld-2.0 is tl_shim_flush_cache_rx_queue() which is a datapath
function.
CRs-Fixed: 1106306
Change-Id: I6ca10fa9ebb7ad7cdc0b54ff7ed2cc0595b7d82d
qcacld-2.0 to qcacld-3.0 propagation
In certain situation, allocated Tx buffer count could be an arbitrary
number, so not power of two. This could violate F/W ring buffer count
requirement. If allocated Tx buffer count is not power of two, round
down it to the nearest power of two.
The same change is also applicable for INI parameters IpaUcTxBufCount
and IpaUcRxIndRingCount.
Change-Id: I7c119886a669c79adbc7bd9b2c1c1d93de41cf72
CRs-Fixed: 973723
Add null check while accessing pdev and hif pointers from cds_get_context
API in OL layer.
CRs-Fixed: 1096535
Change-Id: I2e3e7e04f1dcc9248fe173b7cdfc8d8704d0d1d9
Use a flag fw_create_pending flag to compensate for the extra
peer reference count only once for the first peer map event. It
will avoid duplicate compensation of ref count and untimely peer
delete.
CRs-Fixed: 1092503
Change-Id: I8b32290ad1bc4a834a3edb68e25b212eee2951c1
qcacld-2.0 to qcacld-3.0 propagation
In MDM ap+ap case, sometimes kernel issues two skb but has same mem
address of skb head and driver tx desc id is stored in skb head, so the
first id will be overwrote by the second one. Will hit crash when handle
the tx_desc.
The solution is storing tx desc id in sk_buff to avoid the case that two
skb has same tx desc id.
Change-Id: I2186a06ad3ec929683292c4c052904a18427cc64
CRs-Fixed: 951208
Modified the ol_txrx_soc_attach function definition to accept scn
handle parameter which is useful for making function calls
necessary for multi-radio support.
Change-Id: I842d2f184923f019e086f5c6d9b758624a20c8ae
Sometimes TXRX_PRINT is taking more time to process as
some other printks' are already in progress. As this TXRX_PRINT is
inside spinlock, so when some other core is also competing for
this spinlock, that core keeps iterating in a loop. After some
time spinlock bug is triggered as it is suspected that this core
is locked on this spinlock.
To fix this, move the TXRX_PRINT outside spinlock so that the other
core don't have to wait to acquire spinlock due to this TXRX_PRINT.
CRs-Fixed: 1107213
Change-Id: Ie6f8a7c8f9731883c2440641b8b9542f9d40c4a9
Include missing header file to fix the undefined API compilation
error and removed unused variable.
CRs-Fixed: 1107859
Change-Id: I4dcf1b0bb19662ba2c1f3af197ca34b656be7d9a
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code in ol_tx_queue.c which is generating warnings
because not all public APIs have prototypes defined. Define the
missing prototypes for:
ol_txrx_vdev_flush()
ol_txrx_vdev_pause()
ol_txrx_vdev_unpause()
ol_tx_throttle_set_level()
ol_tx_throttle_init_period()
In addition make the following private since they are now only called
internally to ol_tx_queue.c:
ol_tx_pdev_peer_bal_timer()
ol_tx_queue_log_alloc()
ol_tx_queue_display()
Change-Id: I4a3d767c650eefc39c3bf51ce102c8b5de391ec5
CRs-Fixed: 1104127
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code which is generating warnings because not all
public APIs have prototypes defined. Define the missing prototype for
ol_txrx_flow_control_cb().
Change-Id: Ifb7fff891b237e6202cc96afd3ab2e21bc4f13aa
CRs-Fixed: 1104126
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code in ol_tx.c which is generating warnings because
not all public APIs have prototypes defined. Define the missing
prototypes for:
ol_tx_send_ipa_data_frame()
ol_tx_non_std()
ol_txrx_mgmt_tx_cb_set()
ol_txrx_mgmt_send_ext()
In addition make the following private since they are now only called
internally to ol_tx.c:
ol_tx_non_std_ll()
ol_tx_non_std_hl()
Change-Id: I29f334de30ab492f2ef6c422352d11c059e40f1b
CRs-Fixed: 1104125
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code in ol_cfg.c which is generating warnings
because not all public APIs have prototypes defined. Define the
missing prototypes for the following:
ol_pdev_cfg_attach()
ol_set_cfg_rx_fwd_disabled()
ol_set_cfg_packet_log_enabled()
Change-Id: I787d4d7954751cda2878229d1d8967e1c168f95c
CRs-Fixed: 1104124
Currently the qcacld-3.0 driver does not build cleanly when compiled
with the gcc -Wmissing-prototypes switch. One set of warnings is due
to the QCA_COMPUTE_TX_DELAY APIs not being exported properly. Address
the warnings by properly exporting these functions.
Change-Id: Ib0f8a43a4575caf5714709e7fab659aa0b6f3009
CRs-Fixed: 1103659
Currently the qcacld-3.0 driver does not build cleanly when compiled
with the gcc -Wmissing-prototypes switch. One set of warnings is due
to ol_tx_set_flow_control_parameters() not being exported properly.
Address the warnings by properly exporting this function.
Change-Id: Iec79c1684c74312fa121349c1d7f721666bf904a
CRs-Fixed: 1103127