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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Feb 23 10:36:39 CET 2023


Hi,

FYI, your patch has been queued to stable release 20.11.8

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/25/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/632cf722cc2a9f850de14fa1a79adfced8449228

Thanks.

Luca Boccassi

---
>From 632cf722cc2a9f850de14fa1a79adfced8449228 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 799fa9f539..508f2c4268 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1845,6 +1845,8 @@ fwd_stats_display(void)
 			fwd_cycles += fs->core_cycles;
 	}
 	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];
 
@@ -1866,8 +1868,9 @@ fwd_stats_display(void)
 		total_recv += stats.ipackets;
 		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;
 
 		printf("\n  %s Forward statistics for port %-2d %s\n",
@@ -1891,8 +1894,8 @@ 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) {
 			if (ports_stats[pt_id].rx_stream)
-- 
2.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:29.644052780 +0000
+++ 0035-app-testpmd-fix-forwarding-stats-for-Tx-dropped.patch	2023-02-23 09:36:28.238170161 +0000
@@ -1 +1 @@
-From c3fd1e6089cce14ad3f941ab5df0501e03b3356c Mon Sep 17 00:00:00 2001
+From 632cf722cc2a9f850de14fa1a79adfced8449228 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 799fa9f539..508f2c4268 100644
@@ -32,2 +33,2 @@
-@@ -2061,6 +2061,8 @@ fwd_stats_display(void)
- 			fwd_cycles += fs->busy_cycles;
+@@ -1845,6 +1845,8 @@ fwd_stats_display(void)
+ 			fwd_cycles += fs->core_cycles;
@@ -41 +42 @@
-@@ -2082,8 +2084,9 @@ fwd_stats_display(void)
+@@ -1866,8 +1868,9 @@ fwd_stats_display(void)
@@ -53 +54 @@
-@@ -2110,8 +2113,8 @@ fwd_stats_display(void)
+@@ -1891,8 +1894,8 @@ fwd_stats_display(void)


More information about the stable mailing list