Commit Graph

154 Commits

Author SHA1 Message Date
Rakshith Suresh Patkar
162d95556e qcacmn: Cleanup peer local id references from DP RX
Local peer_id is being cleaned up across DP, HDD and PS/WMA.
So, any references to local peer_id/sta_id will be replaced
by peer mac address and all interactions between the layers
will be based on peer mac address.

Cleanup references to peer_local_id from the
following APIs:
 1) dp_rx_process
 2) dp_rx_process_rxdma_err

Change-Id: Ia1c8bd091759132367718e6c6d5f67cf5a98e507
CRs-Fixed: 2512706
2019-09-06 22:25:09 -07:00
Sumeet Rao
c4fa4df717 qcacmn: Add a new feature to support tagging of IPv4/v6 flows
Tags are programmed using wlanconfig commands. Rx IPv4/v6
TCP/UDP packets matching a 5-tuple are tagged using HawkeyeV2 hardware.
Tags are populated in the skb->cb in the REO/exception/monitor data
path and sent to upper stack

CRs-Fixed: 2502311
Change-Id: I7c999e75fab43b6ecb6f9d9fd4b0351f0b9cfda8
2019-08-07 11:28:21 -07:00
Ankit Kumar
1c69ca1112 qcacmn: Added rx errors and dropped stats
Rx dma error and reo error are accumulated at pdev level.
Rx error consists of:
 - desc_alloc_failure [No free desc available]
 - csum error [IP/TCP_UDP]
 - mic_err
 - rx_dma_error
 - reo_error
Rx dropped consists of:
 - msdu_not_done
 - mec
 - mesh_filter
 - wifi_parse
 - non_rx_drop
 - non_radiotap_update_err

Change-Id: I4166a32ce94630e8a3ccad7a2551eedf9493e292
CRs-Fixed: 2499563
2019-08-05 09:31:50 -07:00
Akshay Kosigi
8eda31cab3 qcacmn: Remove void ptr usage in HAL
Add code to replace usage of void pointers from
HAL layer and instead use appropriate opaque pointers

Change-Id: Id950bd9130a99014305738937aed736cf0144aca
CRs-Fixed: 2487250
2019-07-27 13:43:07 -07:00
Akshay Kosigi
a870c6181a qcacmn: Change to clean up of void pointers
Add code to cleanup usages of void pointer usages
in DP code.

Change-Id: I0736bcc0a547d858ed02f1ee59084a44e5fe4bec
CRs-Fixed: 2487249
2019-07-27 13:43:04 -07:00
Akshay Kosigi
0bca9fb200 qcacmn: Change to remove void pointer usage for HAL SRNG
Add code to remove void pointer usage for hal_srng
and use opaque pointer dp_hal_ring_t instead.

Change-Id: I6907f7376d7fe3c9180b8795bd96f49fead2ec64
CRs-Fixed: 2484404
2019-07-27 13:42:41 -07:00
Akshay Kosigi
91c56523d3 qcacmn: Remove void pointer usage for ring desc's
Make change to remove usage of void pointers for
ring descriptors and instead use a opaque pointer
dp_ring_desc_t.

Change-Id: Ia1e9a3da9eaa3cccf297b2135b52a72f2fe21431
CRs-Fixed: 2484409
2019-07-27 13:42:37 -07:00
nobelj
2b861f8a49 qcacmn: fix setup tid for non QOS client
fix tid setup in null queue for packet comes in uninitialized tid.

Change-Id: I430e24f46a1782d0ddc3abebbbf32145573d6844
2019-07-24 17:09:54 -07:00
Rakshith Suresh Patkar
d863f8d6b7 qcacmn: Add new API for registering rx mic error callback
Add new CDP API cdp_register_rx_mic_error_ind_handler to
register rx mic error callback. Also, define new structure
cdp_rx_mic_err_info for holding MIC error information.

Change-Id: I4d5d6426b1d5f04848afd48f6dbf51edba291a20
CRs-Fixed: 2488424
2019-07-22 11:36:23 -07:00
Vevek Venkatesan
33ba728fae qcacmn: CONFIG_MCL cleanup in DP layer
CONFIG_MCL cleanup in DP layer.

Change-Id: Icc9947aac290496b3d1bb708639b392815b82070
CRs-Fixed: 2467193
2019-06-27 05:00:13 -07:00
Vinay Adella
5c1b7881a1 qcacmn: Handle decrypt error packets for invalid peers
Packets from STAs that are not associated are sometimes indicated
as Decrypt error.
Process these packets by sending a unicast Deauth packet to them.
This is also required to trigger unicast Deauth, if the STA
ignores broadcast Deauth and later send packets to AP in Deauthed
state

Change-Id: I6ebf848d4b9409931ae1750b5ff0617839b04105
2019-06-27 00:04:32 -07:00
Venkata Sharath Chandra Manchala
a6c047026d qcacmn: Add Null check to handle send_delba
Add a null check to avoid dereferencing send_delba
for QCA6390

