Commit Graph

98 Commits

Author SHA1 Message Date
Akshay Kosigi
6eef9e3c6e qcacmn: Clean up DP API's
Remove DP API's which are not being used/defined.

Change-Id: I8a1ee7e3156873227131b526793f464ff4444312
CRs-Fixed: 2483400
2019-07-27 13:42:28 -07:00
Kiran Venkatappa
115309a008 qcacmn: Delay monitor buffers replenish to monitor VAP create
Monitor buffer are required only when monitor VAP is created. Allocate
these buffers only when montior VAP is created. This provides memory
savings when no monitor VAP is created/required.

Change-Id: I3ddaef00615f00fd13adb2789469a62f1a0af165
CRs-Fixed: 2491873
2019-07-24 21:43:36 -07:00
Saket Jha
16d8432a3d qcacmn: Reduce log level to avoid console logging
Reducing the log level of debug log to avoid console logging
and instead get it on the cnss diag log.

Change-Id: Ie5a1eb6f45ffa97790d91528a173b16319ec760b
CRs-Fixed: 2486057
2019-07-16 18:40:26 -07:00
Saket Jha
7f89014195 qcacmn: Add WAR to ignore duplicate RX desc
Check if host is reaping a descriptor which is
already reaped then drop RX desc processing instead of asserting.
Macro DUP_RX_DESC_WAR added before dp_rx_dump_info_and_assert function
which does not assert for the case WAR is enabled.

Change-Id: I4f3c1cc16de79f2483cd415582970e093e81d465
CRs-Fixed: 2486057
2019-07-16 18:40: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
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
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
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
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
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
Mohit Khanna
662379ff1e qcacmn: Remove RX_BUFFER_SIZE from dp_rx.h to fix compilation
RX_BUFFER_SIZE macro got introduced by mistake during rebase. The macro
is present in hal_rx.h. Removing the extra macro.

CRs-Fixed: 2382076

Change-Id: Ia66079d6d4543b4e3fd99e9f0c0376353a92aa9c
2019-04-03 14:23:09 -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
c30b51c378 qcacmn: Reset unmapped flag in during replenish logic
This rx_desc flag was removed from the function by a previous change
with id Iaa345d04b8d48814f88ed6e2237fc67696f6a20c. This flag is
needed to keep track of whether the nbuf associated with a rx_desc has
been unmapped or not. Set it to 0 when a mapped nbuf is associated with
the rx_desc.

Change-Id: I24e103c5698a556f478a3f7917076d31b5490661
CRs-Fixed: 2393056
2019-04-02 11:17: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
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
phadiman
7dd261d614 qcacmn: Free Rx Desc during WiFi unload
Rx desc pools are reused across wifi up
and wifi down, only nbufs part of these
pools are free during down

Free Rx desc pools during WiFi Unload

CRs-Fixed: 2418941
Change-Id: I5cc3a82d99efd84f51f9eb048cf06da5a4495e55
2019-03-26 04:13:12 -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
phadiman
2c146ea33a qcacmn: Memory Leak in Rx Frag Path
qdf_nbuf_cat API used to call skb_free
on src address but was later modified
so that the caller of qdf_nbuf_cat is
responsible for freeing the src memory

Due to this change in  the API, the
freeing of src memory on caller side
was not taken care and will lead to
mem leak

Hence add qdf_nbuf_free after calling
qdf_nbuf_cat if it returns success.

If qdf_nbuf_cat returns failure, then
freeing is taken care as part of error
handling in parent function.

CRs-Fixed: 2411320
Change-Id: If50eb9279d0cf26a0cf57444cb69e56f11995720
2019-03-08 17:24:08 -08:00
Tallapragada Kalyan
f07025a708 qcacmn: Do not drop multicast pkts in DBDC QWRAP mode
We are not suppose to drop multicast loop backedpkts
received on a different radio. instead they should be
sent to dp link aggregator for setting certain flags.

Change-Id: Idae19c1b6a2caf2a1b2b58fac531c43e9c24db51
CRs-Fixed: 2351300
2019-02-12 08:45:09 -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
Subhranil Choudhury
5079d52ebf qcacmn: Split the wds src port learn function
Splitting the wds srcport learn function to add:
1. A wrapper function where host extracts the required fields from
   nbuf cb and rx_tlv header.
