Commit Graph

397 Commits

Author SHA1 Message Date
Saket Jha
43a7ab4549 qcacmn: check if peer pointer is NULL
In dp_rx_process function, check if peer pointer is NULL
before using as argument when calling dp_rx_deliver_to_stack.

Change-Id: I6584c79047a809f28e65faad47d1c7220e7057bb
CRs-Fixed: 2470345
2019-06-21 05:47:59 -07:00
Varun Reddy Yeturu
f31e44d8dc qcacmn: Fix memory allocation failure for nbuf pointers
Fix memory allocation failure for nbuf pointers array in
dp_pdev_rx_buffers_attach(), by allocating a single page
of memory for the pointers and re-using them by iterating
in a loop until the total required nbuf's are traversed,
instead of allocating a huge contiguous memory for pointers
to store the address locations of all the nbuf's.

Change-Id: I47ca8f94405e44d6bdbc43129012df1b65b14ba6
CRs-Fixed: 2464598
2019-06-18 12:25:53 -07:00
Rakesh Pillai
2529ae1c8a qcacmn: Add event history logs for datapath
Add support to log the important events in
datapath, which will help in debugging the
datapath issues.

IRQ handler, Napi poll and srng access start/end
are the events which are currently logged.

CRs-Fixed: 2457854
Change-Id: Iba105b0e79443b670a01a929f999f94e00ea92f2
2019-06-17 10:23:01 -07:00
Tallapragada Kalyan
cea9c935f9 qcacmn: Do not check for msdu Done bit for raw packets
Do not check for msdu Done bit for raw packets as HW
does not set this bit for msdus spread across nbufs.

Change-Id: I9c2af01c6b55600511abeec9ab6fc185fcc6ef36
2019-06-17 02:18:25 -07:00
Mohit Khanna
3ba9372a50 qcacmn: Fix invalid sa_da_idx condition in RX path
Currenly this function, is_sa_da_idx_valid(), called from dp_rx_process
does not take MC/BC packets into account. For broadcast packets e.g.
DHCP offer packets from some APs, this check may fail (incorrectly).
Thus dropping the broadcast packet, when it should have been passed
on to the stack.

Fix is_sa_da_idx_valid function by taking MC/BC packets into account.

Change-Id: Ibbb34134e997e0d5394dfa654be84b9fa43434a3
CRs-Fixed: 2466839
2019-06-15 20:55:03 -07:00
Keyur Parekh
b8149a540c qcacmn: Fix for Not sending Deauth to non-authed STA
If any non authed clients send data packets then
AP should send Deauth Frames to STA. In Current code
we are finding VAP from pdev. And if MAC address are
same for VAPs on both radios then pdev will be wrong.
Because of that VDEV id was coming for non active VAP
and deauth frames were not going out of AP.

Change-Id: Ia28ea4143cec9c876313211962ab98b0e4028ee8
2019-06-10 02:37:43 -07:00
Shashikala Prabhu
0bb59b225f qcacmn: Do not try to alloc memory again when qdf_nuf_alloc fails
Do not try to allocate the memory again when qdf_nbuf_alloc fails in
dp_rx_buffers_replenish().

Change-Id: Iafbe10021bf9f53d93a20d4c8e9543ca6f8aff8a
CRs-Fixed: 2463258
2019-06-06 13:02:25 -07:00
Varsha Mishra
1f4cfb6c58 qcacmn: Fix tx completion and rx stats per wbm/reo ring
Tx completion stats should be counted per wbm ring on tx completion
and not globally. Similarly, rx stats should be counter per reo ring.
Change-Id: I1e4af0d38b23e60de78ca03316861db08ff0811a
2019-05-31 07:40:18 -07:00
Yue Ma
ac6b275768 qcacmn: Record caller and timestamp for pm_runtime_mark_last_busy
pm_runtime_mark_last_busy will extend the timer for runtime suspend.
Recording caller and timestamp can help to debug who may prevent
runtime PM suspend.

