Commit Graph

216 Commits

Author SHA1 Message Date
Himanshu Agarwal
8e89ce70f0 qcacld-3.0: Record ol rx indication events
Record ol rx indication events in a global ol rx indication record
buffer to have history of msdus received, no. of buffers replenished,
etc. in rx indication messages.

Change-Id: I96cf27a209c81208c6f6566b5e57116b2cf233e8
CRs-Fixed: 2012485
2017-06-01 07:21:48 -07:00
Dhanashri Atre
1a6a4ce139 qcacld-3.0: Modify legacy LRO implementation to use QDF
Modify the legacy LRO implementation which is in HDD to
use the implementation in QDF instead. This is to avoid
code duplication and to unify the LRO implementations for
Napier and Helium.

Change-Id: Ie9d3bb6d3dcda5a7d1d5fda6e7cbdef92be30461
CRs-Fixed: 2042812
2017-05-26 16:11:27 -07:00
Manjunathappa Prakash
bab70f024f qcacld-3.0: Reduce failure log level of OL_TX_SEND
Reduce the excessive failure logging of OL_TX_SEND. Make it as debug log
so that it will not hog the console. OL layer tx flow control stats will
catch the dropped packets.

Change-Id: I57feee9b4eeb7bf6c6c0c239c2a30041936fa758
CRs-Fixed: 2047953
2017-05-19 14:50:38 -07:00
Yun Park
ff5da56d07 qcacld-3.0: Return false when vdev and pool is NULL in fwd_thresh_check
vdev and pool could be NULL during processing the forwarding packets
processed during the driver deinit.
Add a code to return false if pool is NULL in ol_txrx_fwd_desc_thresh_
check(), then the caller will discard the packet without any further
processing.
Also return false when vdev is NULL.

Change-Id: I45afcbe0e8b953bd1be7b3f1f5315f35879edec5
CRs-Fixed: 1112619
2017-05-01 13:06:39 -07:00
Orhan K AKYILDIZ
e062f35889 qcacld-3.0: Add debug for TSO seg double-free
Add TSO segment debug code, in a featurized way, so that
when disabled it will tolerate redundant returns to the internal
pool and when enabled will check sanity on free, and record a
history of last 16 actions on the segment in the object.

Goes with the corresponding cmn component counterpart.

Change-Id: Ifab52fc2032da4d53b708b3c6716d5270c0690c1
CRs-Fixed: 2031485
2017-04-28 13:19:47 -07:00
Poddar, Siddarth
39ba8e0481 qcacld-3.0: Fix memory leaks of TSO num segments
Fix memory leaks of TSO num segments by freeing remaining
TSO num segments in ol_tx_ll_fast and ol_tx_ll if somehow
allocated tx desc is NULL.

Change-Id: I577a95b784c776633cf685cd16b101755a48c521
CRs-Fixed: 2014587
2017-04-28 02:54:36 -07:00
Himanshu Agarwal
bda5f28213 qcacld-3.0: Adding vdev id based sanity check for tx desc
Adding vdev id based sanity check while checking if tx desc
is already freed or not in ol_tx_free_descs_inuse().

Change-Id: Icfc66ccac6829f922a76c35a3309094f374fd022
CRs-Fixed: 2035470
2017-04-26 23:53:52 -07:00
Manjunathappa Prakash
102562da74 qcacld-3.0: No need to hold flow_pool_lock in vdev pool_map_handler
ol_tx_flow_pool_map_handler() need not hold the lock to call pause_cb.
pause_map_lock will takecare of any contention between pause and unpause.

Change-Id: I1adcfc156db55946d3a647269ecc2c09ea7981ce
CRs-Fixed: 2037277
2017-04-25 10:20:53 -07:00
Orhan K AKYILDIZ
fdd74de850 qcacld-3.0: Debug enhancements for rx_buffer history
Add the following:
- Global cumulative counters for posted and received.
- CPU for each individual records
- Counters for refill timer starts
- iwpriv support (dumpStats 10) to dump the counters

