public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Zhanibek Bakin <zhanibek.bakin@gmail.com>
To: dev@dpdk.org
Cc: mtetsuyah@gmail.com, stephen@networkplumber.org,
	Zhanibek Bakin <zhanibek.bakin@gmail.com>,
	stable@dpdk.org
Subject: [PATCH] net/null: fix Tx statistics accumulation
Date: Thu, 29 Jan 2026 14:03:12 +0500	[thread overview]
Message-ID: <20260129090312.98636-1-zhanibek.bakin@gmail.com> (raw)

The eth_stats_get() function incorrectly uses assignment (=) instead
of accumulation (+=) for opackets and obytes in the TX queue loop.
This causes only the last TX queue's statistics to be reported,
while the RX side correctly uses +=.

Fixes: 31326ce7f151 ("net/null: count all queues")
Cc: stable@dpdk.org

Signed-off-by: Zhanibek Bakin <zhanibek.bakin@gmail.com>
---
v2: Fixed Fixes tag to use 12-character hash
---
 drivers/net/null/rte_eth_null.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 46e7e7bd8c..7fba3a661b 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -345,8 +345,8 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
 		pkts = rte_atomic_load_explicit(&q->tx_pkts, rte_memory_order_relaxed);
 		bytes = rte_atomic_load_explicit(&q->tx_bytes, rte_memory_order_relaxed);
 
-		stats->opackets = pkts;
-		stats->obytes = bytes;
+		stats->opackets += pkts;
+		stats->obytes += bytes;
 
 		if (qstats != NULL && i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
 			qstats->q_opackets[i] = pkts;
-- 
2.43.0


             reply	other threads:[~2026-01-29  9:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29  9:03 Zhanibek Bakin [this message]
2026-01-29 20:17 ` [PATCH] net/null: fix Tx statistics accumulation Stephen Hemminger
  -- strict thread matches above, loose matches on Subject: below --
2026-01-29  8:51 Zhanibek Bakin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260129090312.98636-1-zhanibek.bakin@gmail.com \
    --to=zhanibek.bakin@gmail.com \
    --cc=dev@dpdk.org \
    --cc=mtetsuyah@gmail.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox