Commit grafiek

86 Commits

Auteur SHA1 Bericht Datum
Himanshu Batra
6c9b3cb72c qcacmn: Add API to check target state while enabling IPA autonomy
Add API to check target state while enabling IPA autonomy

Change-Id: I2d04b2989e129a8ab70fec908c06e509545c7a8c
2022-01-19 15:30:44 -08:00
Himanshu Batra
cc46006b7d qcacmn: Use correct variable to iterate reo dest rings
Currently the MAX_REO_DEST_RINGS is used to iterate reo dst ring. If the
MAX_REO_DEST_RINGS is more that no. of reo dest ring initialize, the
print is seen on console as hal_ring_hdl will be null for extra
iterations.
Add fix to use correct variable to iterate reo dest rings

Change-Id: Ibcb44dda49696a7bb029b49ce3d50acd8741590a
2022-01-09 23:10:09 -08:00
sandhu
ad2829718c qcacmn: Remove IP from files
remove IP from code

Change-Id: If119a4af213b10aadb9f1344e50b0342e72405c2
CRs-Fixed: 3073864
2021-12-29 04:28:58 -08:00
Himanshu Batra
f49b3a1753 qcacmn: Cfg changes for IPA offload support
Cfg changes for IPA offload support.

Change-Id: If477db8e958b22634e1505f3e4319c7aa0cc6ef4
2021-12-20 22:45:22 -08:00
Himanshu Batra
a83d7d4111 qcacmn: Modify IPA object cleanup path
Currently ipa object cleanup is happening as part of pdev destroy.
Move it to deinit API of IPA

Change-Id: Id36648397102fa47ad1d29f99f2f152f40663f36
2021-12-20 22:45:17 -08:00
Chaithanya Garrepalli
c42af1f62f qcacmn: Rx path changes for multichip MLO
Rx patch changes for multichip MLO

1. Create ini for rx ring mask for each chip
2. Configure hash based routing for each chip based
   on lmac_peer_id_msb
3. Peer setup changes to configure lmac_peer_id_msb
   to enable hash based routing
4. Rx Replenish changes to provide buffers back to owner
   SOC of reo ring

Change-Id: Ibbe6e81f9e62d88d9bb289a082dd14b4362252c4
2021-11-23 19:28:20 -08:00
aloksing
b158abe417 qcacmn: API renaming for monitor module
Add prefix dp for all monitor APIs
Add mon_debug/mon_info/mon_err for logs

Change-Id: I71d49f6bcacd77f5695269817fed83337169227b
CRs-Fixed: 3006497
2021-08-12 05:32:47 -07:00
aloksing
c60b9619a3 qcacmn: Conditionally compile monitor related features and issue fixes
PATCH[7/7]:
This patch consists following changes:
 -Conditionally compile all monitor destination ring related code
  Macro used QCA_MONITOR_PKT_SUPPORT
 -Add QCA_ENHANCED_STATS_SUPPORT macro to conditionally compile
  enhanced stats support
 -Use QCA_MCOPY_SUPPORT and QCA_TX_CAPTURE_SUPPORT macros
  to conditionally compile MCOPY and Tx capture features
  respectively
 -Use QCN_IE macro to conditionally compile BPR
  feature
 -Use QCA_ADVANCE_MON_FILTER_SUPPORT macro to conditionally
  compile advance monitor filter feature
 -Fix vdev attach issue for special and smart monitor vap
 -Fix status ring initialization issue.

Change-Id: I0deaa28a9a54bf34b0f41e6dd510fdd8d4992db2
CRs-Fixed: 2983780
2021-07-30 21:51:26 -07:00
aloksing
53fe7000ba qcacmn: Move monitor related fields from soc/pdev to mon_soc/mon_pdev
PATCH[6/7]:
This patch consists following changes:
 -Move monitor related pdev variables to struct dp_mon_pdev
 -Move monitor relted soc variables to struct dp_mon_soc
 -Move cookie to monitor link desc va to monitor file
 -Add APIs to access monitor related variables
 -Add dummy APIs to build without monitor support.

Change-Id: I032a480b1383d061f984cee3ba6b10ac7a0ff350
CRs-Fixed: 2983781
2021-07-30 21:51:21 -07:00
Rakesh Pillai
a42ab6f94e qcacmn: Add IPA api changes
Add changes in IPA APIs due to hal API
modifications for WCN7850.

