Commit Graph

130 Commits

Author SHA1 Message Date
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
Tallapragada Kalyan
8c93d5d032 qcacmn: setup tid queues only if default route is set
ensure we setup tid queues only if default route is set
Also we no longer set default route or tid queue setup
for BSS Peer.

Change-Id: Id240b9b8ddd67136ff85e1098840938928857fc4
2018-10-16 04:35:01 -07:00
Chaithanya Garrepalli
cf347d1686 qcacmn: Add APIs to get AST entry with pdev_id
With HKv1 WAR to handle DBDC backhaul SON cases a AST
entry for same mac can exist on different radio added
CDP APIs to support the same

Change-Id: I374b8af3fe5e34f62eeb5b09819e331fdeda602a
2018-10-08 03:36:21 -07:00
Chaithanya Garrepalli
7c8cf12b76 qcacmn: add API to get ast entry from peer ast list
We are adding AST entry to ast_table from
dp_rx_mcast_echo_check in STA mode as in STA mode
we will not get the peer map event.

Find AST entry from the peer ast list to get ast entry
added in host for that particular peer. As in QWRAP
mode there can exist multiple peers with same mac address
and corresponding AST entries will be added

Change-Id: Ia75f88c03c4d0eba0edbebf8e8f40d41396543d5
CRs-fixed: 2307540
2018-10-08 01:53:25 -07:00
Tallapragada Kalyan
5deeef2fec qcacmn: Add support for MEC stats and null queue stats
Add support for MEC stats and null queue stats

Change-Id: Ie523d8e5cbca6660cd5477d152360db448d75708
2018-10-05 15:46:46 -07:00
Balamurugan Mahalingam
764219e1a8 qcacmn: move some hal functions to hal_generic_api.h
Functions hal_rx_wbm_err_info_get, hal_tx_comp_get_release_reason,
hal_rx_dump_mpdu_start_tlv uses some hardware macros directly and the
value differs between qca8074v1 and qca8074v2 targets.
Move these functions to generic api file and compile it per target.

Change-Id: Ib78fb6e69238577aac64da3f60f38a72cee316b0
2018-10-03 02:44:47 -07:00
Sravan Kumar Kairam
26d471ec56 qcacmn: Take peer ref count and dec it after using
Currently peer reference is used with out taking any ref count.
In parallel context execution on different core peer reference may
be cleaned up in peer unmap event. So take ref count while using
the peer reference and decrement after done with it.

Change-Id: I02ca172cbdc4309fabd3bbbad00940826662bbd3
CRs-Fixed: 2301963
2018-09-27 20:24:36 -07:00
Amir Patel
3217ade780 qcacmn: For Rx multicast/bcast stats, make mcast as superset
make it inline with TX, make multicast stats to
include bcast packets also

CRs-Fixed: 2298834
Change-Id: Id30af0a6ddd784b268b9707ea2df1bcd255dd2cf
2018-09-12 10:23:30 -07:00
sumedh baikady
faadbb6cd0 qcacmn: Handle addba req with incompatible buffersize
In HKv1 HW there is a buffersize setting per peer, hence
once we set buffersize we have to stick to this for all
subsequent requests for all tids. If buffersize in Addba
request is more than first session's buffersize, we restrict
buffersize to old value, else we send respond with new size
and send delba to previous sessions not compatible with new
buffersize

Change-Id: Ia71d994ee06ca7b37d93273f5fa69547f816dd20
Crs-fixed: 2247816
2018-09-10 04:25:29 -07:00
Jinwei Chen
a1f53043bb qcacmn: fix excessive logging when RX invalid peer data
To avoid excessive logging to console, control the log rate when
RX data peer is invalid in function dp_rx_err_deliver, use API
QDF_TRACE_ERROR_RL instead of original QDF_TRACE.

CRs-Fixed: 2300774
Change-Id: If1bf3fd93801e0ef37c7fdb1a32cda16aa429464
2018-09-04 21:15:23 -07:00
Balamurugan Mahalingam
3715aa4dd6 qcacmn: [2/2] Support both qca8074v1 and qca8074v2 from hal
Pass hal_soc handle to hal function calls to invoke appropriate
target specific hal APIs

Change-Id: I1d646875508cab9b2ec2af55441cbece36a020cd
2018-09-04 11:53:38 -07:00
Nandha Kishore Easwaran
e03102f60d qcacmn: Remove DP_INTR_POLL flag
Remove DP_INTR_POLL FLAG as polling is now handled runtime using
hif_is_polled_mode_enabled. This is needed as 8074 works on interrupts
whereas 6290 is still working on polling mode

Change-Id: I0e7fdc338d462735dc216c929b1b5a99dc984435
2018-09-03 05:11:19 -07:00
sumedh baikady
df4a57cd31 qcacmn: Handle 2k exception and rate limit delba
Upon receiving 2k jump exception, send delba
and track delba tx status and retries.

Change-Id: Ida35256233869dfa390c40030c9296b9c48481ce
Crs-fixed: 2239856
2018-08-20 01:36:58 -07:00
Aditya Sathish
ded018e406 qcacmn: Clean up dp component prints
Clean up datapath component prints by correcting trace levels for
regularly occurring prints and removing newlines from converged
print APIs since qdf_trace_msh appends them by default.

