Skip to content

Commit 9fe9139

Browse files
Aaradhana Sahumiaoqing-quic
authored andcommitted
UPSTREAM: wifi: ath12k: Add support TX hardware queue stats
Add support to request and receive TX hardware queue stats using HTT stats type 3. This stats type reports MPDU mac id and hardware queue information, including xretry, BAR, RTS, CTS, self, and QoS-null counts, along with underrun, flush, and filter counters. Sample output: ------------- echo 3 >/sys/kernel/debug/ath12k/pci-0000\:58\:00.0/mac0/htt_stats_type cat /sys/kernel/debug/ath12k/pci-0000\:58\:00.0/mac0/htt_stats HTT_TX_HWQ_STATS_CMN_TLV: mac_id = 0 hwq_id = 0 xretry = 0 underrun_cnt = 0 flush_cnt = 0 filt_cnt = 0 null_mpdu_bmap = 0 user_ack_failure = 379 ack_tlv_proc = 0 sched_id_proc = 0 null_mpdu_tx_count = 0 mpdu_bmap_not_recvd = 0 num_bar = 0 rts = 0 cts2self = 0 qos_null = 0 mpdu_tried_cnt = 379 mpdu_queued_cnt = 379 mpdu_ack_fail_cnt = 0 mpdu_filt_cnt = 0 false_mpdu_ack_count = 0 txq_timeout = 0 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.5-01651-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3 Signed-off-by: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20260123071253.2202644-4-aaradhana.sahu@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
1 parent 17ab72d commit 9fe9139

2 files changed

Lines changed: 90 additions & 0 deletions

File tree

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

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5661,6 +5661,67 @@ ath12k_htt_print_rx_pdev_fw_stats_tlv(const void *tag_buf, u16 tag_len,
56615661
stats_req->buf_len = len;
56625662
}
56635663