Change-Id: I13e3acc154cb22538eca0adcd312cb7f9bc1124c
CRs-Fixed: 2888556
2021-06-07 01:51:14 -07:00
Ananya Gupta
02e119acc0 qcacmn: Correcting pointer variable input
Currently, wrong address is given to insert session_id in
meta_data.
To fix this, Passing pointer variable instead of address
to the pointer so that meta_data is filled correctly.

Change-Id: I019d73dc728fb214fd7c06a5027f0507ab4822a1
CRs-Fixed: 2959923
2021-06-03 20:11:32 -07:00
Karthik Kantamneni
cfbfcf3b21 qcacmn: Fix race condition during IPA map/unmap handling
While Rx buffers are getting umapped from net rx context if IPA
pipes are enabled at same time from MC thread context this is
leading to race condition and IPA map/unmap is going out of sync.

To fix this introducing IPA mapping lock and IPA mapping need to
be handled with lock held.

Change-Id: I9fa71bdb6d4e4aa93fc795cc5dd472a181325991
CRs-Fixed: 2945063
2021-05-27 13:41:35 -07:00
Jianmin Zhu
2c9dd68894 qcacmn: Fix smmu fault for IPA TX buffer unmapped
It's regression of change: qcacmn: Fix smmu fault for tx buffer unmapped.
Only 1 tx buffer is smmu mapped for IPA with it.
During STA-SAP tethering, when IPA access 2nd tx buffer, smmu fault
happens.

Remove qdf_assert_always since it already exists in
__dp_ipa_handle_buf_smmu_mapping.

Change-Id: Ife8ed17d85a8bcfc507c312001af4b905c9b3a27
CRs-Fixed: 2937435
2021-05-13 08:21:39 -07:00
Ananya Gupta
9f3b9ca800 qcacmn: compiling WDI3 version of IPA
Depreciated IPA APIs are currently getting compiled.
To fix this, adding linux kernel version check

Change-Id: I2288db34c09d60047c67a5df9081de08a6c2f62b
CRs-Fixed: 2927413
2021-05-06 06:23:47 -07:00
Manikanta Pubbisetty
9f6ccf3fe6 qcacmn: assert on IPA SMMU map/unmap failures
The status of the IPA SMMU MAP/UNMAP operation is stored in the
result field of the mem info structure that is passed to the
IPA driver. Currently, this field is not checked for MAP/UNMAP
failures; when IPA HW accesses such a buffer for which
mapping is not correctly setup, it will lead to SMMU faults.
Check the result and assert(on failures) to avoid such issues.

Also, check if the physical address passed to the IPA driver is
non zero value.

Change-Id: Iec0702bdf4a07ea37e1213a33dc970028da654df
CRs-Fixed: 2928744
2021-04-26 12:23:40 -07:00
Tiger Yu
2cd64402c6 qcacmn: Support IPA WDI 3.0 with two tx pipes
Currently a set of IPA2TCL and WBM2IPA rings is used for
IPA TX data path. Issue is when wlan is configured as
SAP-SAP DBS mode, slow 2G traffic will consume much more
TX resources and thus 5G traffic will have starvation,
which leads to severe degradation of DBS KPI.

Therefore separate IPA2TCL (SW2TCL2) and WBM2IPA (WBM2SW4)
rings are added to support alternative IPA TX pipe for 2G
traffic.

Change-Id: I4b648d0bcacbcde0b9b0a824516c1f06e3b0c7ad
CRs-Fixed: 2750079
2021-04-21 11:03:45 -07:00
Nisha Menon
ab30ba1267 qcacmn: Unmapped IPA buffer results in smmu fault
Check the return status of the IPA api that creates or
releases the smmu mappings of the tx/rx buffers. If the
api returns a failure then assert.

Change-Id: I755765c7c35c901341279eefbc8087d0dce0494c
CRs-Fixed: 2898353
2021-04-13 18:54:00 -07:00
Vevek Venkatesan
7cda609ffb qcacmn: assert if SMMU-S1 map/unmap of IPA doorbell addr failed
If the SMMU-S1 mapping/unmapping of IPA doorbell addresses
failed, do assert.

Change-Id: I41faba7002be37c442d306199876c2204120fe31
CRs-Fixed: 2892321
2021-03-06 23:57:54 -08:00
Jia Ding
643fc26931 qcacmn: Dynamically allocate memory for ipa_wdi_conn_in_params
Currently struct ipa_wdi_conn_in_params occupies 1588 bytes and putting
it on the stack is rather expensive, which could potentially lead to
stack corruption.

