Commit Graph

1017 Commitit

Tekijä SHA1 Viesti Päivämäärä
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
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
jiad
3f43a6924b qcacmn: Release SMMU IPA mappings after pipes are disabled
Currenlty RX buffer mappings to IPA domain are released when
REO2IPA ring are disabled but before IPA pipes are disabled.
There will be chances that IPA still accessing buffers with
mappings released, which could lead to SMMU fault.

Fix is to release SMMU mappings to IPA domain until IPA pipes
are disabled.

Change-Id: I62ac99e6a9b83cfd1e70a17ffacdea3ca3720a5c
CRs-Fixed: 2436812
2019-04-29 09:34:04 -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
Amir Patel
2321668837 qcacmn: Update tx stats for non-qos frames
Currently there is no support to update tx stats for
non-qos frame. Update tx stats for non-qos data frames

Change-Id: Ib61dd6e3b0c676b5af806c4b1e5cca22ea6ffaa5
CRs-Fixed: 2421925
2019-04-26 06:44:37 -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
Rakesh Pillai
9498cd70f4 qcacmn: Serialize dp reorder queue setup wmi command
Refactor the code to move the serialization of
rx reorder queue setup wmi command to target-if
layer.

CRs-Fixed: 2431099
Change-Id: I6b383f5e875fec55c3586dfee576894f6eb35f73
2019-04-23 16:18:54 -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
syed touqeer pasha
8a0928bf2f qcacmn: Handle flood of update ast messages
Avoid duplicate update AST WMI messages being sent to FW.

Change-Id: Ic2dac80a3ec13e1bef57140b512555dcbabd0587
2019-04-20 02:23:26 -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
Venkata Sharath Chandra Manchala
766b69acf5 qcacmn: Print OFDMA rate stats from firmware
Print OFDMA tx and rx rate stats received
from firmware as part of txrx_stats 9.

Change-Id: I081016480bdb0d161e33be7ee789497c43ad6cc0
CRs-Fixed: 2415731
2019-04-19 04:09:07 -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
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
Shashikala Prabhu
f7786d3822 qcacmn: Change the data type of average/roundup tx rate
The datatype of average and round up tx rate was uint32_t which truncates
the upper byte of the average and round up tx rate value.

changing the datatype of average and round up tx rate from uint32_t to
uint64_t.

Change-Id: I3809ba7cfc73ec0b4609981e70d57112ac958f33
CRs-Fixed: 2409751
2019-04-16 09:09:38 -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
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
Chaithanya Garrepalli
58e7c5e121 qcacmn: In add ast entry call the callback inside ast lock
In dp_peer_add_ast() call the CP callback inside ast lock
to ensure the ast add and delete commands are called in a
sequence

Change-Id: If76bf8dca34555e56074e74792f3283b6b5a28d3
CRs-fixed: 2424637
2019-04-11 12:38:49 -07:00
jiad
cc43b53e87 qcacmn: Allocate IPA TX skb buffers with srng unlocked
On low memory system, skb allocation failures are observed in
dp_tx_ipa_uc_attach during driver loading phase. Per kernel
memory team analysis, failures are caused by large amount of
atomic allocations. Currently when allocating IPA TX skbs,
srng spinlock is first grabbed and then skb buffers are being
requested, which makes skb allocation happen in atomic context.

Fix is to make skb allocations with srng unlocked since it is
safe for race conditions during driver loading time. This ensures
skb allocations in process context.

Change-Id: I1624276c087c8247d672fb7cea5daded07ab93a3
CRs-Fixed: 2426489
2019-04-11 01:14:17 -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
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
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
6d22eeb468 qcacmn: Tx desc alloc: remove default wakeup action
When the status is FLOW_POOL_ACTIVE_PAUSED, all queues are expected to
be paused. Still some on the fly packet can make it to the driver. In
such a case, the function dp_tx_desc_alloc takes a default action of
WLAN_WAKE_NON_PRIORITY_QUEUE. This is incorrect, since it will wake all
non priority queues, when they should be paused.
Make default action as WLAN_NETIF_ACTION_TYPE_NONE. If this is the
action to be taken, donot call the pause_cb from dp_tx_desc_alloc.

Rate limit log levels in case dp_tx_desc_alloc fails.

Change-Id: I1ef3018e90576d2c3aaa0d10d56e9b155681271b
CRs-Fixed: 2421813
2019-04-08 22:01:47 -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
jiad
443059e723 qcacmn: Set pcie addr flag for IPA rings
IPA driver adds is_txr_rn_db_pcie_addr and
is_evt_rn_db_pcie_addr in ipa_wdi_pipe_setup_info and
ipa_wdi_pipe_setup_info_smmu structure to check if doorbell
address is DDR address or PCIe memory mapped address. Thus
set the addr flag accordingly for IPA transfer and event
rings.

Change-Id: Ia55d14535db3818439e3884cfb61c3a1d81b86fb
CRs-Fixed: 2422162
2019-04-08 06:23:35 -07:00
Ankit Kumar
14b9622193 qcacmn: Flush ME desc while mcastenhancement disable
Flushing ME descriptor while disabling mcastenhancement feature.

Change-Id: Ieeaab082d09135b4c803d68041ebf9b4bf7bb144
CRs-Fixed: 2425078
2019-04-08 04:29:16 -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
Varsha Mishra
0c201e23a3 qcacmn: Typecast address before assigning in multicast enhancement path
Not typecasting 64bit value to 16bit value before assigning is causing
corruption of nearby structure members. Typecasting this value fixes
this corruption.

Change-Id: Iddaf697eb90241f9948aeaafe7985b8c2ea63048
2019-04-05 08:37:38 -07:00
Amir Patel
bb69cfaeda qcacmn: Compute average rssi
Compute average rssi from last packet rssi

CRs-Fixed: 2419240
Change-Id: I20851e3804412808393121ce882245ee8f110d5d
2019-04-05 03:33:32 -07:00
phadiman
b1007509b1 qcacmn: Free memory only if it is allocated
peer attach failed due to memory allocation failure
which triggered soc restart, as part of soc restart
peer detach tried to free AST hash table and entries
which was not allocated.

For peer hash table and AST hash table free only if
the memory is allocated

CRs-Fixed: 2425963
Change-Id: Ib7a624c91f544f1a8da2b96b4d342a13b9f3b162
2019-04-03 23:52:53 -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
Sravan Kumar Kairam
4f6b8f5608 qcacmn: Serialize dp reorder queue setup wmi command
Currently rx reorder queue setup command is sent from soft irq
context. There exists race condition between resume command sent
from worker thread context and this command sent from soft irq
context. In parallel execution on different cpu cores if the wmi
suspend flag is not sent to false as part of resume command at the
time of sending the rx reorder queue setup wmi command, the command
will not be sent. So serialize the rx reorder queue setup command
by posting to scheduler thread.

Change-Id: Ib4d0fb99df142be39d2d35e7f405130c0747efac
CRs-Fixed: 2410175
2019-04-02 15:16:11 -07:00
Keyur Parekh
44d8f8f9b1 qcacmn: Populate LTF size for Rx stats
Populate LTF size value from TLV for HE and modify
HE_LTF enum value to match with Firmware values

Change-Id: I8e5cce31cbae4aa8722050b06d89c933b74aa752
2019-04-02 11:17:38 -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
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
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
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
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