2. A common function which can be called from both host path
   as well as offload path.

Change-Id: I2f2c0580c049f48395a3e0a265e3fb5d8aed6774
2019-01-07 00:12:49 -08:00
Mohit Khanna
705149946b qcacmn: Fix large RX desc pool memory allocation
During dp_rx_pdev_attach and dp_rx_pdev_mon_buf_attach we are allocating
three times as many rx descriptors as there are entries in the ring for
AP usecase. This is not needed for MCL and may need to kmalloc
failures for allocating that much contiguous memory

Allocate only as many RX descriptors as there are ring entries for MCL
usecase.

Change-Id: I8b559a85c3899bcbdc520e71ba5da409314db160
CRs-Fixed: 2342957
2018-12-15 10:07:15 -08:00
sumedh baikady
da15920d5b qcacmn: Support for smart monitor on HKv2
Add support for smart monitor feature on HKv2.
For HKv2, NAC filtering is done by HW and NAC is
programmed directly in the AST table. The NAC entries
in AST table have monitor direct bit set and this
is obtained by host via monitor status ring.
host subscribes for packet header in MD packets.

To these filtered packets radiotap header is added
and delivered to the stack.

Change-Id: I123f986531943e376ac5c492540e01f0b03348c4
2018-12-13 16:46:07 -08:00
Chaithanya Garrepalli
0a5f71bca1 qcacmn: remove the QDF_BUG in src port learn when peer found
Remove the QDF_BUG in sa valid case when AST entry is not found
and peer is found as this can be a valid case in DBDC repeater

In DBDC repeater case we may receive the L2UF frame sent on 5G
radio on 2G interface

In this case SA will be valid and peer will be found for 5G VAP
mac address, but ast entry will not be found in ast_table as we
dont receive peer map events for STA vaps

Change-Id: I22e8582605f59a8691d8fcbb43627655d1a6500c
2018-11-20 12:19:12 -08:00
Karunakar Dasineni
700ad73754 qcacmn: WAR for duplicate buffers in monitor mode
WAR to discard duplicate indications (buffers and link descriptors)
from monitor DMA seen sometimes on RXDMA2SW ring.

Change-Id: I687b782f54fbbf85ae932ee833ac9263b5879ca6
2018-11-17 10:48:13 -08:00
Om Prakash Tripathi
f8ccc18f6a qcacmn: Check delete in progress before adding wds entry
In Repeater configuration when a STA first associates to Root AP
on some radio and then roams quickly to repeater AP on other radio,
some times target assert is observed due to below race condition.
1. Root AP sends peer delete command to FW on radio X and clears
   its AST entry. This peer delete command not processed by FW yet.
2. STA roames to repeater AP and starts ping traffic to Root AP.
3. Root AP receives the ping frame and tries to add wds entry on
   radio Y as AST entry was not found.
4. FW receives add wds entry on radio Y while on radio X an
   direct peer ast entry for same mac was present.
5. FW asserts.

Change-Id: I02ac409f2b4f6b2ea307d99c5f1fdab7776ca938
CRs-Fixed: 2347818
2018-11-16 05:10: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
phadiman
6ba855ca40 qcacmn: Delete existing AST on different radio
In STA roaming scenarios it is possible that an
AST entry for a given MAC address already exist
on the other radio

Delete the existing WDS AST entry on other radio
if present before adding the new wds entry on the
current radio as part of WDS source port learning

Change-Id: I15ef79be0441f3b27fd55e728f5bb27b073c6469
CRs-Fixed: 2334625
2018-10-18 00:21:21 -07:00
Chaithanya Garrepalli
139f6f495b qcacmn: add AST entry when SA is valid and AST not found in host table
SA might be valid for the mac address after AST entry is deleted from
host AST table as GSE caches the AST entry on other radio even after
it is deleted.

In this case send add AST with updated peer and vdev

Change-Id: I6178785f158a0323bb5dc86179db29785c3a392e
2018-10-18 00:21:18 -07:00
Tallapragada Kalyan
5e3a39c8d3 qcacmn: add support for Secondary HMWDS ast entry
add support for Secondary HMWDS ast entry