Fix is to reduce stack usage in dp_ipa_setup by dynamically allocating
struct ipa_wdi_conn_in_params on the heap.

Change-Id: I8f71f44906a5c95f37627f7573b57b7825daaa7e
CRs-Fixed: 2852027
2021-01-15 04:06:59 -08:00
Yeshwanth Sriram Guntuka
871c29e8f2 qcacmn: Set IPA WBM2SW ring HP to DDR addr on disable pipes
WLAN HW can still access the IPA tx doorbell address post
disable pipes if there are any pending tx completions which
could result in a NOC error.

Fix is to reset the WBM2SW ring HP addr to shadow addr in
DDR before pipes are disabled.

Change-Id: I52900eb34530388487923a887354ef8839d8c728
CRs-Fixed: 2846421
2021-01-06 13:52:45 -08:00
Nisha Menon
bcf8d7b876 qcacmn: Account for IPA Tx buffers memory
Account for the Tx buffers allocated for IPA during
init. Add this memory to the overall Tx nbuf memory
allocations. Ensure that the nbuf size is taken from
end pointer to head pointer of nbuf.

Change-Id: Ie3a46c7e7674f3f2e1bf9e0791a7eb53d4bb0b21
CRs-Fixed: 2831015
2020-12-18 19:38:54 -08:00
Zhaoyang Liu
fe5c7293e1 qcacmn: fix might sleep crash issue during rx buffer smmu mapping
When driver doing ipa rx buffer smmu mapping,
qdf_spin_lock_bh is used to protect rx descriptor pool,
but might sleep function is called by API ipa_is_ready.
This causes kernel panic about sleeping function called
from invalid context as following call trace:

  Call trace:
  ___might_sleep+0x204/0x208
  __might_sleep+0x50/0x88
  __mutex_lock_common+0x5c/0x1078
  mutex_lock_nested+0x40/0x50
  ipa3_is_ready+0x2c/0x60
  ipa_is_ready+0x24/0x38
  dp_ipa_handle_rx_buf_pool_smmu_mapping+0x2dc/0x6d0 [wlan]

Move the ipa is ready check function call outside of spin lock.

Change-Id: I5d3a79dff8a045791834733514a40f7c1ccb0d8b
CRs-Fixed: 2839292
2020-12-17 23:46:02 -08:00
Nisha Menon
4677d5bdf5 qcacmn: Memory stats for SKB usage and Tx desc cnt in datapath
Add sysfs node for DP level memory stats:
/sys/kernel/wifi/wlan/wlan_dp_mem_stats
These include Tx, Rx SKB memory allocated, Tx/Rx
buffer count, outstanding Tx desc count.

Change-Id: I839a5f2ec4e763ca11cdea2093368ca6dc52d8cf
CRs-Fixed: 2724460
2020-11-18 16:23:53 -08:00
Yeshwanth Sriram Guntuka
1df1553343 qcacmn: Use only shadow writes for REO remap and WBM HP reg
REO remap register direct writes as part of SAP stop could
result in a NOC error if the UMAC is in low power state.

Fix is to use shadow register writes for REO remap and
WBM HP registers.

Change-Id: Ie515c3d28f4ccdd99a3757808f1ab6c5cf373e3d
CRs-Fixed: 2813105
2020-11-18 09:54:55 -08:00
Ananya Gupta
c8a732e132 qcacmn: Check tx completions pending before disabling pipes
wlan Tx completions doorbell is rung after IPA pipes are disabled
To fix this, Check if tx completions are pending before disable IPA
pipes.

Change-Id: I1903e593cd6a546a277979073f0a9ba62b681644
CRs-Fixed: 2796989
2020-10-28 09:21:42 -07:00
Nisha Menon
a377301c78 qcacmn: Add support to map generic shadow regs
Add apis to map generic registers to shadow region. Existing
logic includes mapping only srng based regs to the shadow
region.
Add support to map REO control regs and WBM2SW2 rel
ring HP reg address to the shadow region in case the direct
reg writes in IPA enable/disable autonomy fail due to UMAC
block being in a power collapsed state.
Shadow reg mapping for these regs is provided to FW during
init. Add stat shadow_reg_write_fail to track shadow reg
write failure and shadow_reg_write_succ to track successful
shadow writes.

