Commit Graph

2311 Commits

Author SHA1 Message Date
Yu Tian
434c3f1532 qcacmn: Add a force TX ring HP flush when TX is pending
There is a timing race condition between RTPM suspend flow and
DP TX flow. When TX is queued during RTPM suspend flow. TX
ring update may be delayed. Add a force TX HP flush when RTPM
is rejected due to TX pending frame. This can help to improve
TX pending frames delay when race condition happens.

Change-Id: I6f60f2902dfda630f81528dcf978da6644d18ba7
CRs-Fixed: 2942744
2021-05-18 21:30:19 -07:00
sandhu
9dc81d7965 qcacmn: Add HTT HTC tx completion based packet free
Add CE4 tx completion for htt htc packets. current logic
uses htt htc misc list to free packets.

Change-Id: Iea15d0dba544d3cc7581b11aa7ab7e5c0024133a
CRs-Fixed: 2630768
2021-05-17 18:56:02 -07:00
Manikanta Pubbisetty
273504da32 qcacmn: add TX packet threshold for DP SWLM
Add TX packet threshold while considering for TX write
coalescing. This helps improve low throughput TCP DL &
UL cases.

Change-Id: Ida2585b2473c9af4e898bde34e9b8cd35f0bdf51
CRs-Fixed: 2946896
2021-05-17 13:04:15 -07:00
Tiger Yu
183db750e3 qcacmn: Use qdf_assert_always instead of qdf_assert when rx_desc NULL
Use the qdf_assert_always instead of qdf_assert when rx_desc is NULL
getting by dp_rx_cookie_2_va_mon_status to capture real problem here
since the qdf_assert does not do anything.

Change-Id: I480917ecaf30f9faa4fdcda93c09a59e972a7e1c
CRs-Fixed: 2944083
2021-05-17 13:04:11 -07:00
Amir Patel
f3c74a6bc4 qcacmn: Memset struct cdp_rx_indication_ppdu to zero
To avoid reading junk values, memset struct cdp_rx_indication_ppdu to zero.

Change-Id: I9216eb0bbf2f0befbcd67d2a5d400e70ed058851
CRs-Fixed: 2940690
2021-05-17 03:10:37 -07:00
Yu Tian
73de559075 qcacmn: avoid of HTC buffer double free in HTC send failure case
HTC buffer is freed in enqueue failure case. Then it is requeued to
htt_htc_pkt_misclist also. In deinit flow, misclist entry should be
cleared, so buffer double free is hit in this stage. Make a change
to not requeue this frame to misclist.

Change-Id: I0211c4b548d7df7176ee72a83e21f8fcf7fa464c
CRs-Fixed: 2942972
2021-05-16 22:47:56 -07:00
Varsha Mishra
01c0c273d1 qcacmn: Drop fragmented multicast/broadcast frames
CVE-2020-26145
Broadcast and multicast frames should never be fragmented. Several devices
process broadcasted fragments as normal unfragmented frames. Moreover, some
devices accept plaintext fragmented broadcast or multicast frames in
protected Wi-Fi networks. An adversary can abuse this to inject packets
by encapsulating them in a fragmented plaintext broadcast frame. Even
unicast packets can be encapsulated in broadcast Wi-Fi frames and hence
be injected.

Change-Id: I3181a05e177cf9374a14edb748bc5001d058e0f3
CRs-Fixed: 2893212
2021-05-13 15:32:23 -07:00
Varsha Mishra
6c720adf28 qcacmn: Enable peer authorize by default
Drop non-EAPOL frames from unauthorized peer in security mode.
Enabling this feature by default with this change.

Change-Id: I9878b37088149e34f456a38a9c0f722e4c5ee49a
CRs-Fixed: 2943789
2021-05-13 15:32:16 -07:00
Nandha Kishore Easwaran
718d6aeece qcacmn: Add configurable option for MSI interrupts
Provide multiple combinations to configure the msi interrupts
of DP and CE based on the number of MSIs available in the platform.
Number of MSIs used for CE and DP can be changed by modifying the
MSI assignment table in platform driver. Best possible mask for that
MSI is automatically chosen based on predetermined settings.