Change-Id: I4848a2558197e0fc9b7300421a5a1993817333e4
CRs-fixed: 2457803
2019-05-30 19:29:48 -07:00
Amir Patel
cb99026ade qcacmn: Move WDS feature out of common code
Move WDS feature specific APIs out of common code
as these features are WIN specific. Keep the usage inside
common code under feature specific flags.

Change-Id: Id907a5e22c27fc47e8314449e154525684a27e85
2019-05-29 11:08:21 -07:00
Varun Reddy Yeturu
a7c21dc7f3 qcacmn: Allocate multi page memory for dp_rx_desc_pool_alloc
Allocate memory in multiple smaller chunks for dp_rx_desc_pool_alloc,
and link the pages instead of allocating one big contiguous memory to
avoid memory allocation failures.

Change-Id: Id81de10727555c4ca78963a6f01ed3b992ce9924
CRs-Fixed: 2443999
2019-05-23 20:35:07 -07:00
Sravan Kumar Kairam
0bd6c23c89 qcacmn: Fix decrement flush in progress
When rx buffer queue list is empty flush in progress
atomic variable is not decremented before return. Fix
this by removing the code to check list empty as the
qdf function to remove the node from front will also
do the same check for empty list, so the code fall
through and return at the end of the function.

Change-Id: I29b87eb7f9e5d35918aba6ad1d0ccbbdbf6eee3b
CRs-Fixed: 2444437
2019-05-23 09:30:55 -07:00
Varsha Mishra
09a4c0e6bd qcacmn: Fill skb->priority only for macro ATH_RX_PRI_SAVE
skb->priority is needed only for ATH_RX_PRI_SAVE. This access can
be avoided in regular datapath by using skb->cb for faster access.

Change-Id: I5ef970fa45fa314db7e14284d898c98a59d8591e
2019-05-22 12:13:38 -07:00
Chaithanya Garrepalli
d3d99db55b qcacmn: changes to read all MSDUs of MPDU in single reap
We need to read all MSDUs of MPDU in single reap for RAW mode
to prepare the complete SG list

Change-Id: Iaf2d0b9f32bf10181ce7646bf60c4d7e70aed36b
CRs-fixed: 2320143
2019-05-22 09:06:22 -07:00
Tallapragada Kalyan
9e4b36fd89 qcacmn: Rx optimizations to improve small pkt perf
basically tried reading peer_id from peer structure
to avoid 1 cache-line miss per pkt and access mac address
from frame data for WDS only if WDS condition is valid.
The other optimization is to avoid accessing queue_mapping
field of skb for skb received which is at 140 offset
This again helps to avoid i cache miss.
Another place is to do a memcpy only when we intend to
add an ast entry.

Change-Id: I7e328060c505bc21419d045e77329c2cda9e3644
CRs-fixed: 2388857
2019-05-22 00:18:17 -07:00
Jinwei Chen
5bcc30f51c qcacmn: fix peer ref counter unexpected increasement
Host will drop the RX data that introduced in change
"add counters for sa_idx invalid issue", the related peer
has done ref_cnt + 1, but there is no peer ref_cnt -1 accordingly.
peer ref_cnt increase unexpected, panic happened when rmmod at last.

add the peer ref_cnt decrease operation.

Change-Id: Ie6bc5b57560a93c5f21431838b7bcb1140abfec5
CRs-Fixed: 2454468
2019-05-22 00:18:14 -07:00
Ankit Kumar
e222775d39 qcacmn: Extract tid from REO descriptor and save to skb cb
earlier we were extracting the tid from the rx tlvs, this
was in the last cache line of the 384 byte tlv. we are
extracting various fields from REO descriptor, now we are
also getting tid from the descriptor to avoid accessing
the last cache line of rx TLV there by avoiding one
cache miss per packet.

