]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: ath12k: Refactor ath12k_vif structure
authorHarsh Kumar Bijlani <quic_hbijlani@quicinc.com>
Tue, 30 Sep 2025 13:10:05 +0000 (18:40 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Tue, 30 Sep 2025 16:12:59 +0000 (09:12 -0700)
commitaf66c7640cf94aa77314cf8d5e95141bdecbc1ee
tree90410f838b8b370e9a8b81e3251021410423dd76
parent39538dc8860aa523dde38ab68a333cac4a98d9f2
wifi: ath12k: Refactor ath12k_vif structure

Move the Data Path (DP)-specific fields from ath12k_vif into a new
structure ath12k_dp_vif, embedded within ath12k_vif. This new structure
contains an array of per-link DP fields represented by ath12k_dp_link_vif.

Since dp_link_vif is small and frequently accessed from ahvif during Tx,
it is stored as an array of structs rather than an array of pointers to
avoid additional indirections and improve cache efficiency. However,
this design comes with a trade-off: because the array is not pointer-based,
it increases memory usage.

Per packet data path makes use of ath12k_dp_vif and ath12k_dp_link_vif.
Add pdev_idx and lmac_id in ath12k_dp_link_vif to avoid accessing ar in
dp tx.

Diagrammatic view of the new structure is below:

+--------------------------------+
| struct ath12k_vif              |
|                                |
|  +--------------------------+  |
|  | struct ath12k_dp_vif     |  |
|  |                          |  |
|  |  +--------------------+  |  |
|  |  | ath12k_dp_link_vif |  |  |
|  |  +--------------------+  |  |
|  |                          |  |
|  |  +--------------------+  |  |
|  |  | ath12k_dp_link_vif |  |  |
|  |  +--------------------+  |  |
|  |                          |  |
|  |  +--------------------+  |  |
|  |  | ath12k_dp_link_vif |  |  |
|  |  +--------------------+  |  |
|  |                          |  |
|  +--------------------------+  |
|                                |
+--------------------------------+

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Harsh Kumar Bijlani <quic_hbijlani@quicinc.com>
Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20250930131005.2884253-7-quic_rdeuri@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/cmn_defs.h
drivers/net/wireless/ath/ath12k/core.h
drivers/net/wireless/ath/ath12k/dp.c
drivers/net/wireless/ath/ath12k/dp_cmn.h
drivers/net/wireless/ath/ath12k/mac.c
drivers/net/wireless/ath/ath12k/mac.h
drivers/net/wireless/ath/ath12k/peer.c
drivers/net/wireless/ath/ath12k/wifi7/dp_tx.c