Change-Id: I02b44fb033631d69d97f2d8d2d3f698541d37aad
2021-05-13 12:33:04 -07:00
Manikanta Pubbisetty
2359af8cea qcacmn: defer reo queue descriptor free
In some RX backpressure cases, we see the HW accessing REO
queue descriptors of a deleted peer(after the queue descriptors
are unmapped/freed), this is leading to SMMU faults. There are
cases where the HW is accessing the stale REO queue descriptors
after ~12seconds after the queue descriptors were freed.

In order to avoid the problem, HW team has suggested to defer
unmapping/free of REO Queue descriptors. Add the logic for the
same.

Change-Id: I5b1fb966dc75b963ccc9d22c40272c8d1d8d6026
CRs-Fixed: 2939223
2021-05-13 12:32:59 -07:00
Jianmin Zhu
2c9dd68894 qcacmn: Fix smmu fault for IPA TX buffer unmapped
It's regression of change: qcacmn: Fix smmu fault for tx buffer unmapped.
Only 1 tx buffer is smmu mapped for IPA with it.
During STA-SAP tethering, when IPA access 2nd tx buffer, smmu fault
happens.

Remove qdf_assert_always since it already exists in
__dp_ipa_handle_buf_smmu_mapping.

Change-Id: Ife8ed17d85a8bcfc507c312001af4b905c9b3a27
CRs-Fixed: 2937435
2021-05-13 08:21:39 -07:00
Yeshwanth Sriram Guntuka
81c70ce74b qcacmn: Modify check to ensure consecutive PN for frags
Modify check to ensure packet number is consecutive for
fragments and drop the fragments if the check fails.

Change-Id: I2ca0ef6211594ba35aae894e6a385d3d5778bff6
CRs-Fixed: 2874369
2021-05-13 06:20:10 -07:00
Yeshwanth Sriram Guntuka
df22eee823 qcacmn: Register API to flush frags in dp peer ops
Register dp_peer_flush_frags API in dp peer ops
for flushing fragments for a particular peer.

Change-Id: Ia179d3160bdc306ec965c465134042c66a0c40a6
CRs-Fixed: 2874366
2021-05-13 06:20:05 -07:00
Yeshwanth Sriram Guntuka
8c4c0044cb qcacmn: Do not intrabss forward EAPOL frames
Do not forward EAPOL frames that have DA different
from the SAP vdev mac addr.

Change-Id: I23959e38b5cbd845d369bebd6913150eca4551bf
CRs-Fixed: 2860248
2021-05-12 18:42:31 -07:00
Yeshwanth Sriram Guntuka
35b9bf6c44 qcacmn: Fix possible OOB access of rx_refill_ring_history
In monitor mode, when the channel is set to any 2G band channel
the mac_id passed to dp_mon_process API is 1. As part of
dp_rx_buffers_replenish, refill history is logged and the
mac_id is used to index into the history array. The array is
of size 1 and OOB access would happen when ring_num which
is the mac_id, passed in is 1.

Fix is to pass the pdev->lmac_id instead to
dp_rx_refill_ring_record_entry and add ring_num sanity check.

Change-Id: Id824ec8b01e7923ad74771d5f34a25f5fccb65f3
CRs-Fixed: 2939544
2021-05-11 08:03:31 -07:00
Amir Patel
770ebeb20f qcacmn: Reduce log level to suppress print
For every channel change, a print is displayed onto console.
reduce log level to suppress print.

CRs-Fixed: 2921656
Change-Id: Ib300ecc17c09412aa6502cc45ec1c4b7da3b54ce
2021-05-11 05:54:28 -07:00
Karthik Kantamneni
28ef474a07 qcacmn: Fix compilation error for modulo operator
In some of the targets modulo operator assembly API's
are not defined causing compilation error.
To avoid this use qdf based API's for modulo operations.