CRs-Fixed: 2001331
Change-Id: I66a8a818ffa0b2522358bab404c92a3cdaa603f7
2017-04-21 18:48:26 -07:00
Orhan K AKYILDIZ
adf0610a93 qcacld-3.0: Fix rx_starvation on multiple-rx case
In case of parallel rx execution, fill_count was being updated
by multiple threads and this was causing fill_count to be incorrect
in parallel rx execution cases. This was causing rx ring to be under
filled and in time was causing rx starvation (data stall).

Fix this by:
- making sure that we always fill the right number of buffers based
  on the msdu_count in the in_order_indication message.
- making sure that only one execution thread fills the ring
- making sure that the lock holder (filling the ring) does not
  run too long by introducing a max fill limit, in which case the
  filler will give up and the contender (the other rx execution
  thread) takes the lock and fills the ring itself.

CRs-Fixed: 1103851

Change-Id: I59ee2903d51877afc112a1a76b7a5529f1c6a5c0
2017-04-21 18:48:24 -07:00
Orhan K AKYILDIZ
0278cd0977 qcacld-3.0: Change peer ref count accounting
Make sure that peer is deleted at every path where
the ref-count is decremented and it reaches zero.

Change-Id: Ibaaae1e66855ebbd285b3647f9b862e823b6f335
CRs-Fixed: 1094439
2017-04-21 18:48:20 -07:00
Yun Park
f01f6e2a49 qcacld-3.0: Correct return value when ol_txrx_pdev_post_attach fails
When ol_txrx_pdev_post_attach fails, the return values are not
correctly set, and this could cause several issues.
Fix to assign return values correcly.

Change-Id: I43fb97bbdb10e019e02bf289f5b4995461eb75db
CRs-Fixed: 1113222
2017-04-18 10:55:02 -07:00
Venkata Sharath Chandra Manchala
0c2eece03b qcacld-3.0: Fix the memory leak for soc handle
Free the allocated memory for soc handle
in ol_txrx_soc_detach

Change-Id: I023cb6a17cecf95f981956cd355fb57ec630db49
CRs-Fixed: 2017582
2017-04-14 16:32:25 -07:00
Himanshu Agarwal
53298d1fd7 qcacld-3.0: Add support to add memory tracking in tx path
Add support to add memory tracking in tx path in WLAN driver using
already present infrastructure for memory tracking.

Change-Id: I6a2c9890e0af1fd51c4e2dfcded68f0075a3a4ef
CRs-Fixed: 2025668
2017-04-13 17:53:11 -07:00
Himanshu Agarwal
865201d99d qcacld-3.0: Do netif_tx_stop_all_queues() instead of netif_tx_disable()
Race condition is happening when tx traffic is running and simulataneously
suspend is going on. hdd_hard_start_xmit() is called under txq->__xmit_lock
and in case of low descriptor scenario, it goes to pause the netif queues
and trying to take adapter->pause_map_lock for doing so which is already
acquired by another thread. In another thread, suspend indication is being
preocessed and as a result is trying to pause netif queues with
netif_action WLAN_NETIF_TX_DISABLE which takes adapter->pause_map_lock and
then calls netif_tx_disable() which is trying to take txq->__xmit_lock
already taken by the thread executing hdd_hard_start_xmit(). This leads to
a deadlock situation.

Replace netif_tx_disable() with netif_tx_stop_all_queues() as
netif_tx_stop_all_queues() is doing the same thing as netif_tx_disable()
only without taking the txq->__xmit_lock which prevents this deadlock.

Change-Id: I5afafe6435707bd8f0e87972a740f908d06ce847
CRs-Fixed: 2030933
2017-04-13 17:53:09 -07:00
Yun Park
637d6486f2 qcacld-3.0: Add interface to WDI-stats and quota limit
Add structure changes for querying WDI-stats, register the callback
functions for IPA to query WDI stats and sets the quota limit