5664+
static void
5665+
ath12k_htt_print_tx_hwq_stats_cmn_tlv(const void *tag_buf, u16 tag_len,
5666+
struct debug_htt_stats_req *stats_req)
5667+
{
5668+
const struct htt_tx_hwq_stats_cmn_tlv *htt_stats_buf = tag_buf;
5669+
u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE;
5670+
u32 len = stats_req->buf_len;
5671+
u8 *buf = stats_req->buf;
5672+
5673+
if (tag_len < sizeof(*htt_stats_buf))
5674+
return;
5675+
5676+
len += scnprintf(buf + len, buf_len - len, "HTT_TX_HWQ_STATS_CMN_TLV:\n");
5677+
len += scnprintf(buf + len, buf_len - len, "mac_id = %u\n",
5678+
le32_to_cpu(htt_stats_buf->mac_id__hwq_id__word) & 0xFF);
5679+
len += scnprintf(buf + len, buf_len - len, "hwq_id = %u\n",
5680+
(le32_to_cpu(htt_stats_buf->mac_id__hwq_id__word) & 0xFF00) >> 8);
5681+
len += scnprintf(buf + len, buf_len - len, "xretry = %u\n",
5682+
le32_to_cpu(htt_stats_buf->xretry));
5683+
len += scnprintf(buf + len, buf_len - len, "underrun_cnt = %u\n",
5684+
le32_to_cpu(htt_stats_buf->underrun_cnt));
5685+
len += scnprintf(buf + len, buf_len - len, "flush_cnt = %u\n",
5686+
le32_to_cpu(htt_stats_buf->flush_cnt));
5687+
len += scnprintf(buf + len, buf_len - len, "filt_cnt = %u\n",
5688+
le32_to_cpu(htt_stats_buf->filt_cnt));
5689+
len += scnprintf(buf + len, buf_len - len, "null_mpdu_bmap = %u\n",
5690+
le32_to_cpu(htt_stats_buf->null_mpdu_bmap));
5691+
len += scnprintf(buf + len, buf_len - len, "user_ack_failure = %u\n",
5692+
le32_to_cpu(htt_stats_buf->user_ack_failure));
5693+
len += scnprintf(buf + len, buf_len - len, "ack_tlv_proc = %u\n",
5694+
le32_to_cpu(htt_stats_buf->ack_tlv_proc));
5695+
len += scnprintf(buf + len, buf_len - len, "sched_id_proc = %u\n",
5696+
le32_to_cpu(htt_stats_buf->sched_id_proc));
5697+
len += scnprintf(buf + len, buf_len - len, "null_mpdu_tx_count = %u\n",
5698+
le32_to_cpu(htt_stats_buf->null_mpdu_tx_count));
5699+
len += scnprintf(buf + len, buf_len - len, "mpdu_bmap_not_recvd = %u\n",
5700+
le32_to_cpu(htt_stats_buf->mpdu_bmap_not_recvd));
5701+
len += scnprintf(buf + len, buf_len - len, "num_bar = %u\n",
5702+
le32_to_cpu(htt_stats_buf->num_bar));
5703+
len += scnprintf(buf + len, buf_len - len, "rts = %u\n",
5704+
le32_to_cpu(htt_stats_buf->rts));
5705+
len += scnprintf(buf + len, buf_len - len, "cts2self = %u\n",
5706+
le32_to_cpu(htt_stats_buf->cts2self));
5707+
len += scnprintf(buf + len, buf_len - len, "qos_null = %u\n",
5708+
le32_to_cpu(htt_stats_buf->qos_null));
5709+
len += scnprintf(buf + len, buf_len - len, "mpdu_tried_cnt = %u\n",
5710+
le32_to_cpu(htt_stats_buf->mpdu_tried_cnt));
5711+
len += scnprintf(buf + len, buf_len - len, "mpdu_queued_cnt = %u\n",
5712+
le32_to_cpu(htt_stats_buf->mpdu_queued_cnt));
5713+
len += scnprintf(buf + len, buf_len - len, "mpdu_ack_fail_cnt = %u\n",
5714+
le32_to_cpu(htt_stats_buf->mpdu_ack_fail_cnt));
5715+
len += scnprintf(buf + len, buf_len - len, "mpdu_filt_cnt = %u\n",
5716+
le32_to_cpu(htt_stats_buf->mpdu_filt_cnt));
5717+
len += scnprintf(buf + len, buf_len - len, "false_mpdu_ack_count = %u\n",
5718+
le32_to_cpu(htt_stats_buf->false_mpdu_ack_count));
5719+
len += scnprintf(buf + len, buf_len - len, "txq_timeout = %u\n",
5720+
le32_to_cpu(htt_stats_buf->txq_timeout));
5721+
5722+
stats_req->buf_len = len;
5723+
}
5724+
56645725
static int ath12k_dbg_htt_ext_stats_parse(struct ath12k_base *ab,
56655726
u16 tag, u16 len, const void *tag_buf,
56665727
void *user_data)
@@ -5960,6 +6021,9 @@ static int ath12k_dbg_htt_ext_stats_parse(struct ath12k_base *ab,
59606021
case HTT_STATS_PDEV_RTT_TBR_CMD_RESULT_STATS_TAG:
59616022
ath12k_htt_print_pdev_rtt_tbr_cmd_res_stats_tlv(tag_buf, len, stats_req);
59626023
break;
6024+
case HTT_STATS_TX_HWQ_CMN_TAG:
6025+
ath12k_htt_print_tx_hwq_stats_cmn_tlv(tag_buf, len, stats_req);
6026+
break;
59636027
default:
59646028
break;
59656029
}

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ enum ath12k_dbg_htt_ext_stats_type {
128128
ATH12K_DBG_HTT_EXT_STATS_RESET = 0,
129129
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX = 1,
130130
ATH12K_DBG_HTT_EXT_STATS_PDEV_RX = 2,
131+
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX_HWQ = 3,
131132
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX_SCHED = 4,
132133
ATH12K_DBG_HTT_EXT_STATS_PDEV_ERROR = 5,
133134
ATH12K_DBG_HTT_EXT_STATS_PDEV_TQM = 6,
@@ -174,6 +175,7 @@ enum ath12k_dbg_htt_tlv_tag {
174175
HTT_STATS_TX_PDEV_SIFS_TAG = 2,
175176
HTT_STATS_TX_PDEV_FLUSH_TAG = 3,
176177
HTT_STATS_STRING_TAG = 5,
178+
HTT_STATS_TX_HWQ_CMN_TAG = 6,
177179
HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11,
178180
HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12,
179181
HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13,
@@ -2130,4 +2132,28 @@ struct htt_rx_pdev_fw_stats_tlv {
21302132
__le32 bytes_received_high_32;
21312133
} __packed;
21322134

2135+
struct htt_tx_hwq_stats_cmn_tlv {
2136+
__le32 mac_id__hwq_id__word;
2137+
__le32 xretry;
2138+
__le32 underrun_cnt;
2139+
__le32 flush_cnt;
2140+
__le32 filt_cnt;
2141+
__le32 null_mpdu_bmap;
2142+
__le32 user_ack_failure;
2143+
__le32 ack_tlv_proc;
2144+
__le32 sched_id_proc;
2145+
__le32 null_mpdu_tx_count;
2146+
__le32 mpdu_bmap_not_recvd;
2147+
__le32 num_bar;
2148+
__le32 rts;
2149+
__le32 cts2self;
2150+
__le32 qos_null;
2151+
__le32 mpdu_tried_cnt;
2152+
__le32 mpdu_queued_cnt;
2153+
__le32 mpdu_ack_fail_cnt;
2154+
__le32 mpdu_filt_cnt;
2155+
__le32 false_mpdu_ack_count;
2156+
__le32 txq_timeout;
2157+
} __packed;
2158+
21332159
#endif

0 commit comments

Comments
 (0)