Change-Id: Ibc69b69aa38cadff5daa8dee8b65ceaacfe997b7
CRs-Fixed: 2940281
2021-05-10 09:03:07 -07:00
Ananya Gupta
0561c4ce02 qcacmn: Change log level of error prints
Logs are printed inside a spinlock which was held for
losing more than 2 seconds.
To fix this, reducing log level so it is not printed
in the console and instead in driver logs.

Change-Id: Ib510ddc1b5bff63db012b45ffa0280eedc356cc6
CRs-Fixed: 2938590
2021-05-07 20:51:55 -07:00
Vevek Venkatesan
97c53c4877 qcacmn: add Tx descriptor history in Tx and comp rings
Add the history support to log Tx descriptors programmed
in Tx and completion HW rings.

Change-Id: I60954c93e2595e7dad1251c459eed8afc761e917
CRs-Fixed: 2924614
2021-05-06 13:49:54 -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
Karthik Kantamneni
c68ad7037a qcacmn: Add TX descriptor history support
Add history to log HW TX descriptors programmed in TX ring.

Change-Id: Ia17e5557115f20508ed22c045941c0645c46ef1d
CRs-Fixed: 2928996
2021-05-05 00:54:13 -07:00
Subrat Mishra
fcb71e35cf qcacmn: Neighbour peers RSSI update debug logs
Add Neighbour peers RSSI update debug logs.

Change-Id: I9de84c94d82aeae641facaf4fd19de8d644d3ff6
CRs-Fixed: 2927427
2021-05-04 06:53:29 -07:00
Yeshwanth Sriram Guntuka
d6b21e3e66 qcacmn: Allocate memory for fisa pkt history separately
Fisa packet history is around 6KB for each sw fisa
flow entry and this is part of the dp_fisa_rx_sw_ft
structure. The total size of the SW FT as a result is
around 830KB and the higher order memory allocation via
kzalloc for this could fail in low/fragmented memory
scenarios.

Fix is to allocate memory for FISA pkt history separately
and attach it to the SW FT entry.

Change-Id: I7296d7269c1b86ec38ea1668e8a0893335bbdb6f
CRs-Fixed: 2936353
2021-05-03 20:11:47 -07:00
Amir Patel
ef543f271e qcacmn: Reset MON_BUF ring filters only when monitor mode is enabled
When enhanced stats are enabled/disabled, dp_mon_filter_update () API
sets/resets MON_BUF ring filters also, this is leading to connection issues
traffic stall on Rx side

Set/Reset MON_BUF ring filters when monitor mode is enabled

Change-Id: I0de7be81465b11224b95c0918b4e8c8e339e3802
2021-04-30 14:47:03 -07:00
sandhu
49846e25ef qcacmn: Add start sequence update count to rx stats
add ssn_updates_count to dp_soc_stats rx err stats.
Also add bar fail count on rx tid update during
bar handling.

Change-Id: Ic9a963c8d29ace2087e63cba56bc0d7e40907e1a
CRs-Fixed: 2918806
2021-04-29 21:07:07 -07:00
Yeshwanth Sriram Guntuka
43e51ba3d8 qcacmn: Do not add nbuf to emerg_nbuf_q on free when not initialized
When nbuf is freed via dp_rx_buffer_pool_nbuf_free, the
nbuf is enqueued to emerg_nbuf_q always even in the case
where the emerg_nbuf_q is not initialized. This will result
in NULL pointer dereference when any nbuf is enqueued to
emerg_nbuf_q.

Fix is to add initialization check before adding the nbuf
to emerg_nbuf_q and free the nbuf if emerg_nbuf_q is not
initialized.

Change-Id: I075b3b93203eec21d44ea3967b5f46d59c291a14
CRs-Fixed: 2934593
2021-04-29 17:40:39 -07:00
Chaithanya Garrepalli
970948916a qcacmn: print backpressure stats in work queue context
Avoid backpressure event prints in irq context and
defer work queue context