Change-Id: I1f4f12dca402604692ea374599add6763d68ab01
CRs-fixed: 2449706
2019-05-21 14:43:21 -07:00
Ankit Kumar
0ae4abc97b qcacmn: Replace QDF_DMA_BIDIRECTIONAL to QDF_DMA_FROM_DEVICE in rx
In Rx path, We really don't need to flush data and invalidate.
Hence replacing map/unmap flag to QDF_DMA_FROM_DEVICE.

Change-Id: I3de0c73e11a08a875114167a55fe9fe4432f1dd4
CRs-fixed: 2449712
2019-05-20 11:22:21 -07:00
Pranita Solanke
05862964ab qcacmn: Identify WIN/MCC specific features
Identify the WIN/MCC specific features. Move the features under feature
specific flags. Get rid of WIN/MCC specific code.

Change-Id: Iaf4e5befd7d574a20bea5c078201adbeac3b762c
2019-05-20 09:58:47 -07:00
Ankit Kumar
f2526d44ee qcacmn: Place check under qdf_likely unlikely flag
Place if check inside qdf_likely and qdf_unlikely check
to optimize code through compiler.

Change-Id: I46796247fd09860aa0f62170eb7f7e5ef8e8f896
CRs-fixed: 2455579
2019-05-20 10:46:49 +05:30
Chaitanya Kiran Godavarthi
70aeda1cdd qcacmn: Handle BSS peer in STA mode
1. Set BSS peer for AP during peer-create and for STA in peer-map handler
2. Set Self peer in STA mode
3. Avoid tid cleanup in STA mode
4. Remove redundant selfmac checks in Rx
5. In MEC event handler add a check to ignore MEC events
    when STA is not connected.

Change-Id: I2a34b4742d9dedaa0709c1f4c87f3a06b794f36b
2019-05-16 07:45:55 -07:00
Mohit Khanna
e5a6e94464 qcacmn: Restrict RX softirq poll times
The following changes are made

-Yield dp_rx_process if poll time exceeds
-Yield dp_tx_comp_handler if poll time exceeds
-Interrupt statistics to track various interrupt contexts and
 corresponding interrupt masks
-Add poll times histogram buckets to NAPI stats

Change-Id: I8c7a6bbbb97c7b3dd1dde6ac3a97113c433086a2
CRs-Fixed: 2423879
2019-05-14 18:39:59 -07:00
Ankit Kumar
f90c944dad qcacmn: Access msdu_len from struct cb to avoid cache miss
We are accessing nbuf_len field for every nbuf
and which causes cache hit as we are accessing
it not from 1st cache line. This field is present
in struct cb. Lets access it from here to avoid
cache miss.

Change-Id: I21a81d844a4cc755a0ca0c156bd3f4d5702fd913
CRs-fixed: 2449717
2019-05-14 05:46:31 -07:00
Tallapragada Kalyan
7147b3ccbf qcacmn: RX optimization changes to reduce cache misses
certain fields are now retrieved from reo_destination
ring to nbuf cb. This avoids accessing the RX_TLVs
which are spread across two cache lines. This is
helping improve small pkt (64 byte) performance.

Change-Id: Iee95813356c3dd90ab2e8a2756913def89710fb1
CRs-Fixed: 2426703
2019-05-08 04:47:16 -07:00
Varsha Mishra
9d42f127f5 qcacmn: Fix broadcast stats for host
Count broadcast stats on rx side after rx_tlv_hdr is extracted.
After removing rx_tlv_hdr, nbuf->data points to actual payload.

Change-Id: I20e4029fd84bc3d76e2fd47eba74b9bef72a32c0
2019-05-06 05:52:41 -07:00
Karunakar Dasineni
d8c7ad2228 qcacmn: Support per-ring CCE protocol tag stats
CCE stats are reported across rings today. Since HKv2 is a SMP, it
creates the possibility of missing stats when two or more CPUs are
updating the counters for the same protocol type. In order to avoid
this, we can either use locks or store stats on a per-CPU basis.
Since tagging happens on the core data path, locks are not preferred.
Instead, we use a per-ring counter, since each CPU operates on a REO
ring. Exception packets today go to Ring-0 (also normal rx Reo-0
go to Ring-0). Hence tags are maintained separately for exception
ring as well.

