Commit grafiek

42 Commits

Auteur SHA1 Bericht Datum
Ananya Gupta
5ecc8a6cbc qcacmn: Release peer ref count after handle usage is complete
Race condition is observed as dp_ipa_rx_intrabss_fwd is
accessing da_peer after releasing the ref count of the peer
while that peer is deleted parallelly.
To fix this, da_peer and sa_peer are only assigned if the
peers are found in the vdev.

Change-Id: Ib03835a509d656eb11946c075b820555b04934f8
CRs-Fixed: 2723448
2020-07-06 08:34:07 -07:00
Nisha Menon
af7af90906 qcacmn: SMMU fault as iova to phy address is invalid
IPA pipes are not disconnected successfully when the last
client disconnects and despite that smmu mappings given
to IPA for the buffers are released.
Assert instead of releasing the smmu buffer mappings as
IPA has stalled and is in a non-recoverable state.

Change-Id: I9a9a35a4019726421d7435b62defe8da4907d4e0
CRs-Fixed: 2627889
2020-03-09 20:58:50 -07:00
Shashikala Prabhu
03a9f5b19c qcacmn: Add framework to configure varying data/monitor buf size
Add a framework to configure varying buffer size for both data and monitor
buffers.
For example, with this framework, the user can configure 2K SKB for Data
buffers, monitor status rings, monitor descriptor rings, monitor
destination rings and 4K SKB for monitor buffers through compile time.

Change-Id: I212d04ff6907e71e9c80b69834aa07ecc6db4d2e
CRs-Fixed: 2604646
2020-01-29 18:08:33 -08:00
Sravan Goud
a4030a4261 qcacmn: Access initial ipa tx doorbell after enable pipes
Currently host writes to TX doorbell register after ipa connect
pipes to indicate number of free TX buffers. In case when IPA
clocks are off and host tries to access the register will leads
to invalid access. So access the tx doorbell register after ipa
enable pipes which makes sure IPA clocks are always on.

Change-Id: If11fdc9c408ebf7f22eef6a020b507bc39ee6a8e
CRs-Fixed: 2599029
2020-01-18 01:43:26 -08:00
Jinwei Chen
1d2e65a76c qcacmn: fix STA + SAP IPA de-frag issue
Currently wlan host will re-inject defrag data with RBM 6 to
REO, this data buffer will go to REO-->REO2SW4-->IPA-->FW2RXDMA,
fix below issue introduced by this RX buffer path.
a. FW assert due to FW2RXDMA DMA address not 4 bytes aligned.
b. host skb double allocation due to qdf_nbuf_linearize() for frag skb.
c. Invalid RBM 6 for fragment RX due to RX buffer resue.

Change-Id: I36d831fc14b6b9aa0cea32682823de348f7eecd3
CRs-Fixed: 2591453
2020-01-03 04:43:01 -08:00
Pavankumar Nandeshwar
a234716d1d qcacmn: cmn_ops changes in datapath for umac-dp decoupling
Change cmn_ops APIs to replace pdev, vdev and peer
dp handles with pdev_id, vdev_id and peer mac address
along with dp soc handle

Change-Id: I5716a87cad56b1dfe8dd56f193bbb6ff923a6af1
2019-12-27 03:24:59 -08:00
Yeshwanth Sriram Guntuka
65d547730f qcacmn: Cleanup local peer id from DP APIs
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 local peer id usage from DP APIs.

Change-Id: I930e1c6a09092a373c093239632d6f310fee18e2
CRs-Fixed: 2529041
2019-12-06 01:52:16 -08:00
Sravan Goud
ba1d5aa876 qcacmn: Record last 32 dp ipa reo remap register writes
For debug purpose of issues related to IPA NOC errors and
register writes not going through, record last 32 dp ipa
reo remap register writes which are outside of non shadow
region registers.

Change-Id: If2dfe7250bb2a6bbe0e180df137c92b43a150b2c
CRs-Fixed: 2571608
2019-12-01 13:11:32 -08:00
Rakesh Pillai
eee5d783b7 qcacmn: Skip enable/disable autonomy in SSR case
In case of SSR, the host driver is not supposed to
access any of the UMAC registers. The disable or
enable of autonomy during SSR can cause an invalid
access to the REO registers.

Avoid the REO registers access during SSR case.