Change-Id: Ib68237d6a9930ead38f53aa89ec1d9e9a2f4147d
2021-04-29 14:29:33 -07:00
Karthik Kantamneni
3bc4b99247 qcacmn: Add support for Rx refill ring history
Add support for Rx refill ring history, maintain records of refill info
during RXDMA ring replenish.

Change-Id: I034014eacfc510ec6f416fca601fa864326de9c2
CRs-Fixed: 2930005
2021-04-29 04:37:47 -07:00
Amit Mehta
4982427333 qcacmn: Rate limit excessive logging in case of HW enqueue failure
Currently, excess logging is causing a crash when enqueuing
of Tx MSDU descriptor to HW failed.

Rate limiting the log messages to avoid the crash.

Change-Id: Ibb230ce03c23518b6f7feda61a49bf155c7ddc69
CRs-Fixed: 2933002
2021-04-29 01:45:27 -07:00
Karthik Kantamneni
dff5788d14 qcacmn: Fix duplicate additon of same WDI events to list
Same WDI subscribe event can be added multiple times to event list
since this is triggered by user control this will result to undefined
behaviour during events handling.

To avoid this add check to detect duplicate entry before adding
to list and reset list elements once removed from list.

Change-Id: Iaf23927f8439d4ac503776b915a8fe8cb6abfec5
CRs-Fixed: 2931068
2021-04-29 01:45:23 -07:00
Karthik Kantamneni
26086e7971 qcacmn: Add history for REO queue descriptor events
Add history to log REO queue desc update and free events.

Change-Id: If2992ff1256fad49ea4ea6bd90b6dfe4a63d2bc4
CRs-Fixed: 2926919
2021-04-27 09:14:12 -07:00
Will Huang
aab2fe978c qcacmn: Fix possible spinlock vdev->peer_list_lock recursion
It is possible to hit spinlock vdev->peer_list_lock recursion if
running SSR case, the call stack is as following:
dp_vdev_flush_peers
    dp_vdev_iterate_peer
    qdf_spin_lock_bh(&vdev->peer_list_lock);  -> first time lock
        dp_peer_delete
            dp_peer_delete_wifi3
                dp_peer_vdev_list_remove
                    qdf_spin_lock_bh(&vdev->peer_list_lock) ->
lock again in same thread.

Replace it with dp_vdev_iterate_peer_lock_safe.

Change-Id: I40fe492d43b376b404b855a7e86aa2cd66ba1d22
CRs-Fixed: 2926284
2021-04-26 22:54:27 -07:00
Manikanta Pubbisetty
9f6ccf3fe6 qcacmn: assert on IPA SMMU map/unmap failures
The status of the IPA SMMU MAP/UNMAP operation is stored in the
result field of the mem info structure that is passed to the
IPA driver. Currently, this field is not checked for MAP/UNMAP
failures; when IPA HW accesses such a buffer for which
mapping is not correctly setup, it will lead to SMMU faults.
Check the result and assert(on failures) to avoid such issues.

Also, check if the physical address passed to the IPA driver is
non zero value.

Change-Id: Iec0702bdf4a07ea37e1213a33dc970028da654df
CRs-Fixed: 2928744
2021-04-26 12:23:40 -07:00
Amir Patel
fda11e2e76 qcacmn: Configure monitor rings for special vap case
configure monitor ring for special vap case

Change-Id: Idebcfecf61dceb2cad5b7ea07297b5f682778c43
2021-04-23 06:43:05 -07:00
Ananya Gupta
304d6b1fe5 qcacmn: Add enum for FISA flow table
Moving FISA flow table to prealloc.
Create a context type for FISA Flow table.