Change-Id: I04790765a3de80047689657e2cad0b73123440b9
CRs-Fixed: 2790321
2020-10-20 15:05:51 -07:00
Ananya Gupta
936ca8fe36 qcacmn: Deregister IPA handler from pdev during deinit
A htt message arrived after ipa context is freed as part of
deinitialization which was dereferenced by event handler
assigned to pdev->ipa_uc_op_cb, resulting in crash.
To fix this, during deinit pdev->ipa_uc_op_cb is deregistered
and assigned NULL before freeing up ipa context.

Change-Id: I8125cb104a538e88cda93960f7443129fabd850a
CRs-Fixed: 2793295
2020-10-13 00:08:18 -07:00
Vevek Venkatesan
3970f133ee qcacmn: add API to do IPA Tx buf smmu_unmapping for Hastings
Add API to do IPA Tx buf SMMU-S1 unmapping and register it
with cdp ops for Hastings, also assert if map/unmap failed.

Change-Id: I4071b5fccd84c3c97b9dccc40c6f798d70993189
CRs-Fixed: 2792170
2020-10-07 12:49:07 -07:00
Vevek Venkatesan
5e487cc20a qcacmn: add support for DDR mapped IPA doorbell
Add support for DDR mapped IPA doorbell addresses.

Change-Id: I3a0d03ff4435ea12a6e07d4ae75012f2c85e32c9
CRs-Fixed: 2782267
2020-10-06 14:24:41 -07:00
Nisha Menon
a8149aef8f qcacmn: Add qdf api to return data buffer len
Add qdf abstraction api to return the size of the skb
data buffer.

Change-Id: I469dc1cf6db9124b48e041a99a736097bece3f0f
CRs-Fixed: 2767763
2020-09-18 18:23:42 -07:00
Jia Ding
9f0246370d qcacmn: Do smmu unmap for IPA TX and RX doorbell registers
During driver initialization, IPA TX and RX doorbell registers
are provided to wlan as physical addresses. With SMMU S1 enabled,
they're mapped to IOVA of wlan domain.

On driver deinit path, do smmu unmap for the two IOVA addresses.

Change-Id: I85ef1c3e99bef504abf09eebf9ace760b68f35f1
CRs-Fixed: 2768303
2020-09-15 09:28:54 -07:00
Srinivas Girigowda
a104d7b453 qcacmn: dp: Remove redundant __func__ from the logs
The logging macros implicitly takes care of embedding function name
in the log, hence there is no need to include __func__ again.
Getting rid of redundant __func__ reduces driver memory footprint.

Change-Id: I26bfac840ac6732ac83fb008db8e1702996eb21e
CRs-Fixed: 2774457
2020-09-15 02:45:47 -07:00
Ananya Gupta
f7771e45d8 qcacmn: Add NULL check for mem_info tx ring and rx refill ring of ipa
Currently, check is performed only on tx_comp_ring and rx_ready ring,
after getting the resource from soc in pdev.ipa_res.
Adding check for tx ring and rx refill ring as well.

Change-Id: I462073357bcd2b4a3f5e888d77d84621855f973c
CRs-Fixed: 2771401
2020-09-11 11:50:30 -07:00
Guisen Yang
60b35027b2 qcacmn: Set the default value for variable 'ret'
The variable 'ret' in ‘__dp_ipa_tx_buf_smmu_mapping()’ maybe
used uninitialized. Set one default value for it.

CRs-Fixed: 2771822
Change-Id: Ibf4bf6aa2076de84b3a47122ff4f3cae055cd0f7
2020-09-09 01:45:23 -07:00
Jinwei Chen
b8a17e378b qcacmn: provide REO2SW1 ring as REO_DST option when IPA is enabled
Currently when IPA is enabled, all RX frames will be routed to IPA
ring REO2SW4 by default, there is no REO2HOST option. once IPA RX/TX
is slow, then likely will give RX back pressure to wlan RXDMA. per
FW feature request, when IPA RX is slow or stuck, route RX frames to
wlan host to mitigate issue, thus provide REO2SW1 ring as REO_DST
option into HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0.
To make sure if without FW dynamic REO_DST ring switching change,
current host change should not give chance that RX frames
route to host when IPA is enabled, select CTRL_IX_0 index 2 to
set REO_DST option, the reason is: if RX hash is enabled, CTRL_IX_2
and CTRL_IX_3 index 16~31 is REO_DST option filled with REO2SW4,
if RX hash is disabled, then CTRL_IX_0 index 1 and 4 filled with
REO2SW4 is REO_DST option configured by
WMI_HOST_PEER_SET_DEFAULT_ROUTING, so CTRL_IX_0 index 2
is only used for FW dynamic ring switching.