Change-Id: If44b1ee4ed15918e27578f5bc98b0531d9b7cb29
CRs-Fixed: 2475880
2019-06-25 13:06:44 -07:00
Vevek Venkatesan
de31ff656d qcacmn: add feature flags to featurize DP operations
Add feature flags DP_FLOW_CTL for DP flowctl ops,
DP_PEER_SUPPORT_OPS to support peer handling in DP,
DP_POWER_SAVE for power saving ops in DP, DP_CON_MON DP_MOB_DEFS
DP_INVALID_PEER_ASSERT DP_PRINT_NO_CONSOLE and DP_INTR_POLL_BOTH.

Change-Id: I01dafadf6578c0b5f36ab3ef56624912fb66b100
CRs-Fixed: 2467170
2019-06-21 03:09:23 -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
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
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
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
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
nwzhao
ea2ffbb331 qcacmn: skip processing duplicate descriptor in dp_rx_err_mpdu_pop
If there's a HW duplicate rx descriptor from hardware,
it'll cause a NULL pointer issue in
__dma_inv_range in dp_rxdma_err_process.
In this case, skip procssing it as a workaround.

CRs-Fixed: 2398327
Change-Id: I5639e5fc9a3a06e6762448ec7cb2ea58d9ae8160
2019-05-15 21:34:29 -07:00
Pranita Solanke
71371bc4ad qcacmn: Removal of CONFIG WIN macro
Move WIN specific structures out of common datapath, WDI_ENUM
into common datapath and remove WIN specific header files inclusion

Change-Id: I8a0d9db4970f3ea9d966337caf178ebce55c28c5
2019-05-15 05:47:13 -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
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
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
Jinwei Chen
2f79dd975f qcacmn: degrade log level when dump rx data TLV
currently host will dump TLV with info level if HW indicate RX
data with invalid sw_peer_id, this will introduce excessive logging
issue, host panic.

degrade the log level to debug level.

Change-Id: Ia24f411bdfd9ec8e315874340d3bf046c245a72b
CRs-Fixed: 2420640
2019-04-09 22:20:55 -07:00
Mohit Khanna
f085b61b59 qcacmn: dp_rx_null_q_desc_handle: drop if msdu_len > RX_BUFFER_SIZE
In some cases, the msdu_len as retrieved fromm msdu_start TLV is
greater than RX_BUFFER_SIZE. In such cases, when qdf_nbuf_set_pktlen
is called, it will expand the skb to accommodate the bigger packet.
This makes the rx_tlv_hdr var invalid, since it continues to point to
the older skb->data. Access of this rx_tlv_hdr will cause exception.

Drop the packet if msdu_len > RX_BUFFER_SIZE. This is not expected while
reaping WBM RX Release ring.

Change-Id: I60890e4d3ee0afa451884d4df458eb50be280280
CRs-Fixed: 2426245
2019-04-08 17:43:38 -07:00
sumedh baikady
c2fa7c99c0 qcacmn: Deliver STP pkts from wbm exception path
Vlan tagged STP pkts are received in host from
wbm exception path with wifi parse error code.
This is delivered to stack. Stats added for wifi
parse error and vlan tagged stp pkt count.

Change-Id: I25af5ab403ee7a46b4abe2f60328314d61587b80
CRs-fixed: 2375575
2019-04-02 15:51:44 -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
Prathyusha Guduri
9e4bb950e4 qcacmn: 2k_jump error fix for sequence number mismatch
In some cases non aggregate packets with active BA session land in
2k_jump_error owing to sequence number mismatch.

Fix those cases by sending delba and the next addba is expected to reset
the sequence number

Change-Id: Ib95edf8744761abddb80cf28bf405d6fa52181c8
2019-04-01 07:49:02 -07:00
nobelj
7dfc8cc755 qcacmn: resolve memory leak in invalid peer
Instead of last nbuf send whole msdu chain.

Change-Id: I9f5c2889cb7ed03d9d5f44afd5c6f36db14bc45a
2019-03-29 18:26:46 -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
Pamidipati, Vijay
c736e83257 qcacmn: Add missing unmap in rx error path
Add missing qdf_nbuf_unmap and storing of rx_buf_start
in rx defrag error handling path

Change-Id: I53b4b76e01e89f5542feeff5af2328cc4414486b
CRs-Fixed: 2420080
2019-03-25 14:24:32 -07:00
syed touqeer pasha
576972b9e5 qcacmn: Move RBM value check before rx descriptor fetch
The rx descriptor may be invalid if RBM is incorrect.
Check the RBM value before fetching the rx descriptor.

Change-Id: I12cc99ceb31b8bbf0127591e1c275b13264eb80c
2019-03-13 19:41:36 -07: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
Neil Zhao
fca0919fb9 qcacmn: fix use after free issue: avoid access nbuf after deliver to OS
stats update is reading nbuf after vdev->osif_rx

Change-Id: I1d1972979066b402e4ee0519596cd305c5895702
2019-03-03 22:25:12 -08:00
Tallapragada Kalyan
fe278d5425 qcacmn: discard fragmented pkts if msdu count is greater than 1
discard fragmented pkts if msdu count is greater than 1
and also some code clean up