Change-Id: Iaf3f4bd66c2c73a5ba38ae6baf914ff2a1b900ac
CRs-Fixed: 2928697
2021-04-23 02:06:07 -07:00
Subrat Dash
6e6fa7db85 qcacmn: Use SA based address lookup for station mode
The dp_tx_da_search_override API wrongly returns DA based
address lookup instead of SA based for station mode when
FEATURE_WDS build flag is enabled.

Fix dp_tx_da_search_override API to return SA based
address lookup for station mode.

CRs-Fixed: 2924299
Change-Id: Ibb0c2a6df5f73fd5a361900036316375fc29dbbd
2021-04-22 23:56:28 -07:00
Tiger Yu
2cd64402c6 qcacmn: Support IPA WDI 3.0 with two tx pipes
Currently a set of IPA2TCL and WBM2IPA rings is used for
IPA TX data path. Issue is when wlan is configured as
SAP-SAP DBS mode, slow 2G traffic will consume much more
TX resources and thus 5G traffic will have starvation,
which leads to severe degradation of DBS KPI.

Therefore separate IPA2TCL (SW2TCL2) and WBM2IPA (WBM2SW4)
rings are added to support alternative IPA TX pipe for 2G
traffic.

Change-Id: I4b648d0bcacbcde0b9b0a824516c1f06e3b0c7ad
CRs-Fixed: 2750079
2021-04-21 11:03:45 -07:00
Amir Patel
a255cb4196 qcacmn: Avoid enabling full monitor mode if already enabled
Avoid enabling full monitor mode if already enabled

Change-Id: I728105006af497d18174bc7eba33a2508990caa2
2021-04-21 06:32:07 -07:00
Manikanta Pubbisetty
5a19bd0c38 qcacmn: do a dummy read to flush pending writes
Currently before suspending the device, we are draining
out the TX/RX SRNGs. The HP/TP updates which are done as
part of this will be posted writes(there won't be any link
levelccompletions for write transactions), there are chances
that we might end up updating HP/TP after the device enters
low power mode leading to system crashes.

In order to avoid this scenario, do a dummy read before
device is suspended; this will ensure all pendings writes are
flushed before read returns.

CRs-Fixed: 2919459

Change-Id: I5ab77f91fe14c506444bdea1587acfb34224fc69
2021-04-15 07:03:29 -07:00
nobelj
20a3940590 qcacmn: Add fix to support proxy arp function call
a call to osif_proxy_arp need to be invoked inside UMAC_SUPPORT_PROXY_ARP
as it was protected under build macro UMAC_SUPPORT_PROXY_ARP.

Change-Id: I6e165a328ac65fb659cb9fbc3a0ce39fcbb6744b
2021-04-14 18:08:30 -07:00
Harsh Kumar Bijlani
02fbfe0c0a qcacmn: Fix double nbuf unmap error for Pine
When nbuf map-unmap debug is enabled and monitor vap is created on
Pine, then double nbuf unmap error is reported.
This is because in case of Pine, first monitor destination ring is
processed, then first buffer from monitor status ring is processed
to check for ppdu_id difference and then finally monitor status ring
is processed where the same buffer is unmapped again and thus resulting
in the issue.
Add fix to resolve the same.

Change-Id: Ic20b2ead8ef345c4ff568242544d5f69e83fcfdf
2021-04-14 18:08:26 -07:00
Nisha Menon
ab30ba1267 qcacmn: Unmapped IPA buffer results in smmu fault
Check the return status of the IPA api that creates or
releases the smmu mappings of the tx/rx buffers. If the
api returns a failure then assert.

Change-Id: I755765c7c35c901341279eefbc8087d0dce0494c
CRs-Fixed: 2898353
2021-04-13 18:54:00 -07:00
Mohit Khanna
9f35babf04 qcacmn: Set LRO hash keys based on PDEV flag
Currently dp_lro_hash_setup is being done in dp_vdev_attach_wifi3 when
pdev->vdev_count==1. However, this counter is not getting decremented and
may overflow on repeated VDEV attach/detach calls. This may result in
LRO keys being programmed again.
Use a PDEV flag to determine whether to configure LRO or not. Fix
pdev->vdev_count by decrementing it during VDEV detach.

