patch 'app/testpmd: fix forwarding stats for Tx dropped' has been queued to stable release 21.11.4

Kevin Traynor ktraynor at redhat.com
Thu Feb 23 16:05:42 CET 2023


Hi,

FYI, your patch has been queued to stable release 21.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/28/23. 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/b641ca3033155683a3e3c225dba24e07fd52ea1b

Thanks.

Kevin

---
>From b641ca3033155683a3e3c225dba24e07fd52ea1b Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at amd.com>
Date: Tue, 31 Jan 2023 11:56:03 +0000
Subject: [PATCH] app/testpmd: fix forwarding stats for Tx dropped

[ upstream commit c3fd1e6089cce14ad3f941ab5df0501e03b3356c ]

There is an inconsistency at displaying Tx dropped value for per port
forwarding stats and accumulated forwarding stats.

While displaying per port TX-dropped value, it only takes
'ports_stats[pt_id].tx_dropped' into account,
but for accumulated TX-dropped results it takes both
'ports_stats[pt_id].tx_dropped' & 'stats.oerrors' into account.

To fix, make both per port and accumulated stats display 'tx_dropped'
and 'stats.oerrors' (ports_stats[pt_id].tx_dropped + stats.oerrors).

Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand")

Reported-by: Joshua Washington <joshwash at google.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit at amd.com>
Acked-by: Huisong Li <lihuisong at huawei.com>
Acked-by: Aman Singh <aman.deep.singh at intel.com>
---
 app/test-pmd/testpmd.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index f1daa6e09d..4e15c982c8 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2078,4 +2078,6 @@ fwd_stats_display(void)
 	}
 	for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+		uint64_t tx_dropped = 0;
+
 		pt_id = fwd_ports_ids[i];
 		port = &ports[pt_id];
@@ -2099,6 +2101,7 @@ fwd_stats_display(void)
 		total_xmit += stats.opackets;
 		total_rx_dropped += stats.imissed;
-		total_tx_dropped += ports_stats[pt_id].tx_dropped;
-		total_tx_dropped += stats.oerrors;
+		tx_dropped += ports_stats[pt_id].tx_dropped;
+		tx_dropped += stats.oerrors;
+		total_tx_dropped += tx_dropped;
 		total_rx_nombuf  += stats.rx_nombuf;
 
@@ -2127,6 +2130,6 @@ fwd_stats_display(void)
 		printf("  TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64
 		       "TX-total: %-"PRIu64"\n",
-		       stats.opackets, ports_stats[pt_id].tx_dropped,
-		       stats.opackets + ports_stats[pt_id].tx_dropped);
+		       stats.opackets, tx_dropped,
+		       stats.opackets + tx_dropped);
 
 		if (record_burst_stats) {
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 14:46:25.043741769 +0000
+++ 0051-app-testpmd-fix-forwarding-stats-for-Tx-dropped.patch	2023-02-23 14:46:23.778235994 +0000
@@ -1 +1 @@
-From c3fd1e6089cce14ad3f941ab5df0501e03b3356c Mon Sep 17 00:00:00 2001
+From b641ca3033155683a3e3c225dba24e07fd52ea1b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c3fd1e6089cce14ad3f941ab5df0501e03b3356c ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -29 +30 @@
-index 86fa9c16ba..f3e29a5b4b 100644
+index f1daa6e09d..4e15c982c8 100644
@@ -32 +33 @@
-@@ -2062,4 +2062,6 @@ fwd_stats_display(void)
+@@ -2078,4 +2078,6 @@ fwd_stats_display(void)
@@ -39 +40 @@
-@@ -2083,6 +2085,7 @@ fwd_stats_display(void)
+@@ -2099,6 +2101,7 @@ fwd_stats_display(void)
@@ -49 +50 @@
-@@ -2111,6 +2114,6 @@ fwd_stats_display(void)
+@@ -2127,6 +2130,6 @@ fwd_stats_display(void)



More information about the stable mailing list