Change-Id: I05d9d50fad735fa0a57c4de23c81461f6e12b648
CRs-Fixed: 1095710
2017-04-12 19:02:07 -07:00
Himanshu Agarwal
0e90a7bcc7 qcacld-3.0: Fix memory leaks of TSO segments and corresponding nbufs
Fix memory leaks of TSO segments and corresponding nbufs by:
1) Freeing TSO segments if qdf_nbuf_get_tso_info returns failure.
2) Freeing remaining TSO segments in ol_tx_ll_fast and ol_tx_ll if
   somehow allocated tx desc. is NULL.

Change-Id: I69d5b3fedde6e78ca49ef26ed8c0654a08a4b6db
CRs-Fixed: 2023657
2017-04-12 18:41:43 +05:30
Manjunathappa Prakash
8623d30b4f qcacld-3.0: Do not free skb in OL if ce_send_fast failed
Return failure if ce_send_fast fails and let caller, HDD free the Tx msdu.
If it happens to be TSO segment then free the to be trasmited TSO segments.

Change-Id: If3a16ca841e63e7941fe732013d3b3c351a4a286
CRs-Fixed: 2004780
2017-04-11 12:40:08 -07:00
Himanshu Agarwal
7d367c124d qcacld-3.0: Add ref_cnt implementation for flow pool
Add ref_cnt implementation for flow pool to synchronize
usage and deletion of flow pool.

Change-Id: Idb52c74df6a771b776e3df6bf4aea5c150b5fc7a
CRs-Fixed: 2025757
2017-04-10 16:29:26 +05:30
Poddar, Siddarth
31b9b8b741 qcacld-3.0: [HDD/TXRX] Reduce the log spam in kmsg
Move the logs to appropriate log levels to avoid excessive
logging in kmsg.

CRs-Fixed: 2029891
Change-Id: I782eadeb8c27f89ec635850201755720f068e955
2017-04-10 03:27:11 -07:00
Poddar, Siddarth
1452179368 qcacld-3.0: TXRX: Reduce the log spam in Kmsg
Introduce different ol_trxrx print apis based on log levels.
Move the logs to appropriate log levels to reduce
the log spam in kmsg.

CRs-Fixed: 2019261
Change-Id: I14dfedb1a71b10043571112f05965935dd91a90e
2017-04-10 02:11:57 -07:00
Houston Hoffman
91e7613911 qcacld-3.0: Avoid dereferencing null tx_desc in ol_tx_ll_fast
In one version of ol_tx_ll_fast a null tx_desc will be dereferenced.
ol_tx_desc_vdev_update is called when tx_desc is guaranteed to not
be null. Move the vdev_id assignment into ol_tx_desc_vdev_update
to simplify the code and fix the null pointer dereference.

Change-Id: I01b2e81ee3f19cdf3f2f74ccc575df767891f472
CRs-Fixed: 2020708
2017-04-09 13:08:49 -07:00
Venkata Sharath Chandra Manchala
71032b649b qcacld-3.0: Fix for supporting dump statistics
1. Avoid breaking compilation on legacy code
2. Rename dump stats macro options to CDP macros
   appropriately

Change-Id: If8594fad2145f29cb8f8f9f6bc3cd34633d0e9a4
CRs-Fixed: 2023386
2017-04-07 19:52:34 -07:00
Manjunathappa Prakash
adb7023ad7 qcacld-3.0: reduce logging level in ol_rx_pkt_dump_call()
Reduce the logging level to info so to reduce the spamming of kmsg and
avoid watchdog bite due to this.

Change-Id: I26ef04f7a82fc2e2a59da67a28dba2cf152ca251
CRs-Fixed: 2024738
2017-04-07 19:11:53 -07:00
Srinivas Girigowda
b8ecec2fb3 qcacld-3.0: TXRX: Reduce the log spam in kmsg
Move the logs to appropriate log levels to reduce
the log spam in kmsg.

Change-Id: Ic22302a2f042f693d4bcc1f0efe647d580be33ed
CRs-Fixed: 2014745
2017-04-07 06:37:37 -07:00
Mohit Khanna
f9f659735a qcacld-3.0: Fix TSO seg cookie init crash
In one of the recent fixes, we are setting the TSO seg contents to zero
when the segment is added back to the free list. The segment cookie is
not re-initalized at this point. Hence, when this segment is
re-allocated, it fails the cookie check and there is a system crash.

Fix the issue by reinitializing the segment cookie after zero-ing out
its contents.

Change-Id: I7947e3ce4f80f1b19ebf5ef73ff75dee19ec7364
CRs-Fixed: 2011786
2017-04-07 02:35:47 -07:00
Mohit Khanna
c3b069bca5 qcacld-3.0: Debug logs to detect TSO seg double free
On stability test bed a double free of TSO segment is reported via the
TX completion path. Made following changes -
 - Check for duplicate TX completions before freeing TSO segments.
 - Add debug logs to check if TX descriptors are being freed from the
   control path.

Change-Id: I30178de90cd0161001ded70adc26066adc9cbcb3
CRs-Fixed: 2006868
2017-04-07 02:35:45 -07:00
Mohit Khanna
3e2115b6e2 qcacld-3.0: Add NAPI statistics to dumpstats
Currently NAPI stats are retrieved as a part of iwpriv getStats command.
The buffer available for this command is limited and NAPI stats get
truncated.

Add a new dumpStats parameter (9) to dump NAPI stats.
The following command will dump NAPI Stats into kmsg.
>iwpriv wlan0 dumpStats 9

Cleanup existing getStats

Change-Id: I0d804295d96a495b4afa576c8258f08c9c2b9bbb
CRs-Fixed: 1076563
2017-04-07 02:35:31 -07:00
Houston Hoffman
02d1e8e7ce qcacld-3.0: update dump_tx_desc
The dump_tx_desc function is called to report the number of freed and used
tx descriptors when a suspend is rejected by data path.  The debug code
was directly referencing a data field whereas the code to check the freed
and used descriptors used a function that reports a different number under
certain compilation flags.  Use the function in the debug statement such that
the value checked is the value printed.

Change-Id: Iad3f519dc88319c7a421f77376dd43e15e6eaf09
CRs-Fixed: 1113880
2017-04-04 21:38:42 -07:00
Himanshu Agarwal
d6f3c5a3be qcacld-3.0: Sync pool status with netif queue status
When flow pool is created, pool status is set to FLOW_POOL_ACTIVE_UNPAUSED
irrespective of whether netif queues are paused or not.
Also, when descriptors are transferred from invalid pool to deficient pool,
pool status is not checked. So, if deficient pool is paused, then even
after receiving required descriptors from invalid pool, its status and
netif queues will still remain paused due to which traffic will not be able
to resume ever.

Sync pool status with netif queue status by:
1) Unpausing netif queues as well when pool is created.
2) If deficient pool is paused and on receiving descriptors from invalid
   pool, no. of descriptors goes beyond start threshold, unpause the
   queues and set the pool status to FLOW_POOL_ACTIVE_UNPAUSED.

Change-Id: I69390e40130892d218372e4a8a0ab4b0c7b94b7e
CRs-Fixed: 2025759
2017-04-04 00:35:05 -07:00
Tushnim Bhattacharyya
12b4874f33 qcacld-3.0: Replace policy manager header file included in data path
Replace policy manager header file include as part of policy manager
moving to host common.

Change-Id: Ie1f9d6675cc373c3325c9e76514f48299932cdda
CRs-Fixed: 2009818
2017-03-30 16:26:36 -07:00
Himanshu Agarwal
f8f43a7956 qcacld-3.0: Free memory and destroy spinlock in failure cond
Free memory allocated in ol_tx_desc_dup_detect_init() and spinlock
created in ol_txrx_pdev_post_attach() in case of failure condiiton.

Change-Id: I7e3909622e5b63af2d20c2c8cc0a8cc4350e4085
CRs-Fixed: 2024377
2017-03-28 13:01:11 -07:00
Manikandan Mohan
8b4e201376 qcacld-3.0: Setup CDP interface for flushing RX queue
Refactor flush rx queue function call based on soc by adding an
interface to CDP funtion indirection table.