Change-Id: Ib01934619fb026bf64a8ac998eaec2d4df7f5a6e
CRs-Fixed: 2438143
2019-05-01 10:18:35 -07:00
Jinwei Chen
e661127fa1 qcacmn: fix incorrect NSS value in host RX stats
Revert change "Limit maxinum nss number as 2 for MCL platform" and
align with WIN function: hal_rx_msdu_start_nss_get_8074v2().
besides, only increase rx.nss[NSS - 1] when NSS is > 0 and rx packet
type is 11N/AC/AX.

Change-Id: I0a64f00a3d252c806216cc3196e71290f111c88a
CRs-Fixed: 2429329
2019-04-29 22:55:24 -07:00
Sravan Kumar Kairam
ebd627e195 qcacmn: Cache rx frames during dp peer register
Currently frames will be dropped if it arrives before
peer is registered with data path module by control path.
So cache rx frames and flush them to the upper layer when
peer is registered at data path.

Change-Id: I086122fffdcf33e25ba57774ef944550cdd2fa20
CRs-Fixed: 2329308
2019-04-27 06:44:19 -07:00
Karunakar Dasineni
142f9baf47 qcacmn: Add new feature to support protocol tags
With this feature, using appropriate commands, link layer, network layer,
transport layer and some of the application protocols can be tagged with
the user provided tag values for easier identification of protocols. The
supported protocols today are as follows.

ARP, DHCPv4, DHCPv6, DNS over TCP (v4), DNS over TCP (v6), DNS over UDP
(v4), DNS over UDP (v6), ICMPv4, ICMPv6, TCPv4, TCPv6, UDPv4,
UDPv6, IPv4, IPv6, EAP.

Receive packets are tagged by hardware. Tags are applied after the first
matching rule. Hence it is recommended that the rules are
programmed in such a way that tags are configured from application layer
to data link layer to get expected results.

Change-Id: Ibdc2bd2b78234f482074955e89fb93f05988eaca
2019-04-26 15:31:10 -07:00
jiad
5679e39c7d qcacmn: Fix RX buffers refill for driver loading
On low memory system, skb allocation failures are observed in
dp_rx_buffers_replenish during driver loading phase within
dp_rx_pdev_attach code path. Per kernel memory team analysis,
failures are caused by large amount of atomic allocations.
Currently when replenishing RX buffers, srng spinlock is first
grabbed and then skb buffers are being requested, which makes
skb allocation happen in atomic context.

Fix is to create a new API for refilling rx buffers when
loading driver. In the API, skbs are allocated into a
pool without srng lock grabbed. Srng lock is grabbed only
when refilling already allocated skb to rxdma ring.

Change-Id: I9d45a42c9f2b0af7bf1d8031adb474d66ff9db59
CRs-Fixed: 2425798
2019-04-18 17:02:27 -07:00
Tallapragada Kalyan
12a6840949 qcacmn: change qdf_assert_alway to qdf_assert in rx path
change qdf_assert_alway to qdf_assert in rx path

Change-Id: Id9ac6b69b693c3194972cdb61265f867c2267679
CRs-Fixed: 2432396
2019-04-12 02:56:35 -07:00
Mohit Khanna
16cd1b2e8d qcacmn: Add Sanity checks during RX processing
- Check for rx_desc.magic before using a rx_desc retrieved from the reo
  destination ring via rx_buf_cookie (dp_rx_process). Add stats.
- Check if we end up re-using a rx_desc with rx_desc.in_use=1 in the
  replenish path (dp_rx_buffers_replenish).
- Drop RX packet and assert in case MSDU Done failures are seen in
  in the TLV during dp_rx_process. Add stats.
- Disable host2rxdma ring mask for MCL. MCL is not expected to be
  receiving these interrupts.

