Commit Graph

705 Commits

Author SHA1 Message Date
Varun Reddy Yeturu
23fbb8796b qcacmn: Free pdev configuration parameters during pdev detach
Free the memory allocated for the pdev configuration parameters
during pdev detach so that there are no memory leaks

Change-Id: I856cc6e6082197e98ad105053f1e4cffc2d25c53
CRs-Fixed: 2444000
2019-05-27 04:23:32 -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
5b8283fe08 qcacmn: Flush rx cache frames at peer delete
Currently cached rx buffer frames are forwarded to stack
at the time of successful association completion. If the
association with the AP is unsuccessful frames are not
flushed and this leads to memory leak. To fix this clear
the cached buffers at the time of peer deletion.

Change-Id: Icec36376f9588dba8114f855ac9719b5735512e8
CRs-Fixed: 2452030
2019-05-23 09:31:03 -07:00
Venkata Sharath Chandra Manchala
c61826c476 qcacmn: Cleanup statistics
1. Move statistics API's to dp_stats.c
2. Move DP_TRACE_STATS to DP_PRINT_STATS
   as it is implemented based on target.

Change-Id: I62f3076a51ca35f0e12cdb0ff0230ea87c2baaf7
CRs-Fixed: 2453443
2019-05-20 20:53:27 -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
Karunakar Dasineni
1cd51ddb7c qcacmn: Optimize SRNG memory allocation
To avoid higher order allocations, allocate extra
bytes for base address alignment only if unaligned
address is returned.

Change-Id: I185e58150952cd7e1ae0039e4382973465de5f68
2019-05-15 21:34:36 -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
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
Venkata Sharath Chandra Manchala
bedc0cd113 qcacmn: Move statistics to dp_stats file
Move dump_stats API to dp_stats.c file.

Change-Id: I7cc3f438c58bb8e2521b7042472dd8436f513e58
CRs-Fixed: 2451204
2019-05-14 18:39:54 -07:00
Karunakar Dasineni
8075637d77 qcacmn: Add DP structures to minidump
Add calls to log some data-path structures to minidump.

Change-Id: Ib94e22e9e44ad314eaaff3d6ab57f2c60082e8ec
CRs-Fixed: 2444081
2019-05-14 16:23:09 -07:00
Shashikala Prabhu
3f2ceb8b9f qcacmn: Fix deadlock due to peer_ref_mutex and scn_lock
Deadlock happens when control path takes scn_lock and calls
dp_peer_unref_delete() which in tern tries to acquire peer_ref_mutex.
At the same time, if other core starts handling peer_unmap by acquiring
peer_ref_mutex and calls dp_reset_and_release_peer_mem() which in turn
calls ol_ath_node_free() and tries to acquire scn_lock leading to a
deadlock.

Fix this by unlocking peer_ref_mutex before calling
dp_reset_and_release_peer_mem().

Change-Id: I343a8ef8f0914f9245a06b2818c9cbbe1db5218f
CRs-Fixed: 2449878
2019-05-14 03:52:01 -07:00
nobelj
debe2b3b9c qcacmn: support enhance TX capture
support TX capture mode to deliver msdu along with meta data.

Change-Id: Ic84416cc4892e37bfb831dada136a4ff6b615a61
2019-05-10 12:39:30 -07:00
Karunakar Dasineni
4a6eff07b1 qcacmn: Track PPDU ID history for monitor rings
Track PPDU Id history from monitor status and destination
rings, and display as part of monitor stats.

Change-Id: I7b8985f93b1cdb6eb5210bba5a65e9bfb617a710
2019-05-06 14:58:32 -07:00
Venkata Sharath Chandra Manchala
3dfc614c3e qcacmn: Reduce trace level for stats
1. Reduce trace level of stats from fatal to info_high
2. Move stats APIs to dp_stats.c

Change-Id: I0b27a254075610fbbafcc8b09b72403ccb83473a
CRs-Fixed: 2446189
2019-05-06 10:44:11 -07:00
chenguo
73c7b7c744 qcacmn: more debugging information about invaild TX release source
1) Add one counter to track the invaild TX release source
2) Capture he descriptor that caused the issue
3) Print the invalid release source

CRs-Fixed: 2380964
Change-Id: I0dc410ae2e7c9df58ef53e3f20ca7979d086659e
2019-05-04 02:07:34 -07:00
Surya Prakash
07c81e7d77 qcacmn: Update rssi only when its valid
Peer stats struct members initial value 0, so when other functions call
to update peer stats have 0 rssi value which updates mininum
rssi since its the least value. So initialize the rssi with invalid
value initially

Change-Id: Ife033598c7ac47a9a26595f97bff058570d3e91f
CRs-Fixed: 2403735
2019-05-02 05:24:04 -07:00
Basamma Yakkanahalli
b85768e4e5 qcacmn: Remove HK header dependencies for ipq6018 compilation
Add target specific HW header for ipq6018 compilation.
Remove the 8074 header dependencies for 6018 compilation.