CRs-Fixed: 2563761
Change-Id: I7e260c2894d8254eafba7038bc2677b52b6eba85
2019-11-22 04:13:00 -08:00
Vevek Venkatesan
2cc8c5d14d qcacmn: cdp: Converge cdp_ipa_ops
Currently cdp ops are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev_id or vdev_id or peer mac address,
which will be used to get the respective handles,
and hence avoiding the unwanted access of the
handles if it has been deleted.

- ipa_get_resource
- ipa_set_doorbell_paddr
- ipa_set_active
- ipa_register_op_cb
- ipa_get_stat
- ipa_tx_data_frame
- ipa_uc_get_share_stats
- ipa_uc_set_quota
- ipa_enable_autonomy
- ipa_disable_autonomy
- ipa_setup
- ipa_enable_pipes
- ipa_disable_pipes
- ipa_rx_intrabss_fwd

Change-Id: Ieb7e48d11a69a1e4a92a7114042b1db72d5f4b65
CRs-Fixed: 2540862
2019-11-21 06:13:07 -08:00
Jia Ding
c031575beb qcacmn: Set default value for REO dest ctrl register
NOC error is observed when PCIe accesses IPA GSI RX doorbell
register even before IPA clocks are ON. Currently for SAP vdev,
default REO dest is set to REO2SW4 and with RX hash being
disabled, packets will finally land on REO2SW4 ring. If packets
arrive on REO and are routed to SW4 ring, REO HW will ring
IPA GSI doorbell address and thus the NOC error will occur
because IPA clocks are still OFF which should be set to ON
by WLAN via ipa_wdi_enable_pipes API.

Fix is to set DEST_RING_MAPPING_4 to SW2 for REO dest ctrl
register such that packets arrived before IPA pipes are
enabled will be handled by WLAN host. Note that
DEST_RING_MAPPING_4 will be remapped to SW4 after IPA pipes
are enabled.

Also correctly configure REO dest ctrl register when RX hash
feature is disabled when enabling and disabling IPA
autonomy.

Change-Id: Ifd471bbe2e4a0e66e080d9ae51fb2a3600fd87e6
CRs-Fixed: 2554023
2019-11-06 20:08:56 -08:00
Venkata Sharath Chandra Manchala
c9e344de3d qcacmn: Set the reo destination ring ctrl register
The reo destination ctrl registers
HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR and
HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR are used for mapping
msdu packets to different reo rings.
For QCA6390,
reo remap values varied from 0 - 7 so every 3 bits in
the register were used to map to a particular reo ring.
For QCA6490,
reo remap values vary from 0 - 9 as two extra reo rings are
added so we are using 4 bits in the register to map to a
particular reo ring.
Use the macros directly provided in the header files
to map reo rings.

Change-Id: I6d64266d3b388b3453b7df959048e3d693cf0a40
CRs-Fixed: 2544102
2019-10-30 05:58:57 -07:00
Nisha Menon
f7c5baa657 qcacmn: Fix for IPA rx buff map failure
Add an atomic variable to indicate IPA pipes are connected.
Use it to ensure that SMMU mapping for rx buffers is sent
to IPA even if REO is not remapped but IPA pipes are connected.

Change-Id: I5d82dc073fc2f0de6df102f7bfd2a1e945297aa8
CRs-Fixed: 2552128
2019-10-28 13:31:20 -07:00
Jia Ding
fef509bc58 qcacmn: Properly handle RX REO reinject packets
Currently for REO reinject path, first fragment is in the
linear part of the skb buffer while other fragments are
appended to skb buffer as non-linear paged data. The other
point is that for REO reinject buffer, l3_header_padding is
not there, meaning ethernet header is right after struct
rx_pkt_tlvs.

Above implementation will have issues when WLAN IPA path is
enabled.

Firstly, IPA assumes data buffers are linear. Thus need to
linearize skb buffer before reinjecting into REO.

Secondly, when WLAN does IPA pipe connection, RX pkt offset
is hard-coded to RX_PKT_TLVS_LEN + L3_HEADER_PADDING. Thus
need to pad L3_HEADER_PADDING before ethernet header and
after struct rx_pkt_tlvs.

