[PATCH ath-next 6/8] wifi: ath12k: track per-ring RX sent-to-stack count
Pardeep Kaur <[email protected]> Thu, 23 Jul 2026 18:24:46 +0530
| Newsgroups | org.infradead.lists.ath12k,org.kernel.vger.linux-wireless |
|---|---|
| Message-ID | <[email protected]> |
From: Hariharan Ramanathan <[email protected]> The device DP stats provide visibility into RX errors and drops but lack a counter for successfully delivered packets. Without this, it is difficult to correlate REO ring activity with actual stack delivery during debugging or performance analysis. Add sent_to_stack[DP_REO_DST_RING_MAX] to ath12k_device_dp_stats to track successful deliveries per REO ring. A per-device dimension is not needed because partner_dp is already resolved at the increment point, so the counter is incremented directly in partner_dp->device_stats, attributing it to the correct device without an extra index. Increment the counter just before each MSDU is handed off to the stack via ath12k_dp_rx_deliver_msdu(). Add a likely()/WARN_ON_ONCE() bounds check on ring_id before indexing sent_to_stack[], consistent with all other new stat arrays in this series. Expose the per-ring counts in the device_dp_stats debugfs file under a new 'REO sent to stack' section. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6.r1-00402-QCAHKSWPL_SILICONZ-1 Signed-off-by: Hariharan Ramanathan <[email protected]> Co-developed-by: Pardeep Kaur <[email protected]> Signed-off-by: Pardeep Kaur <[email protected]> --- drivers/net/wireless/ath/ath12k/debugfs.c | 5 +++++ drivers/net/wireless/ath/ath12k/dp.h | 1 + drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/debugfs.c b/drivers/net/wireless/ath/ath12k/debugfs.c index 5020d9608535..9a8d07bfb848 100644 --- a/drivers/net/wireless/ath/ath12k/debugfs.c +++ b/drivers/net/wireless/ath/ath12k/debugfs.c @@ -1122,6 +1122,11 @@ static ssize_t ath12k_debugfs_dump_device_dp_stats(struct file *file, len += scnprintf(buf + len, size - len, "%s: %u\n", wbm_rx_drop[i], device_stats->wbm_err.drop[i]); + len += scnprintf(buf + len, size - len, "\nREO sent to stack\n"); + for (i = 0; i < DP_REO_DST_RING_MAX; i++) + len += scnprintf(buf + len, size - len, "ring%d: %u\n", + i, device_stats->sent_to_stack[i]); + len += scnprintf(buf + len, size - len, "\nHAL REO errors:\n"); for (i = 0; i < DP_REO_DST_RING_MAX; i++) diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h index 563aa24ea55a..298b65142a0e 100644 --- a/drivers/net/wireless/ath/ath12k/dp.h +++ b/drivers/net/wireless/ath/ath12k/dp.h @@ -457,6 +457,7 @@ struct ath12k_device_dp_stats { u32 tx_enqueued[DP_TCL_NUM_RING_MAX]; u32 tx_completed[DP_TCL_NUM_RING_MAX]; u32 reo_excep_msdu_buf_type; + u32 sent_to_stack[DP_REO_DST_RING_MAX]; }; struct ath12k_dp { diff --git a/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c b/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c index b203513d63cc..33c4c89eefb5 100644 --- a/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c @@ -651,7 +651,10 @@ ath12k_wifi7_dp_rx_process_received_packets(struct ath12k_dp *dp, dev_kfree_skb_any(msdu); continue; } - + if (likely(ring_id < DP_REO_DST_RING_MAX)) + partner_dp->device_stats.sent_to_stack[ring_id]++; + else + WARN_ON_ONCE(1); ath12k_dp_rx_deliver_msdu(dp_pdev, napi, msdu, &rx_info); } -- 2.34.1