Change-Id: I8e45e3e039a4596c6722538405dcd381918fa6b1
2019-05-02 01:25:01 -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
jiad
09526ac0d1 qcacmn: Fix REO2IPA reo destination routing
Observed that when IPA offload is enabled, RX packets
are not routed correctly to IPA ring. Currently only
IX0 of REO_DESTINATION_CTRL_IX registers are remapped,
which only covers 3-bit reo_destination_indication of
range 0 to 7.

Fix is to remap REO_DESTINATION_CTRL_IX2|3 registers
so that reo_destination_indication of range 16 to
31 can also be routed REO2IPA ring when IPA offload
is enabled. Upon IPA offload is disabled, save values
of IX2 and IX3 are reset back to HW.

Change-Id: I3428b450ab10076d27c7628a3729e8cec088bd94
CRs-Fixed: 2434331
2019-04-30 02:13:28 -07:00
Om Prakash Tripathi
bf529e5f40 qcacmn: Fix deadlock due to vdev_list_lock and scn_lock
Deadlock happens when control path takes scn_lock and calls
cdp_peer_delete() which in turn tries to acquire vdev_list_lock.
If other core starts handling peer_unmap and holds vdev_list_lock
and tries to releases reference of control peer, which in turn
tries to acquire scn_lock leading to deadlock.
Pass vdev object intead of vdev id to dp_reset_and_release_peer_mem
which will avoid need for vdev_list_lock and fix thhis deadlock.

Change-Id: I805bb4958b9b5ec4b29d70ba67e7410572201a60
CRs-Fixed: 2426717
2019-04-29 06:13:31 -07:00
Venkata Sharath Chandra Manchala
8d583a8695 qcacmn: Validate mac_id for txrx_stats
Add a sanity check to avoid sending a htt
txrx_stats request with an invalid mac_id
parameter to firmware.

Change-Id: Iae980bbffdcf6759b6d467849c5ebc65628f17ba
Crs-Fixed: 2438693
2019-04-28 18:46:38 -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
Sravan Kumar Kairam
c71219ea55 qcacmn: Get tx success completions count
Add support to get tx success completions count for lithium
data path.

Change-Id: I3a3d1044f6b13dbf182c140a3a1463fc41b6bf98
CRs-Fixed: 2434653
2019-04-26 15:31:06 -07:00
Padma Raghunathan
93549e15a1 qcacmn: Framework to use pdev_id to lmac_id mapping from FW
FW assigns the pdev_id to lmac_id mapping for each platform(HK, CYP, etc).
This information is passed on to host via WMI_MAC_PHY_CAPABILITIES tlv.

Instead of hard-coding the mapping again in host, use the info sent by FW.

Change-Id: I01ad81e97a1b4aa1f0fea3951f6e8285a0f0c039
2019-04-25 06:02:23 -07:00
Amir Patel
46f39b6f40 qcacmn: Fix memory leak issue
Free allocated memory in dp_vdev_getstats()

Change-Id: Ie67570b8a6b3c3c28ec8f8be1a04c3b7054f02e4
2019-04-24 09:30:06 -07:00
Amir Patel
ac7d9465f9 qcacmn: Update correct tx rate, rx rate and sojourn stats
Currently we are upadting sojourn stats for all tid.
but rate stats maintains stats for only data tids 0-7.
updating stats for tid value exceeding 7 is leading it to
assert.
Update correct tx rate, rx rate and sojourn stats.

Change-Id: Ib2f5791aa7b8e85aac6283c46f58ce7e821a559b
CRs-Fixed: 2428648 2429575 2429575
2019-04-24 09:30:02 -07:00
jiad
5a4530f824 qcacmn: Support WDI 3.0 SW path intra-bss forwarding
Support WDI 3.0 SW path intra-bss forwarding. Major
difference for WDI 3.0 is the metadata info passed
from ipa driver in skb->cb[].

Previously intra-bss fwd decision is done by FW and
it passes fw_desc to IPA where IPA driver passes onto
WLAN driver. Now for WDI 3.0, FW is not involved in RX
path and SW path intra-bss fwd decision has to be done
in wlan driver.

Change-Id: Ibc2246620490905fd992a2df31cc6f241cc63592
CRs-Fixed: 2432831
2019-04-21 06:17:41 -07:00
Mohit Khanna
0255314127 qcacmn: Check delete.pending in get_vdev_from_vdev_id
Currently vdev deletion happens as a part of last
peer's unma and vdev creation happens in a different context invoked
by the upper layer in dp_vdev_attach_wifi3.

In a scenario when the old vdev is being deleted and a new one is being
created, with the same vdev id (e.g. P2p -> SAP transition), its
possible that the old and new vdevs co-exist in the pdev->vdev_list
at the same time. In such a case, the API (get_vdev_from_vdev_id) can
return the old stale vdev, even when a new vdev has been created. This
is not the expected behaviour.

Check for "delete.pending" flag before returning the vdev. If the flag
is set, skip that vdev.

Change some logging to dp_ logging functions.

CRs-Fixed: 2432430
Change-Id: Icadd84059dfbab12910678e5b24007010c15b6a8
2019-04-19 07:53:39 -07:00
Kai Chen
52ef33fca3 qcacmn: Support enhanced Rx capture
Support Rx capture mode to deliver first 128 bytes of
each MSDU, along with some meta data.

