Skip to content

Commit 83e3517

Browse files
committed
wifi: ath12k: Support Pdev OBSS Stats
JIRA: https://issues.redhat.com/browse/RHEL-79791 commit 15d9142 Author: Dinesh Karthikeyan <[email protected]> Date: Sat Oct 5 16:12:06 2024 +0530 wifi: ath12k: Support Pdev OBSS Stats Add support to request pdev OBSS stats from firmware through stats type 23. These stats give information about PPDUs transmitted or tried to be transmitted in Spatial Reuse Groups(SRG), Parameterized Spatial Reuse(PSR) and non-PSR groups. Sample output: ------------- echo 23 > /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats_type cat /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats HTT_PDEV_OBSS_PD_STATS_TLV: num_spatial_reuse_tx = 0 num_spatial_reuse_opportunities = 0 num_non_srg_opportunities = 0 num_non_srg_ppdu_tried = 0 ..... HTT_PDEV_OBSS_PD_PER_AC_STATS: Access Category 0 (best effort) num_non_srg_ppdu_tried = 0 num_non_srg_ppdu_success = 0 num_srg_ppdu_tried = 0 num_srg_ppdu_success = 0 Access Category 1 (background) num_non_srg_ppdu_tried = 0 num_non_srg_ppdu_success = 0 num_srg_ppdu_tried = 0 num_srg_ppdu_success = 0 ..... Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Dinesh Karthikeyan <[email protected]> Signed-off-by: Roopni Devanathan <[email protected]> Acked-by: Jeff Johnson <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jeff Johnson <[email protected]> Signed-off-by: Jose Ignacio Tornos Martinez <[email protected]>
1 parent d1cb4ea commit 83e3517

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,6 +2437,71 @@ ath12k_htt_print_pdev_stats_cca_counters_tlv(const void *tag_buf, u16 tag_len,
24372437
stats_req->buf_len = len;
24382438
}
24392439

2440+
static void
2441+
ath12k_htt_print_pdev_obss_pd_stats_tlv(const void *tag_buf, u16 tag_len,
2442+
struct debug_htt_stats_req *stats_req)
2443+
{
2444+
const struct ath12k_htt_pdev_obss_pd_stats_tlv *htt_stats_buf = tag_buf;
2445+
u8 *buf = stats_req->buf;
2446+
u32 len = stats_req->buf_len;
2447+
u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
2448+
u8 i;
2449+
static const char *access_cat_names[ATH12K_HTT_NUM_AC_WMM] = {"best effort",
2450+
"background",
2451+
"video", "voice"};
2452+
2453+
if (tag_len < sizeof(*htt_stats_buf))
2454+
return;
2455+
2456+
len += scnprintf(buf + len, buf_len - len, "HTT_PDEV_OBSS_PD_STATS_TLV:\n");
2457+
len += scnprintf(buf + len, buf_len - len, "num_spatial_reuse_tx = %u\n",
2458+
le32_to_cpu(htt_stats_buf->num_sr_tx_transmissions));
2459+
len += scnprintf(buf + len, buf_len - len,
2460+
"num_spatial_reuse_opportunities = %u\n",
2461+
le32_to_cpu(htt_stats_buf->num_spatial_reuse_opportunities));
2462+
len += scnprintf(buf + len, buf_len - len, "num_non_srg_opportunities = %u\n",
2463+
le32_to_cpu(htt_stats_buf->num_non_srg_opportunities));
2464+
len += scnprintf(buf + len, buf_len - len, "num_non_srg_ppdu_tried = %u\n",
2465+
le32_to_cpu(htt_stats_buf->num_non_srg_ppdu_tried));
2466+
len += scnprintf(buf + len, buf_len - len, "num_non_srg_ppdu_success = %u\n",
2467+
le32_to_cpu(htt_stats_buf->num_non_srg_ppdu_success));
2468+
len += scnprintf(buf + len, buf_len - len, "num_srg_opportunities = %u\n",
2469+
le32_to_cpu(htt_stats_buf->num_srg_opportunities));
2470+
len += scnprintf(buf + len, buf_len - len, "num_srg_ppdu_tried = %u\n",
2471+
le32_to_cpu(htt_stats_buf->num_srg_ppdu_tried));
2472+
len += scnprintf(buf + len, buf_len - len, "num_srg_ppdu_success = %u\n",
2473+
le32_to_cpu(htt_stats_buf->num_srg_ppdu_success));
2474+
len += scnprintf(buf + len, buf_len - len, "num_psr_opportunities = %u\n",
2475+
le32_to_cpu(htt_stats_buf->num_psr_opportunities));
2476+
len += scnprintf(buf + len, buf_len - len, "num_psr_ppdu_tried = %u\n",
2477+
le32_to_cpu(htt_stats_buf->num_psr_ppdu_tried));
2478+
len += scnprintf(buf + len, buf_len - len, "num_psr_ppdu_success = %u\n",
2479+
le32_to_cpu(htt_stats_buf->num_psr_ppdu_success));
2480+
len += scnprintf(buf + len, buf_len - len, "min_duration_check_flush_cnt = %u\n",
2481+
le32_to_cpu(htt_stats_buf->num_obss_min_dur_check_flush_cnt));
2482+
len += scnprintf(buf + len, buf_len - len, "sr_ppdu_abort_flush_cnt = %u\n\n",
2483+
le32_to_cpu(htt_stats_buf->num_sr_ppdu_abort_flush_cnt));
2484+
2485+
len += scnprintf(buf + len, buf_len - len, "HTT_PDEV_OBSS_PD_PER_AC_STATS:\n");
2486+
for (i = 0; i < ATH12K_HTT_NUM_AC_WMM; i++) {
2487+
len += scnprintf(buf + len, buf_len - len, "Access Category %u (%s)\n",
2488+
i, access_cat_names[i]);
2489+
len += scnprintf(buf + len, buf_len - len,
2490+
"num_non_srg_ppdu_tried = %u\n",
2491+
le32_to_cpu(htt_stats_buf->num_non_srg_tried_per_ac[i]));
2492+
len += scnprintf(buf + len, buf_len - len,
2493+
"num_non_srg_ppdu_success = %u\n",
2494+
le32_to_cpu(htt_stats_buf->num_non_srg_success_ac[i]));
2495+
len += scnprintf(buf + len, buf_len - len, "num_srg_ppdu_tried = %u\n",
2496+
le32_to_cpu(htt_stats_buf->num_srg_tried_per_ac[i]));
2497+
len += scnprintf(buf + len, buf_len - len,
2498+
"num_srg_ppdu_success = %u\n\n",
2499+
le32_to_cpu(htt_stats_buf->num_srg_success_per_ac[i]));
2500+
}
2501+
2502+
stats_req->buf_len = len;
2503+
}
2504+
24402505
static int ath12k_dbg_htt_ext_stats_parse(struct ath12k_base *ab,
24412506
u16 tag, u16 len, const void *tag_buf,
24422507
void *user_data)
@@ -2607,6 +2672,9 @@ static int ath12k_dbg_htt_ext_stats_parse(struct ath12k_base *ab,
26072672
case HTT_STATS_PDEV_CCA_COUNTERS_TAG:
26082673
ath12k_htt_print_pdev_stats_cca_counters_tlv(tag_buf, len, stats_req);
26092674
break;
2675+
case HTT_STATS_PDEV_OBSS_PD_TAG:
2676+
ath12k_htt_print_pdev_obss_pd_stats_tlv(tag_buf, len, stats_req);
2677+
break;
26102678
default:
26112679
break;
26122680
}