Change-Id: I36d41bc91d28c2580775a1d2e431e139ff02e19e
CRs-Fixed: 2469315
2019-10-21 03:46:39 -07:00
Mohit Khanna
c6e059aca0 qcacmn: IPA WAR for WB2SW release ring
WAR for IPA_OFFLOAD case. In IPA_OFFLOAD case, host provides buffers in
the WBM2SW release ring designated for IPA for TX. So this ring is used
to release TX completions into, by WBM, and also by IPA to pick up
buffers from, for TX.

In some cases, its observed that when  WBM tries to release a buffer
into this ring, however the ring is full. This causes back pressure,
resulting in a FW crash.

By leaving some entries with no buffers attached, WBM will be able to
write to the ring, and from dumps we can figure out the buffer which is
causing this issue.

Change-Id: Ia0450d36dec643f2631fea13cb0b8facba7425b8
CRs-Fixed: 2535170
2019-10-02 20:01:31 -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
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
c74162c269 qcacmn: Add code to remove void pointer usage
Add code to use cdp_vdev instead of void pointer for
API dp_tx_send_exception and dp_tx_send_mesh

Change-Id: I63ca5a62c2a8cd6feb906181702888814650dfce
CRs-Fixed: 2480836
2019-07-27 13:42:24 -07:00
Saket Jha
c73413881e qcacmn: Correct input type for qdf_mem_zero
In dp_ipa_setup function, the function qdf_mem_zero is called
and should receive a pointer instead of address to a pointer for tx
and rx when they are called. These pointers are also initialized to
NULL when declared locally.

Change-Id: Iec9c76c63cc2ec00bdfb54497cca2f22fabff045
CRs-Fixed: 2469428
2019-06-21 08:12:04 -07:00
jiad
a833f30506 qcacmn: Properly map RX buffer pool to IPA SMMU domain
Currently for WDI 3.0, IPA runtime enablement is done in the
way that dp_ipa_enable_pipes API is first invoked and followed
by dp_ipa_enable_autonomy API. With SMMU S1 enabled, RX buffers
are mapped to IPA domain in dp_ipa_enable_autonomy. However RX
buffers could be provided to IPA once after dp_ipa_enable_pipes
and this could lead to possible SMMU fault.

Fix is to map RX buffers to IPA domain before dp_ipa_enable_pipes
API.

Change-Id: Ifdad2db6fa26da06a91b84de8f8603cbc779dd67
CRs-Fixed: 2467966
2019-06-17 06:23:28 -07:00
Varsha Mishra
1f4cfb6c58 qcacmn: Fix tx completion and rx stats per wbm/reo ring
Tx completion stats should be counted per wbm ring on tx completion
and not globally. Similarly, rx stats should be counter per reo ring.
Change-Id: I1e4af0d38b23e60de78ca03316861db08ff0811a
2019-05-31 07:40:18 -07:00
jiad
3c91fb553a qcacmn: Set default REO destination ring to SW4
For MDM platforms, set default REO destination
ring to SW4 for STA vdev, which is same as SAP vdev.

Note that RX hashing is still enabled for STA vdev.
Also REO destination are run-time remapped when IPA
automony is enabled and disabled.

Change-Id: I49fa523673e7b736008679adec55821e198e8417
CRs-Fixed: 2456786
2019-05-31 02:29:59 -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
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
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
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
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
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
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
Sravan Kumar Kairam
fc3c8cf330 qcacmn: Add support for IPA using GSI
When IPA using GSI instead of UC different IPA TX and RX
clients needs to be configured. In this change when IPA
uses GSI configure appropriate TX and RX clients/pipes.

Change-Id: I0302323d91f0cc4256a1b08ddbb1345d0daa2939
CRs-Fixed: 2368003
2019-03-07 02:02:00 -08:00
Mohit Khanna
81179cb75e qcacmn: Fixes for IPA enablement for lithium/Hastings
- Support to pass IPA enabled(disabled) flag from ini to DP layer
- Use ioremap call to translate tx_comp_doorbell_paddr obtained from
  calling ipa_setup api to tx_comp_doorbell_vaddr. This is needed to
  write the initial value of HP at the doorbell address.
- Change REO_DST_RING_SIZE and WLAN_CFG_TX_RING_SIZE to 1023
  for napier/hastings if IPA is enabled. This is needed because,
  ipa_setup API can handle only 16-bit values for the size param(bytes)
  of the ring.