Change-Id: I2d05acd023baf156c5b0752447d76d0e9e92ff53
CRs-fixed: 2023399
2017-03-24 19:01:18 -07:00
Himanshu Agarwal
0b9bbc3533 qcacld-3.0: Separate pdev detach processing as per pdev attach
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
2017-03-24 00:57:37 -07:00
Jeff Johnson
560dc56d97 qcacld-3.0: Fix "no space before tabs" style errors
Automated code style checker detected multiple instance of "no space
before tabs," so fix those issues.

Change-Id: I93248e3cfafa047c4fa8c9553769f9457086d01a
CRs-Fixed: 2021507
2017-03-23 17:00:48 -07:00
Poddar, Siddarth
28014e9769 qcacld-3.0: Handle error condition when dma map fail
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
2017-03-20 07:47:44 -07:00
Poddar, Siddarth
d6b2fd232e qcacld-3.0: Add a flag in skb->cb for packet tracking
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
2017-03-20 02:47:43 -07:00
Abhishek Singh
cfb4448302 qcacld-3.0: Fix compile errors when WLAN_FEATURE_11W is disabled
Fix compilation errors when WLAN_FEATURE_11W is disabled.

Change-Id: I5bed89f0077a51117c57e176568f849293d40ee5
CRs-Fixed: 2019223
2017-03-17 04:59:16 -07:00
Liangwei Dong
35bded49b3 qcacld-3.0: Fix peer invalid free issue
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
2017-03-13 00:37:04 -07:00
gbian
62edd7e2db qcacld-3.0: Add ini keys for WRR tx scheduler tuning
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
2017-03-08 15:54:49 -08:00
Himanshu Agarwal
18d6b8c19b qcacld-3.0: Replace HELIUMPLUS_PADDR64 with HELIUMPLUS
Replace HELIUMPLUS_PADDR64 preprocessor macro with already
existing preprocessor macro HELIUMPLUS.

Change-Id: I4f109fc939e12323565bc05c89cc51dff3f3a7f3
CRs-Fixed: 2006551
2017-03-05 21:26:23 -08:00
gbian
1bd297c7d7 qcacld-3.0: Reset tx desc type after calling msdu complete conditionally
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
2017-03-04 09:45:55 -08:00
gbian
016a42e2c7 qcacld-3.0: Add vdev checking in the ol_tx_desc_free to avoid crash
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
2017-03-02 17:52:32 -08:00
Venkata Sharath Chandra Manchala
0d44d455fa qcacld-3.0: Handle void pointer declarations for pdev and vdev
Replace void pointer handles for pdev and vdev
with abstract structure handles

Change-Id: Idd9a2521249e30faf1143f671c4d2d924fe231e8
CRs-Fixed: 1109835
2017-02-15 12:26:46 -08:00
yeshwanth sriram guntuka
e83d8ff653 qcacld-3.0: Remove redundant kernel log messages
Remove redundant kernel log messages by changing
print level to INFO

Change-Id: Ia622b9da737318e13bf08ae400656827f735b57b
CRs-Fixed: 2002041
2017-02-14 22:55:36 -08:00
Yu Wang
053d3e7009 qcacld-3.0: fix compilation errors for HL target
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
2017-02-14 16:28:14 -08:00
Poddar, Siddarth
b0844bbd5e qcacld-3.0: De-reference tso list element after NULL check
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
2017-02-14 01:16:33 -08:00
Himanshu Agarwal
5501c19153 qcacld-3.0: Use spinlock and local variable store to avoid race condition
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
2017-02-14 00:22:28 -08:00
Houston Hoffman
8c48504b55 qcacld-3.0: Pass txrx context durring pktlog deinit
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
2017-02-10 18:10:42 -08:00
Poddar, Siddarth
b1200e37af qcacld-3.0: Avoid deinit of TSO Seg lists if not initialized during pdev attach
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
2017-01-31 01:28:21 -08:00