drivers/net/wireless/ath/ath12k/debugfs_htt_stats.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ enum ath12k_dbg_htt_ext_stats_type {
134134
ATH12K_DBG_HTT_EXT_STATS_SFM_INFO = 16,
135135
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX_MU = 17,
136136
ATH12K_DBG_HTT_EXT_STATS_PDEV_CCA_STATS = 19,
137+
ATH12K_DBG_HTT_EXT_STATS_PDEV_OBSS_PD_STATS = 23,
137138

138139
/* keep this last */
139140
ATH12K_DBG_HTT_NUM_EXT_STATS,
@@ -184,6 +185,7 @@ enum ath12k_dbg_htt_tlv_tag {
184185
HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74,
185186
HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86,
186187
HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87,
188+
HTT_STATS_PDEV_OBSS_PD_TAG = 88,
187189
HTT_STATS_HW_WAR_TAG = 89,
188190
HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100,
189191
HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102,
@@ -1024,4 +1026,26 @@ struct ath12k_htt_pdev_cca_stats_hist_v1_tlv {
10241026
__le32 collection_interval;
10251027
} __packed;
10261028

1029+
struct ath12k_htt_pdev_obss_pd_stats_tlv {
1030+
__le32 num_obss_tx_ppdu_success;
1031+
__le32 num_obss_tx_ppdu_failure;
1032+
__le32 num_sr_tx_transmissions;
1033+
__le32 num_spatial_reuse_opportunities;
1034+
__le32 num_non_srg_opportunities;
1035+
__le32 num_non_srg_ppdu_tried;
1036+
__le32 num_non_srg_ppdu_success;
1037+
__le32 num_srg_opportunities;
1038+
__le32 num_srg_ppdu_tried;
1039+
__le32 num_srg_ppdu_success;
1040+
__le32 num_psr_opportunities;
1041+
__le32 num_psr_ppdu_tried;
1042+
__le32 num_psr_ppdu_success;
1043+
__le32 num_non_srg_tried_per_ac[ATH12K_HTT_NUM_AC_WMM];
1044+
__le32 num_non_srg_success_ac[ATH12K_HTT_NUM_AC_WMM];
1045+
__le32 num_srg_tried_per_ac[ATH12K_HTT_NUM_AC_WMM];
1046+
__le32 num_srg_success_per_ac[ATH12K_HTT_NUM_AC_WMM];
1047+
__le32 num_obss_min_dur_check_flush_cnt;
1048+
__le32 num_sr_ppdu_abort_flush_cnt;
1049+
} __packed;
1050+
10271051
#endif

0 commit comments

Comments
 (0)