- Disable hash based flow steering for SAP peers in case IPA is enabled
  and set default reo_dest_ring_4 as default RX ring. Since IPA will be
  reaping RX packets from reo_dest_ring_4 only, flow steering is not
  needed for SAP peers.
- Unmap pre-allocated TX buffers for IPA in the TX completion ring.
- Donot execute IPA functionality if IPA is disabled from ini.

Change-Id: I6855bfe293a457ccc0abd1ad5567f5c95232a9d2
CRs-Fixed: 2183519
2018-10-17 17:42:35 -07:00
Mohit Khanna
f83015ce04 qcacmn: Support for WDI3.0 in the Unified WDI APIs
Add support for WDI3.0 in the Unified WDI APIs.

Change-Id: Ic2bd68791e68b8bac5c948839f0258adb7d3f4b9
CRs-Fixed: 2183519
2018-10-17 17:42:32 -07:00
Krunal Soni
be43d55622 qcacmn: Replace Linux Fix-Width data-type with C-99 stdints
Datapath supposed to be HLOS-agnostic, but there is some use of
Linux fixed-width types u8, u16, and u32. These should be replaced with
C99 fixed-width types uint8_t, uint16_t, and uint32_t so that they will
correctly be HLOS-agnostic and work on non-Linux targets.

CRs-Fixed: 2326406
Change-Id: I8f9099a0170e4f94a54cdd6cc6c2e321a29af717
2018-10-17 05:50:39 -07:00
Pramod Simha
b2ef27ba26 qcacmn: Fixes for IPA datapath
1. Disable host processing of REO2SW4 when IPA is enabled.
2. Change buffer memory location provide to IPA TX transfer
   ring from consistent to non-consistent memory.

Change-Id: Ibb62d9faf5dc9adb5ee8a2e113d10a2912269cbd
CRs-Fixed: 2315889
2018-09-27 16: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
f72cb1f1ff qcacmn: include hal_hw_headers.h header file
macros and fw cmn headers included in hal_internal.h is moved
to a new hal_hw_headers.h to avoid these getting included in hif
layer. Include the new hal_hw_headers.h file

Change-Id: I3390ae9e71ca561d94a265e1fdf4d9354e7b2474
2018-07-21 00:03:27 -07:00
Yun Park
fd269b5021 qcacmn: Remove kernel includes from datapath
To abstract kernel header inclusion, create a new QDF APIs for all IPA
APIs and redirect all IPA API calls through QDF interfaces.

Change-Id: I7bff975ad7cb32fc128320c124633594471e0a1f
CRs-Fixed: 2098907
2017-11-11 19:25:09 -08:00
Yun Park
4711ade7bb qcacmn: Fix memmory leak from dp_tx_ipa_uc_detach
IPA Tx buffers are allocated using qdf_mem_alloc_consistent,
so free using qdf_mem_free_consistent.

Change-Id: I0125189e1eec2a45f06bc7c2662d65c8745b3d3e
CRs-Fixed: 2135803
2017-11-08 11:41:00 -08:00
Yun Park
601d0d868a qcacmn: Fix IPA WDI3 Tx issues
Fix bug to enable IPA WDI3 Tx H/W path.

Change-Id: Ice691dccc649b38971985cd8da042719d943cec7
CRs-Fixed: 2085751
2017-10-23 22:08:28 -07:00
Jeff Johnson
3f217e2a81 qcacmn: dp: Replace instances of unadorned %p
Replace instances of unadorned %p in dp.

Change-Id: I8d9c0f6efe5f03a582a36d7ff39a905a5de576a7
CRs-Fixed: 2111274
2017-09-28 04:48:10 -07:00
Yun Park
e56aa7b89a qcacmn: Markings updated
Markings updated

Change-Id: I8f031513a2adf5005be26965f73d2e9e1f52a15f
CRs-Fixed: 2093948
2017-08-21 16:50:13 -07:00
Yun Park
fde6b9e551 qcacmn: Enable WLAN host data path support for IPA WDI3.0
Change to support WLAN Napier host autonomy data path architecture.

Change-Id: I07f7592d547bb796a3c12bbc4745cee22e2c0022
CRs-Fixed: 2064810
2017-08-07 17:47:38 -07:00