patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] patch 'app/testpmd: fix stats error message' has been queued to LTS release 18.11.10
@ 2020-09-02  9:12 Kevin Traynor
  2020-09-02  9:12 ` [dpdk-stable] patch 'net/cxgbe: fix double MPS alloc by flow validate and create' " Kevin Traynor
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Traynor @ 2020-09-02  9:12 UTC (permalink / raw)
  To: Wei Hu (Xavier); +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 18.11.10

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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/16e7a4b710d001d91f8b60b91ee83966dcad447b

Thanks.

Kevin.

---
From 16e7a4b710d001d91f8b60b91ee83966dcad447b Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Date: Sat, 6 Jun 2020 11:46:37 +0800
Subject: [PATCH] app/testpmd: fix stats error message

[ upstream commit 5fd722308ef21819931d25e7a140ff5a292b19d9 ]

There are coverity defects related "Argument cannot be negative"

This patch fixes them by passing '-ret' to the function strerror() when
ret is negative.

Coverity issue: 349913, 358437, 358449, 358450
Fixes: da328f7f115a ("ethdev: change xstats reset function to return int")
Fixes: 9eb974221f44 ("app/testpmd: fix statistics after reset")

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/config.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index b51e821a45..3b588e2042 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -232,5 +232,5 @@ nic_stats_clear(portid_t port_id)
 	if (ret != 0) {
 		printf("%s: Error: failed to reset stats (port %u): %s",
-		       __func__, port_id, strerror(ret));
+		       __func__, port_id, strerror(-ret));
 		return;
 	}
@@ -238,4 +238,6 @@ nic_stats_clear(portid_t port_id)
 	ret = rte_eth_stats_get(port_id, &ports[port_id].stats);
 	if (ret != 0) {
+		if (ret < 0)
+			ret = -ret;
 		printf("%s: Error: failed to get stats (port %u): %s",
 		       __func__, port_id, strerror(ret));
@@ -317,8 +319,9 @@ nic_xstats_clear(portid_t port_id)
 		return;
 	}
-	rte_eth_xstats_reset(port_id);
 
 	ret = rte_eth_stats_get(port_id, &ports[port_id].stats);
 	if (ret != 0) {
+		if (ret < 0)
+			ret = -ret;
 		printf("%s: Error: failed to get stats (port %u): %s",
 		       __func__, port_id, strerror(ret));
-- 
2.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-09-02 10:08:36.585681610 +0100
+++ 0001-app-testpmd-fix-stats-error-message.patch	2020-09-02 10:08:36.554496721 +0100
@@ -1 +1 @@
-From 5fd722308ef21819931d25e7a140ff5a292b19d9 Mon Sep 17 00:00:00 2001
+From 16e7a4b710d001d91f8b60b91ee83966dcad447b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5fd722308ef21819931d25e7a140ff5a292b19d9 ]
+
@@ -14 +15,0 @@
-Cc: stable@dpdk.org
@@ -19,2 +20,2 @@
- app/test-pmd/config.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
+ app/test-pmd/config.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
@@ -23 +24 @@
-index 5381207cc2..016bcb09c4 100644
+index b51e821a45..3b588e2042 100644
@@ -26 +27 @@
-@@ -245,5 +245,5 @@ nic_stats_clear(portid_t port_id)
+@@ -232,5 +232,5 @@ nic_stats_clear(portid_t port_id)
@@ -33 +34 @@
-@@ -251,4 +251,6 @@ nic_stats_clear(portid_t port_id)
+@@ -238,4 +238,6 @@ nic_stats_clear(portid_t port_id)
@@ -40,5 +41 @@
-@@ -334,5 +336,5 @@ nic_xstats_clear(portid_t port_id)
- 	if (ret != 0) {
- 		printf("%s: Error: failed to reset xstats (port %u): %s",
--		       __func__, port_id, strerror(ret));
-+		       __func__, port_id, strerror(-ret));
+@@ -317,8 +319,9 @@ nic_xstats_clear(portid_t port_id)
@@ -47 +44,2 @@
-@@ -340,4 +342,6 @@ nic_xstats_clear(portid_t port_id)
+-	rte_eth_xstats_reset(port_id);
+ 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-02  9:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02  9:12 [dpdk-stable] patch 'app/testpmd: fix stats error message' has been queued to LTS release 18.11.10 Kevin Traynor
2020-09-02  9:12 ` [dpdk-stable] patch 'net/cxgbe: fix double MPS alloc by flow validate and create' " Kevin Traynor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).