Change-Id: Iaa345d04b8d48814f88ed6e2237fc67696f6a20c
CRs-Fixed: 2382076
2019-04-02 11:17:32 -07:00
jiad
3b8104bdd3 qcacmn: Support WLAN IPA WDI 3.0 SMMU
Support WLAN IPA WDI 3.0 with SMMU-S1 enabled. Key design
considerations are captured below.

- ring base addresses are passed as struct sg_table and IPA
driver will do the IOVA mapping to IPA domain.
- ring doorbell addresses are passed as physical address and
IPA driver will do the IOVA mapping to IPA domain.
- TX/RX buffers need to be mapped to IPA domain by WLAN driver
via ipa_wdi_create|release_smmu_mapping API.
- IPA doorbell addresses returned from ipa_wdi_conn_pipes are
DDR addresses and WLAN driver needs to do the IOVA mapping
to WLAN domain.

Change-Id: I2398df58c9a9d002af7035f239eda37a86f5d00f
CRs-Fixed: 2422155
2019-03-30 04:53:25 -07:00
Srinivas Girigowda
2751b6d2b3 qcacmn: Consolidate multiple MAC_ADDR_LEN to QDF_MAC_ADDR_SIZE
Consolidate multiple (redundant) MAC_ADDR_LEN to QDF_MAC_ADDR_SIZE
CDP_MAC_ADDR_LEN
OL_TXRX_MAC_ADDR_LEN
DP_MAC_ADDR_LEN
HTT_MAC_ADDR_LEN
IEEE80211_ADDR_LEN
DEFRAG_IEEE80211_ADDR_LEN
ETHER_ADDR_LEN
HAL_MAC_ADDR_LEN
WLAN_MACADDR_LEN

CRs-Fixed: 2406591
Change-Id: I4a87f8ff556920c7b341bdbba99ec43c97b873f4
2019-03-28 16:50:32 -07:00
Jeff Johnson
a8edf330f0 qcacmn: dp: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within dp replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: I61f3adab1208682d36235421f44a048e35df346d
CRs-Fixed: 2418258
2019-03-27 06:10:00 -07:00
Venkata Sharath Chandra Manchala
b43ed1cd1a qcacmn: Update rx histogram stats appropriately
Increment number of packets processed per pdev
per interrupt before updating rx histogram
stats counter.

Change-Id: I0d6c59a6a115df168f7755ce94faa90dcc753e13
CRs-Fixed: 2418384
2019-03-26 17:16:48 -07:00
Manjunathappa Prakash
8f70862cd8 qcacmn: Detect dp_rx_process reo descriptor paddr corruption
Compare REO ring descriptor paddr with rx_desc->nbuf->cb->paddr,
possible corruption if they differ.

Change-Id: I064df12495a9934fe2396305a7a4a8cdeacdfd4f
CRs-Fixed: 2398155
2019-03-24 14:55:01 -07:00
Varsha Mishra
a331e6e55f qcacmn: Implement delay VOW stats for hawkeye
Delay counters per TID have been implemented for following types:
1. Linux stack to hw enqueue delay
2. HW enqueue delay to tx completion delay
3. TX interframe delay
4. RX interframe delay
5. RX frame delay from ring reap to networking stack

Change-Id: I836596cbd878a43955c18b4981cb5b7b43d4df5e
2019-03-12 06:10:05 -07:00
Shashikala Prabhu
e11412df5c qcacmn: Add compile time macro to disable rx_pkt_hdr_tlv
Do not process  RX packet header TLV for low memory config profile.
Also, drop decapped frames in invalid peer processing function.

Change-Id: Ifc7721bb25d85c7e277bebf4b962d2f1bfea150c
CRs-Fixed: 2395508
2019-03-08 23:38:04 -08:00
phadiman
449a268392 qcacmn: Reuse Rx Descriptor Pool Array
wifi up/down will cause soc stop and soc
start which will allocate rx desc pool
array memory for each wifi up

This creates memory fragmentation issue
hence reuse Rx descriptor pool array
across wifi up/down and free only nbufs