Change-Id: Ibf77659cbc2d7e2b536736d89e747549e269e68c
CRs-Fixed: 2312270
2018-10-06 08:16:22 -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
Radha krishna Simha Jiguru
273407908f qcacmn: Add AST type to distinquish bss on STA
When a BSS peer gets associated with vap configured in sta mode,
the ast type associated with that entry should be different from
that of regular static entries, The reason being bridge on root AP
can pick up the mac address of AP VAP.

Change-Id: Ie322a015d883e2712f41623f71ccbc255b99baf3
2018-09-18 06:17:18 -07:00
Chaithanya Garrepalli
2467ed1445 qcacmn: avoid wds source port learning for STA in HKV2
Changes to avoid WDS source port learning in STA mode
if ast override feature is supported by HW

Change-Id: I248c8815429e7417dcf3f451912ee5f037af9c25
2018-09-15 21:21:23 -07:00
Mohit Khanna
7ac554bda5 qcacmn: Support for DP RX Threads
Add support for DP RX Threads as a part of the FR. Multiple RX
threads can be enabled from the ini. The code is added in a new DP
module outside of the cmn project.

Change-Id: Id966c46c2799d23c2a4fa1c884610955afed3565
CRs-Fixed: 2256470
2018-08-24 18:35:45 -07:00
Pamidipati, Vijay
13f5ec2749 qcacmn: Enable DBDC WAR in Root AP mode
In current code, DBDC WAR for AST applies only for repeater mode.
Add support to enable this even in AP modex, for use in SON usecases

Change-Id: I82791fbae0cc86ac6d951c4d85b709c755334273
2018-08-17 10:30:45 -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
Pamidipati, Vijay
3756b7603e qcacmn: DBDC repeater mode changes in AST
Add new ast_get_type API for DBDC repeater feature.
Add other changes required in WDS and MEC handling
required for DBDC repeater feature to function properly.

Apply sta kickout logic to handle roaming cases
only within same radio. For roaming across radios, DP should
rely on control path.

Change-Id: If9b35720082dd87de40827843a14238e818bc454
2018-08-06 13:43:58 -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
Jeff Johnson
ff2dfb217b qcacmn: dp: Fix misspellings
Address the following issues in the dp folder:
CHECK: 'availble' may be misspelled - perhaps 'available'?
CHECK: 'catagory' may be misspelled - perhaps 'category'?
CHECK: 'endianess' may be misspelled - perhaps 'endianness'?
CHECK: 'exceded' may be misspelled - perhaps 'exceeded'?
CHECK: 'explicitely' may be misspelled - perhaps 'explicitly'?
CHECK: 'Inteface' may be misspelled - perhaps 'Interface'?
CHECK: 'lengh' may be misspelled - perhaps 'length'?
CHECK: 'messsages' may be misspelled - perhaps 'messages'?
CHECK: 'miscelleneous' may be misspelled - perhaps 'miscellaneous'?
CHECK: 'Ouput' may be misspelled - perhaps 'Output'?
CHECK: 'poiter' may be misspelled - perhaps 'pointer'?
CHECK: 'Poiter' may be misspelled - perhaps 'Pointer'?
CHECK: 'psuedo' may be misspelled - perhaps 'pseudo'?
CHECK: 'registerd' may be misspelled - perhaps 'registered'?
CHECK: 'requred' may be misspelled - perhaps 'required'?
CHECK: 'retreive' may be misspelled - perhaps 'retrieve'?
CHECK: 'succesfully' may be misspelled - perhaps 'successfully'?
CHECK: 'vaild' may be misspelled - perhaps 'valid'?
CHECK: 'virtaul' may be misspelled - perhaps 'virtual'?

Change-Id: I66b9cdc6115dd133b385e60c9d02cefd1bd0bac3
CRs-Fixed: 2241574
2018-05-19 19:41:02 -07:00
psimha
4d9c3f9806 qcacmn: Add sanity checks before retrieving rx_desc
Add sanity checks for pool id & index extracted
from the SW cookie field within buf_addr_info.

Change-Id: Icf21b94fa05f6f8887b8c7a17896348f25436dda
CRs-Fixed: 2220030
2018-05-16 19:48:38 -07:00