Change-Id: I03cba0d95c30831fbe8047828f7bb2cf4a869213
CRs-Fixed: 2906871
2021-04-13 16:44:03 -07:00
Mohit Khanna
759a7573ed qcacmn: Add structures for FISA pkt history
Add DP data structures to add history in FISA aggregation path.

Change-Id: I2feb2d9fdef8f78f6cbfaf847c199580ceab9887
CRs-Fixed: 2912971
2021-04-13 16:43:59 -07:00
Nisha Menon
5d7e26e27f qcacmn: Dump the rx reo queue descs in ddr
Add iwpriv option 34 to dump the reo rx h/w descs
in DDR for debugging. This cmd will first send cache
flush cmd to REO for all rx tids and invalidate the h/w
cache. Henceforth ensuring that the reo status tlvs and
the DDR values are in sync.
iwpriv wlan0 txrx_stats 34 0
Add fix to ensure bar frame with 2k jump err code is
processed correctly using the REO error code instead of the
REO push reason.

Change-Id: Ia05be668343f3a5d4b3262b8d6a367a50875add5
CRs-Fixed: 2895965
2021-04-13 14:50:51 -07:00
Tiger Yu
f7f01e0c10 qcacmn: Add sanity checking before removing ase from soc AST hash table
Add sanity checking before removing the ase from soc AST hash table to
avoid potential stability issue if ase is not found in the table.

Change-Id: I97b756cd5bdb052b0ce797cca5d96c6bac8f844e
CRs-fixed: 2912024
2021-04-09 00:37:52 -07:00
Yeshwanth Sriram Guntuka
69e696c423 qcacmn: Reset the inv bit in ring desc cookie for jumbo pkts
When a msdu scattered across multiple nbufs is received
in REO2SW ring and the remaining nbufs are not yet
available in the ring, loop in dp_rx_process is exited
without resetting the invalid bit in the ring desc cookie.
This will result in an incorrect assertion failure when
the same entry is processed the next time.

Fix is to reset the invalid bit in ring desc cookie
when the loop is exited in the above msdu scattered
scenario.

Change-Id: Ie5cfa1fb8ea1db4b7a0a4837545ecbfdfbb8719a
CRs-Fixed: 2916296
2021-04-08 02:50:56 -07:00
Yeshwanth Sriram Guntuka
a5e6565dd6 qcacmn: Check for equal case in nbuf len sanity
MSDU with len 1654 is received in the REO2SW ring and
the total len of the pkt would be 1654 + 392 (pkt tlvs)
+ 2 (l2 hdr padding) = 2048bytes. The nbuf len sanity
checks for strictly less than 2048 bytes which results
in the assertion failure.

Fix is to add the equal case when validating the
nbuf len.

Change-Id: I7e5d1df10339c8d7908a12001c2322028965a8fe
CRs-Fixed: 2916351
2021-04-07 14:32:52 -07:00
Yeshwanth Sriram Guntuka
6512d66c27 qcacmn: Create IPA SMMU maps for host replenished bufs
Buffers replenished post processing entries in the
REO2TCL ring do not have ipa smmu mappings created
when RX_PREALLOC_BUFFER_POOL feature is disabled.
This will result in SMMU fault when IPA HW accesses
such replenished buffers.

Fix is to create IPA SMMU mapping for replenished buffers
when RX_PREALLOC_BUFFER_POOL feature is disabled as well.

Change-Id: I0fe611a1279b91a3e45bc269348e05de9015d596
CRs-Fixed: 2915686
2021-04-07 08:16:35 -07:00
Karthik Kantamneni
1759c5d6cb qcacmn: Rate limit excessive logs in WBM error path
Rate limit excessive logging prints in WBM error path

Change-Id: Ifb69959b78740bf4a0fca7b7611a2da0ef740413
CRs-Fixed: 2908240
2021-04-06 18:43:06 -07:00