Change-Id: Ie8fe319fcb737720f7400a165e134b6a18bd15b5
CRs-Fixed: 2243843
2018-08-10 18:11:21 -07:00
Balamurugan Mahalingam
96d2d41c87 qcacmn: Fix compilation issues and a minor issue
Removed qdf exports on functions defined in target specific
header files and defined those functions as static. Revert
changes on hal_rx_msdu_end_sa_idx_get and make
hal_rx_msdu_end_da_idx_get target specific

Change-Id: I2858b1d77118f0a26b54bf983bd342c7a4fe757d
2018-07-21 00:03:36 -07:00
Balamurugan Mahalingam
97ad1061a3 qcacmn: introduce few target specific hal functions
make hal_rx_msdu_end_sa_idx_get and hal_rx_dump_msdu_end_tlv
routines target specific as qca6390 implementation differs
a bit. add target specific functions for qca6290 and qca8074

Change-Id: Ie05b91d965bae3642e3264620c6d8427ad368044
2018-07-21 00:03:32 -07:00
Balamurugan Mahalingam
d0159640ea qcacmn: Separate hal for qca6290 and qca8074
Create separate individual hal_srng_table and hal register
offset in target specific source files. Create separate
functions for qca6290 and qca8074 for few hal rx tx
functions as the macro value differs between the chipsets.

Assign target specific hal tx, rx ops as part of hal_attach
and call respective hal tx, rx ops through callbacks.

Change-Id: Ibbf490c678c39fdd9d54191aad7aaec786db30ec
2018-07-21 00:03:20 -07:00
Akshay Kosigi
1a9c6d1d4c qcacmn: Rename osif_pdev and os_if_vdev in dp_pdev and osif_dev
structures

Rename osif_pdev to ctrl_pdev and os_if_vdev to ctrl_vdev in dp_pdev and
osif_dev structures respectively which are
pointing to objmgr_pdev and objmgr_vdev structures to maintain
uniformity

Change-Id: Ida95a1a90ea74513573f00c652338baee3df897a
CRs-Fixed: 2241362
2018-07-09 02:02:23 -07:00
Pramod Simha
21e69f5fe2 qcacmn: Handle reinjected pkts in REO null q execption
Prevent setting of nbuf length when it's non linear
i.e. contains an extension list. This happens when a reinjected
defragmented packet encounters a NULL q exception.

Change-Id: I937b1bf9e1461edd89dec62a9c9e17b8c3b9315f
CRs-Fixed: 2256075
2018-07-05 12:44:12 -07:00
Pramod Simha
366c1e01e6 qcacmn: Add WAR for fragmented TKIP MIC error
HW wrongly calculates MIC for the last fragment of TKIP
encrypted packets due to which this packet ends up on WBM
execption ring. Add code to handle the last fragment
in WBM execption ring.

Change-Id: I2dea5b3fbcb48036435e26f32f4641e7a0840bcd
CRs-Fixed: 2214749
2018-07-02 16:09:01 -07:00
Sravan Kumar Kairam
76fb31df31 qcacmn: Reduce logging in REO NULL queue desc error case
Excessive logging to console in dp_rx_null_q_desc_handle which
executes in soft irq context is leading to scheduler watch dog bite.
Reduce the severity of the logs to prevent flooding to the console.

Change-Id: I7cced611be6f59d31d315f797fe95ea465658009
CRs-fixed: 2242652
2018-06-14 18:35:29 -07:00
Prathyusha Guduri
02ed94801a qcacmn: Add support in DP for enabling multiqueue support
Enable multiqueue on VAP with 4 Tx and Rx queues in lithium.

In Rx path set the rx queue of skb based on the reo ring id on which it
is received.

In Tx path use the queue_mapping of skb to map to the hardware Tx ring
on which it has to be transmitted.

Change-Id: I103a21e91d1ed5c0e1d8441863d4fcd273b7bed9
2018-05-14 03:00:07 -07:00
Tallapragada Kalyan
bc62989ce4 qcacmn: Handle NULL objects properly
handle qdf_nbuf_unshare failure cases and NULL peer
in pn_error handler properly.

Change-Id: I9d271bed512a7e84a16d2b6c5b34f13235fc54e9
CRs-Fixed: 2221457
2018-05-11 16:18:10 -07:00
jiad
c26dfc85f4 qcacmn: Fix return buffer manager for REO error ring
Return buffer manager for error packets has been changed
from HAL_RX_BUF_RBM_SW3_BM to HAL_RX_BUF_RBM_SW1_BM.

Fix is to use DP_WBM2SW_RBM to check correct rbm.

Change-Id: Ib5ffe7161f85fe6a374f16a06a1f6f4f701abe0b
CRs-Fixed: 2231571
2018-05-07 09:14:39 -07:00
Ruchi, Agrawal
2755048d7d qcacmn: Remove NAWDS Rx Drop Count length counter
Remove NAWDS Rx Drop Count as it is not required,
drop packets in rx where length is not
available.

Change-Id: Ib4b41eefe88410137c3845090783ee43adb9147c
CRs-Fixed: 2191474
2018-05-07 07:38:53 -07:00