Change-Id: I1ffa8b1a029d46f68aa78520bacc019de8af7a82
2019-04-19 04:08:56 -07:00
Pavankumar Nandeshwar
1ab908e62b qcacmn: add CDP function to process CP peer delete response
Add a CDP function which processes the peer delete response
and deletes the static ast entry for the peer

Change-Id: Id646979ed07bd82609ca08e7ef3201382d07b1de
CRs-fixed: 2385115
2019-04-12 02:56:39 -07:00
Chaitanya Kiran Godavarthi
e541e9ccda qcacmn: Add Tx AMPDU statistics
Count of MSDUs Tx with AMPDU aggregation and
MSDUs without AMPDU aggregation is maintained. This
count is obtained from per ppdu stats.

Change-Id: I7c38846534bbe5f2fd0a9b3602a9d453e1c1f449
2019-04-10 05:27:06 -07:00
Pamidipati, Vijay
37d107d2d1 qcacmn: HIF schedule latency measurement
Add support to measure interrupt latencies, store them
in different "bins" and display the constructed histogram
through user command.

Change-Id: I268be6b39745d550ac7db5d321c2d1fdb2d17d41
CRs-Fixed: 2365812
2019-04-09 04:00:32 -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
phadiman
86911cd6e0 qcacmn: Filter data packets in m_copy mode
Filter out data packets from mon destination
ring in m_copy mode as we already receive
first 100 bytes of data in mon status ring

Change-Id: I09321aa42b850d7b3cdc0bda4c7c51f79a6f850e
2019-04-08 10:50:21 -07:00
Sravan Kumar Kairam
d55a74c8c9 qcacmn: Register tx completion callback
At the time of dp vdev registration, register tx completion
callback so that tx completions will be called for packets
whose tx completion is requested.

Change-Id: Ic3402f41a0962111901271fc8669974dfea2eb1c
CRs-Fixed: 2416554
2019-04-06 01:54:51 -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
Chaithanya Garrepalli
a5ad5822aa qcacmn: clean up AST entries in target recovery case
In case of target recovery clean up the AST entries on
peer before peer cleanup

Change-Id: Ib4f119ec259f0de03b0513a8f0dc8ef4b431f24a
CRs-fixed: 2419890
2019-04-01 02:28:16 -07:00
Jinwei Chen
a42581d479 qcacmn: remove nss info in host tx stats
TX NSS field is not supported from WMB TX completion ring, remove
the NSS print in host TX stats in case introducing some confusion.

Change-Id: I594eb5cd7b2bf88de14f45ff6ad8e3248eb36617
CRs-Fixed: 2350789
2019-03-30 09:37:31 -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
Debasis Das
c39a68da37 qcacmn: Support for 8021p pcp to tid mapping
Add HAL and DP support to configure
8021p PCP to TID mapping tables into Hardware.

Change-Id: I8a54970c8c4ef56f3c487b6e648c4411b3abde0e
2019-03-25 14:24:36 -07:00
Naga
65fad66752 qcacmn: Add change to skip monitor ring cfg
Add change to skip monitor ring configuration
for smart and lite monitor through dp_set_monitor_mode
API instead will be handled to configure
cdp_txrx_set_pdev_param from caller as required
during restart, stop and up path.

Change-Id: If842399c64601049efdf9233a83ede5ce368802c
CRs-Fixed: 2421573
2019-03-24 22:26:30 -07:00
Mohit Khanna
3d1e1b7602 qcacmn: Prevent rate stats from printing in kmsg
Do not print rate statistics on the console or kernel logs. Excessive
logging in kernel messages can lead to kernel panic.

Change DP_PRINT_STATS to not print in kernel logs.

Note that this is an interim solution. Ideally these prints from DP
module should be QDF_TRACE_LEVEL_DEBUG and logged to QXDM. Currently
DEBUG trace level is disabled for DP module.

Change-Id: I54af98eda0dd4ea53ae20f25ced6b03287d8b4e4
CRs-Fixed: 2414635
2019-03-24 12:58:12 -07:00
Amir Patel
468bded892 qcacmn: Add RDK statistics changes for Hawkeye
Add RDK statistics changes to collect below stats
a. Tx rate statistics
b. Tx sojourn statistics
c. Rx rate statistics

CRs-Fixed: 2416141
Change-Id: I0c8127cd387b7665a76847f4125977bbb8c5a57a
2019-03-21 23:04:43 -07:00
Shashikala Prabhu
550e69c726 qcacmn: Restrict the tx descriptors for low mem config
For low mem config, use user configured max tx descriptors to limit the
allocation of software tx descriptors.

Use dp_txrx_pflow_update_pdev_params function to print stats and to update
pdev param.

Change-Id: I8fa6f0bb8841de68e8dc205ffcb0fde264f1b0e0
CRs-Fixed: 2414452
2019-03-15 23:15:06 -07:00
Varsha Mishra
3e9d647162 qcacmn: Fixing display of Vow Stats
Adding more fields to vow stats display function.

Change-Id: Ic5227e994e55c0ebc99351051d5b409ba0c3f627
2019-03-15 23:15:02 -07:00