Change-Id: I1d0857b5e22f0e4763cfa355b8c92bde697d7540
CRs-Fixed: 2382353
2019-03-03 22:25:00 -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
Karunakar Dasineni
f8ec0cbe57 qcacmn: Fix defrag waitlist flush issues
Check if peer is valid before access during flush.

Check waitlist during peer cleanup even if REO queue was
not allocated, since these are independent.

Add a timeout to avoid calling flush function too frequently.

Change-Id: Ib8da2014f81a48ccc3ca6a330209a942ac0998a2
2019-02-24 01:30:00 -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
Tallapragada Kalyan
a702362d34 qcacmn: Check for MAX_AST entries when adding AST entry
check for max_ast entries supported by FW and add the
entry on host accordingly.

Change-Id: Ief70ba631bb41d50c79d3673e3eea0c45b0c1e19
CRs-Fixed: 2355947
2019-02-12 04:47:37 -08:00
Krunal Soni
53add6504b qcacmn: WAR to drop MPDU with incorrect sw_peer_id
In certain scenarios where AP sends OFDMA TCP packet to
multiple STAs in HE80 mode in poor RSSI conditions, it has been
observed that host in STA gets in to null_q_descr handling case and
rxtlv doesn't carry correct sw_peer_id. Due to this,
driver can't find correct peer from table and ends up sending deauth
frame to handle invalid peer case. The TA is valid and host is able to
find the peer using the TA.

Apply workaround by detecting this special case and drop the frame.

CRs-Fixed: 2367420
Change-Id: I0cbdbb8e9976e739c959062261fc1c946e446d63
2019-02-04 13:08:03 -08:00
Gurumoorthi Gnanasambandhan
e1334b3595 qcacmn: Accept EAPOL packets in uncrypted error case
rx unencrypted eapol frames are dropped with dynamic WEP on de-tunnel mode.
Accept EAPOL packets alone in uncrypted path.

Change-Id: Ie576211c3d408fd7e319fba05c9d1badaa4b4676
2019-01-28 12:20:53 -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
Chaithanya Garrepalli
9cc562c53b qcacmn: Modify CDP AST APIs to synchronize add and delete cmds to FW
Change the CDP abstraction APIs for ast entry find, add and delete
to avoid external references for ast entry in upper layers

Process the HTT v2 peer map messages which will be enabled for
nexthop ast entries and use these messages instead of WMI event
for HKv1 WAR where we have to wait for delete confirmation from
target event which is processed in control path

Change-Id: Ifa91a259c0762344deb8ab89e868fc5554d75543
CRs-fixed: 2354951
2019-01-17 02:22:24 -08:00
Aniruddha Paul
a2e7c93db7 qcacmn: Change the 2k handling API to non-static
Make the 2k jump handler from static to non-static
to change the scope of the API.

Change-Id: I55e2b69c8d470cdf958da76f4f0c8d0effc7ed2e
2019-01-12 07:28:54 -08:00
chenguo
bae040f144 qcacmn: fix excessive logging during update peer statistics
Change the QDF log level during update peer statistics. It is not
necessary because during roaming it is possible the peer is not
there when we update statistics. Also use QDF_TRACE_RL to replace
QDF_TRACE to avoid massive log prints.

CRs-Fixed: 2353709
Change-Id: I2896e6874b2802ee1d8bf05c6daf064e1953a5d5
2018-12-24 00:11:03 -08:00
Jinwei Chen
214590a2c9 qcacmn: fix nbuf free reuse during invalid peer data processing
For MCL function dp_rx_process_invalid_peer, there is corner case the
nbuf is not data and freed, but invalid_peer_head_msdu pointe to the
same nbuf in pdev is not reset to NULL, then invalid_peer_head_msdu is
reused again.
Reset invalid peer msdu list to NULL when nbuf is freed.

Change-Id: I73058afe9656c34971ea083faa19ef9d90b7f747
CRs-Fixed: 2356531
2018-12-12 12:29:22 -08:00
jiad
268579c204 qcacmn: Fix WAPI unencrypted frame error
WAPI cert AP sends rekey frames as unencrypted. Thus
RXDMA will report unencrypted frame error and error
frames are then sent to release ring as configured.
With current implementation, host just drops WAPI
error frames.

To pass WAPI cert case, fix is to deliever unencrypted
WAPI frames to stack.

Change-Id: I6dfd1b5e6958d729ec3da0a0d1f1e6c227b0597f
CRs-Fixed: 2350485
2018-12-05 03:57:49 -08:00
Pamidipati, Vijay
b75e8108a1 qcacmn: Fix the buffer replenish ring for REO errors
Currently buffers reaped in REO exception ring handler are being
replenished into 5G MAC ring always.
Fix this by using appropriate MAC ring for replenish

Change-Id: I04f5a1179a7df4b018b6a0b435e2a0421ef534e5
2018-11-09 13:11:27 -08:00
Chaithanya Garrepalli
e10f87bd41 qcacmn: add a flag in AST entry to indicate AST map
Add a flag for AST entry to indicate if AST entry is
mapped to AST table and use this flag while dereferncing
ast table with ast_index in ast_entry

Change-Id: I8c90f3c40116e24303aac8a7bd53e8f5b67e22bf
2018-10-18 16:58:40 -07:00