Change-Id: I6af12e07472dbdd4ab6d97f24e9fd4082c4e7328
CRs-Fixed: 2767844
2020-09-04 03:23:49 -07:00
Nisha Menon
d95c9bb377 qcacmn: Map IPA tx buffers as part of IPA ready callback
Register IPA ready callback with IPA driver. The callback
sets ipa_is_ready flag in the host driver and kick starts
the ipa init sequence as part of which the Tx buffers are
mapped to IPA.
None of the IPA APIs are invoked until IPA ready registration
is complete.

Change-Id: I6570b2b347052164a274fbc22358ebf0719dcabf
CRs-Fixed: 2735107
2020-09-02 13:51:44 -07:00
Srinivas Girigowda
b100ced3c7 qcacmn: dp: Change %pM/QDF_MAC_ADDR_STR/ARRAY to QDF_MAC_ADDR_FMT/REF
Change %pM/QDF_MAC_ADDR_STR/ARRAY to QDF_MAC_ADDR_FMT/REF.

CRs-Fixed: 2760938
Change-Id: Ib7999b69f79a65a67e1d9f7e24a04b7a7da0aebf
2020-08-23 23:09:31 -07:00
Chaithanya Garrepalli
ddc9e59e8f qcacmn: Add VDEV refcount debug support
Add debug support for VDEV refcount to take
refcount by module id and decrement corresponding
refcount with same module id

Change-Id: I15c075816994ba70155fefbc0bce208b20fb9a59
2020-08-20 10:07:32 -07:00
Chaithanya Garrepalli
a718007f03 qcacmn: increment vdev refcount for search by id
Add new API dp_vdev_get_ref_by_id() which will return vdev
pointer by holding a reference. Caller of this API has
to ensure that this reference is released by calling
dp_vdev_unref_delete() API

New lock soc->vdev_map_lock is introduced to protect
vdev id to object array

Change-Id: I883e328932e35ef31254125492dbae20cebe0e00
2020-08-20 10:07:28 -07:00
Chaithanya Garrepalli
9b6f765f74 qcacmn: Use sa_peer variable to get source peer
While getting source peer in dp_ipa_intrabss use
sa_peer and release reference accordingly


Change-Id: I4011b10ee03bcb25af6eafa84dec5db8f840c112
2020-08-15 01:26:32 -07:00
Chaithanya Garrepalli
fdc6a808ae qcacmn: add module id for peer reference
Add support to get the peer reference with module id

To help debug the peer reference related issues

Change-Id: Ie20c7e710b9784b52f2e0f3d7488509282528a00
2020-08-15 01:26:14 -07:00
Jinwei Chen
d552bfa2cb qcacmn: add rx nbuf ipa smmu map/unmap trace
Currently in_use and unmapped flag from rx_desc can not know is
the rx nbuf has done IPA smmu map/unmap accurately.
add rx nbuf IPA smmu map/unmap flag in qdf_nbuf_cb, and use
this flag to check if IPA smmu map/unmap need to be done or not.

Change-Id: I19bbc6cc69ba752ef7c58d41fbe26299ca96d29e
CRs-Fixed: 2731313
2020-08-11 00:35:34 -07:00
Chaithanya Garrepalli
82eb94c989 qcacmn: remove bss and self peer back pointers from dp_vdev
Remove self and BSS peer back pointers and added APIs to
get self and BSS peer from VDEV

These new APIs will iterate through peer list and return
the appropriate peer by taking a reference

Caller has to take care of releasing the reference

Change-Id: I550ff83d665f3ad0a185bea1a1e6270c5474ff07
2020-08-06 14:37:19 -07:00
Jinwei Chen
f3bffbfdd2 qcacmn: handle IPA buffer smmu map/unmap correctly
Handle ipa buffer smmu map/unmap with below changes,
(1) Do IPA smmu unmap for RX buffer received from REO
exception/WBM RX release/REO DST/RXDMA DST ring.
(2) Align IPA smmu map length to qdf_nbuf_map_nytes_single()
with fixed length.

Change-Id: I1ed46b31ed31f5b7e4e2484d519bc85d35ce1e69
CRs-Fixed: 2728644
2020-07-23 13:17:09 -07:00
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