CRs-Fixed: 2394666
Change-Id: Ic897c733dfba3d8829e2f2f51099cd615b8a7ea2
2019-03-08 20:19:16 -08:00
Varsha Mishra
18281794c8 qcacmn: Implement VOW stats for hawkeye
VOW stats is an extension of regular stats to capture
all drops per TID. Delay counters per TID are also
included.

Change-Id: If6087f37b32cf9ae4bb405190a358ad3c9750dd2
2019-03-06 18:20:42 -08:00
Krunal Soni
c96a1167f8 qcacmn: Use dp_verbose_debug() to print msgs which come excessively
Some of the print messages in Data-path module come very excessively.
Use dp_verbose_debug() API to print them.

CRs-fixed: 2376998
Change-Id: Ibaec3751ce3cbe98492c531548e613c7d17db898
2019-03-06 12:52:07 -08:00
Chaithanya Garrepalli
af34aae9cd qcacmn: add counters for sa_idx invalid issue
Add counters in case where we identify
HW issue where sa_valid and da_valid bit
are set and sa_idx and da_idx are invalid

Change-Id: I690b626dd3c2b7f20b35982514b0f27576221250
CRs-fixed: 2340521
2019-02-27 03:14:02 -08:00
Srinivas Girigowda
03bd4b6b30 qcacmn: Replace struct ether_header with qdf_ether_header_t
Replace struct ether_header with qdf_ether_header_t.

Change-Id: I30d06dcf94e3149bf77f1f99e7a854bc9d7ae3ac
CRs-Fixed: 2404851
2019-02-26 21:18:44 -08:00
Srinivas Girigowda
7950297868 qcacmn: Replace IEEE80211_IS_BROADCAST with QDF_IS_ADDR_BROADCAST
Replace IEEE80211_IS_BROADCAST with QDF_IS_ADDR_BROADCAST.

Change-Id: I199797ea402ee68dd0addf6698aa5ccd0ddc8f97
CRs-Fixed: 2396621
2019-02-23 16:02:59 -08:00
Jinwei Chen
1cb78177e6 qcacmn: Fix REO entry potential overwrite issue
Host SW should not update the cached TP pointer to HW register before
current cached TP REO entry finishes processing, otherwise there is
risk if HW HP catches up to this cached TP, but HW TP value has been
updated to (cached TP + one entry size) now, this TP REO entry might
be overwritten.

Refine it and only update TP pointer to HW when entry processing has done.

Change-Id: I54df3247745717855a67649f440c606c518efd61
CRs-Fixed: 2391658
2019-02-14 03:11:43 -08:00
nobelj
9d8154dcd3 qcacmn: update TID to skb priority
update TID to skb priority before checking process_rx_status.

Change-Id: Ic81666e3cf918f6d089c43ae8234cd7a06fd0ccc
2019-02-04 07:28:30 -08:00
Nandha Kishore Easwaran
f9c44ce2ad qcacmn: Move DA_war flag to SOC level
Moved DA_war flag from vdev level to soc level.
Also disable DA_war when extap is enabled.

Change-Id: I8e8b2ac7835fb8b5bcad603bd1e7d8036ef7719c
2019-01-30 00:03:13 -08:00
Venkata Sharath Chandra Manchala
ec9a530bc0 qcacmn: Fix statistics counters
1. Account for total Tx completions received on wbm2sw release ring.
2. Avoid multiple updates to invalid peer counter on
   wbm error path handling.

Change-Id: I904208e1bd83e98598870a1f05c4b17c3fb20e2d
CRs-Fixed: 2366790
2019-01-21 17:12:47 -08:00
Tallapragada Kalyan
eff377a1d3 qcacmn: do not process duplicate descriptor frame in RX
once in a while the HW is sending a descriptor which
is already processed by host. This can be a potential HW
issue, as a WAR we are not processing such duplicate descriptors
instead increment a counter and continue with next descriptor.

Change-Id: I6c9bc6a9fb4705b42284171a32855411aa5dd73f
CRs-Fixed: 2338543
2019-01-17 10:49:24 -08:00