patch 'net/tap: fix handling of queue stats' has been queued to stable release 25.11.1
Kevin Traynor
ktraynor at redhat.com
Thu Mar 19 11:02:42 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/26. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/fca93e1eba997b010d0bc942cdb04088faa669a2
Thanks.
Kevin
---
>From fca93e1eba997b010d0bc942cdb04088faa669a2 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Sun, 22 Feb 2026 09:30:36 -0800
Subject: [PATCH] net/tap: fix handling of queue stats
[ upstream commit abacc3b2dac34bd0cafe23c95902730b0ace8bff ]
Drivers are supposed to account for packets in all queues.
If RTE_ETHDEV_QUEUE_STAT_CNTRS is configured to a small value,
the TAP PMD would skip counting some queues in the accumulated totals.
Also, use memset to clear stats since that is more future proof
if new stats are added.
Fixes: f46900d03823 ("net/tap: fix flow and port commands")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/tap/rte_eth_tap.c | 33 +++++++++++----------------------
1 file changed, 11 insertions(+), 22 deletions(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 7a8a98cddb..8b233a3143 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -957,15 +957,13 @@ tap_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *tap_stats,
struct eth_queue_stats *qstats)
{
- unsigned int i, imax;
- unsigned long rx_total = 0, tx_total = 0, tx_err_total = 0;
- unsigned long rx_bytes_total = 0, tx_bytes_total = 0;
- unsigned long rx_nombuf = 0, ierrors = 0;
+ unsigned int i;
+ uint64_t rx_total = 0, tx_total = 0, tx_err_total = 0;
+ uint64_t rx_bytes_total = 0, tx_bytes_total = 0;
+ uint64_t rx_nombuf = 0, ierrors = 0;
const struct pmd_internals *pmd = dev->data->dev_private;
/* rx queue statistics */
- imax = (dev->data->nb_rx_queues < RTE_ETHDEV_QUEUE_STAT_CNTRS) ?
- dev->data->nb_rx_queues : RTE_ETHDEV_QUEUE_STAT_CNTRS;
- for (i = 0; i < imax; i++) {
- if (qstats != NULL) {
+ for (i = 0; i < dev->data->nb_rx_queues; i++) {
+ if (qstats != NULL && i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
qstats->q_ipackets[i] = pmd->rxq[i].stats.ipackets;
qstats->q_ibytes[i] = pmd->rxq[i].stats.ibytes;
@@ -978,9 +976,6 @@ tap_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *tap_stats,
/* tx queue statistics */
- imax = (dev->data->nb_tx_queues < RTE_ETHDEV_QUEUE_STAT_CNTRS) ?
- dev->data->nb_tx_queues : RTE_ETHDEV_QUEUE_STAT_CNTRS;
-
- for (i = 0; i < imax; i++) {
- if (qstats != NULL) {
+ for (i = 0; i < dev->data->nb_tx_queues; i++) {
+ if (qstats != NULL && i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
qstats->q_opackets[i] = pmd->txq[i].stats.opackets;
qstats->q_obytes[i] = pmd->txq[i].stats.obytes;
@@ -1004,16 +999,10 @@ static int
tap_stats_reset(struct rte_eth_dev *dev)
{
- int i;
+ unsigned int i;
struct pmd_internals *pmd = dev->data->dev_private;
for (i = 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) {
- pmd->rxq[i].stats.ipackets = 0;
- pmd->rxq[i].stats.ibytes = 0;
- pmd->rxq[i].stats.ierrors = 0;
- pmd->rxq[i].stats.rx_nombuf = 0;
-
- pmd->txq[i].stats.opackets = 0;
- pmd->txq[i].stats.errs = 0;
- pmd->txq[i].stats.obytes = 0;
+ memset(&pmd->rxq[i].stats, 0, sizeof(struct pkt_stats));
+ memset(&pmd->txq[i].stats, 0, sizeof(struct pkt_stats));
}
--
2.53.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-03-19 10:01:08.412877684 +0000
+++ 0044-net-tap-fix-handling-of-queue-stats.patch 2026-03-19 10:01:07.112331261 +0000
@@ -1 +1 @@
-From abacc3b2dac34bd0cafe23c95902730b0ace8bff Mon Sep 17 00:00:00 2001
+From fca93e1eba997b010d0bc942cdb04088faa669a2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit abacc3b2dac34bd0cafe23c95902730b0ace8bff ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 71fb0a74fa..01af90e7b2 100644
+index 7a8a98cddb..8b233a3143 100644
More information about the stable
mailing list