Commit 775fe5ac authored by Pavankumar Nandeshwar's avatar Pavankumar Nandeshwar Committed by Jeff Johnson
Browse files

wifi: ath12k: Move DP device stats to ath12k_dp



As part of data path modularization of device object framework, the per packet
tx/rx operations now use ath12k_dp. Move all the device stats 'device_stats'
from ath12k_base to ath12k_dp, consolidating all device stats within ath12k_dp.
This would improve the performance by allowing the datapath to reach to the
stats counters without to having to reach out to ath12k_base object.

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: default avatarPavankumar Nandeshwar <quic_pnandesh@quicinc.com>
Signed-off-by: default avatarRipan Deuri <quic_rdeuri@quicinc.com>
Reviewed-by: default avatarKarthikeyan Periyasamy <karthikeyan.periyasamy@oss.qualcomm.com>
Reviewed-by: default avatarBaochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20251103112111.2260639-3-quic_rdeuri@quicinc.com


Signed-off-by: default avatarJeff Johnson <jeff.johnson@oss.qualcomm.com>
parent 73c92834
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -902,31 +902,6 @@ struct ath12k_board_data {
	size_t len;
};

struct ath12k_device_dp_tx_err_stats {
	/* TCL Ring Descriptor unavailable */
	u32 desc_na[DP_TCL_NUM_RING_MAX];
	/* Other failures during dp_tx due to mem allocation failure
	 * idr unavailable etc.
	 */
	atomic_t misc_fail;
};

struct ath12k_device_dp_stats {
	u32 err_ring_pkts;
	u32 invalid_rbm;
	u32 rxdma_error[HAL_REO_ENTR_RING_RXDMA_ECODE_MAX];
	u32 reo_error[HAL_REO_DEST_RING_ERROR_CODE_MAX];
	u32 hal_reo_error[DP_REO_DST_RING_MAX];
	struct ath12k_device_dp_tx_err_stats tx_err;
	u32 reo_rx[DP_REO_DST_RING_MAX][ATH12K_MAX_DEVICES];
	u32 rx_wbm_rel_source[HAL_WBM_REL_SRC_MODULE_MAX][ATH12K_MAX_DEVICES];
	u32 tqm_rel_reason[MAX_TQM_RELEASE_REASON];
	u32 fw_tx_status[MAX_FW_TX_STATUS];
	u32 tx_wbm_rel_source[HAL_WBM_REL_SRC_MODULE_MAX];
	u32 tx_enqueued[DP_TCL_NUM_RING_MAX];
	u32 tx_completed[DP_TCL_NUM_RING_MAX];
};

struct ath12k_reg_freq {
	u32 start_freq;
	u32 end_freq;
@@ -1105,7 +1080,6 @@ struct ath12k_base {

	/* Current DFS Regulatory */
	enum ath12k_dfs_region dfs_region;
	struct ath12k_device_dp_stats device_stats;
#ifdef CONFIG_ATH12K_DEBUGFS
	struct dentry *debugfs_soc;
#endif
+2 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
 *
 */

#include <linux/vmalloc.h>
+2 −1
Original line number Diff line number Diff line
@@ -1027,7 +1027,8 @@ static ssize_t ath12k_debugfs_dump_device_dp_stats(struct file *file,
						   size_t count, loff_t *ppos)
{
	struct ath12k_base *ab = file->private_data;
	struct ath12k_device_dp_stats *device_stats = &ab->device_stats;
	struct ath12k_dp *dp = ath12k_ab_to_dp(ab);
	struct ath12k_device_dp_stats *device_stats = &dp->device_stats;
	int len = 0, i, j, ret;
	struct ath12k *ar;
	const int size = 4096;
+27 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include "dp_htt.h"
#include "dp_cmn.h"
#include <linux/rhashtable.h>
#include "wifi7/hal_desc.h"

#define MAX_RXDMA_PER_PDEV     2

@@ -420,6 +421,31 @@ struct ath12k_dp_arch_ops {
				       dma_addr_t paddr);
};

struct ath12k_device_dp_tx_err_stats {
	/* TCL Ring Descriptor unavailable */
	u32 desc_na[DP_TCL_NUM_RING_MAX];
	/* Other failures during dp_tx due to mem allocation failure
	 * idr unavailable etc.
	 */
	atomic_t misc_fail;
};

struct ath12k_device_dp_stats {
	u32 err_ring_pkts;
	u32 invalid_rbm;
	u32 rxdma_error[HAL_REO_ENTR_RING_RXDMA_ECODE_MAX];
	u32 reo_error[HAL_REO_DEST_RING_ERROR_CODE_MAX];
	u32 hal_reo_error[DP_REO_DST_RING_MAX];
	struct ath12k_device_dp_tx_err_stats tx_err;
	u32 reo_rx[DP_REO_DST_RING_MAX][ATH12K_MAX_DEVICES];
	u32 rx_wbm_rel_source[HAL_WBM_REL_SRC_MODULE_MAX][ATH12K_MAX_DEVICES];
	u32 tqm_rel_reason[MAX_TQM_RELEASE_REASON];
	u32 fw_tx_status[MAX_FW_TX_STATUS];
	u32 tx_wbm_rel_source[HAL_WBM_REL_SRC_MODULE_MAX];
	u32 tx_enqueued[DP_TCL_NUM_RING_MAX];
	u32 tx_completed[DP_TCL_NUM_RING_MAX];
};

struct ath12k_dp {
	struct ath12k_base *ab;
	u32 mon_dest_ring_stuck_cnt;
@@ -514,6 +540,7 @@ struct ath12k_dp {
	/* The rhashtable containing struct ath12k_link_peer keyed by mac addr */
	struct rhashtable *rhead_peer_addr;
	struct rhashtable_params rhash_peer_addr_param;
	struct ath12k_device_dp_stats device_stats;
};

static inline u32 ath12k_dp_arch_tx_get_vdev_bank_config(struct ath12k_dp *dp,
+2 −2
Original line number Diff line number Diff line
@@ -1272,7 +1272,7 @@ void ath12k_dp_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev, struct napi_struc
	ieee80211_rx_napi(ath12k_pdev_dp_to_hw(dp_pdev), pubsta, msdu, napi);
}

bool ath12k_dp_rx_check_nwifi_hdr_len_valid(struct ath12k_base *ab,
bool ath12k_dp_rx_check_nwifi_hdr_len_valid(struct ath12k_dp *dp,
					    struct hal_rx_desc *rx_desc,
					    struct sk_buff *msdu,
					    struct hal_rx_desc_data *rx_info)
@@ -1289,7 +1289,7 @@ bool ath12k_dp_rx_check_nwifi_hdr_len_valid(struct ath12k_base *ab,
	if ((likely(hdr_len <= DP_MAX_NWIFI_HDR_LEN)))
		return true;

	ab->device_stats.invalid_rbm++;
	dp->device_stats.invalid_rbm++;
	WARN_ON_ONCE(1);
	return false;
}
Loading