[dpdk-stable] patch 'app/testpmd: fix stats error message' has been queued to stable release 19.11.4
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Fri Jul 24 13:57:40 CEST 2020
Hi,
FYI, your patch has been queued to stable release 19.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 07/26/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.
Thanks.
Luca Boccassi
---
>From f6b4eb4e8488c734aa2c3bba7078f305276caab0 Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei at 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 at huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
app/test-pmd/config.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 42eba68b3..d5d246617 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -233,12 +233,14 @@ nic_stats_clear(portid_t port_id)
ret = rte_eth_stats_reset(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;
}
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));
return;
@@ -322,12 +324,14 @@ nic_xstats_clear(portid_t port_id)
ret = rte_eth_xstats_reset(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));
return;
}
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));
return;
--
2.20.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2020-07-24 12:53:49.469273842 +0100
+++ 0022-app-testpmd-fix-stats-error-message.patch 2020-07-24 12:53:48.207004969 +0100
@@ -1,8 +1,10 @@
-From 5fd722308ef21819931d25e7a140ff5a292b19d9 Mon Sep 17 00:00:00 2001
+From f6b4eb4e8488c734aa2c3bba7078f305276caab0 Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei at 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
@@ -11,7 +13,6 @@
Coverity issue: 349913, 358437, 358449, 358450
Fixes: da328f7f115a ("ethdev: change xstats reset function to return int")
Fixes: 9eb974221f44 ("app/testpmd: fix statistics after reset")
-Cc: stable at dpdk.org
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
@@ -20,10 +21,10 @@
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
-index 5381207cc..016bcb09c 100644
+index 42eba68b3..d5d246617 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
-@@ -244,12 +244,14 @@ nic_stats_clear(portid_t port_id)
+@@ -233,12 +233,14 @@ nic_stats_clear(portid_t port_id)
ret = rte_eth_stats_reset(port_id);
if (ret != 0) {
printf("%s: Error: failed to reset stats (port %u): %s",
@@ -39,7 +40,7 @@
printf("%s: Error: failed to get stats (port %u): %s",
__func__, port_id, strerror(ret));
return;
-@@ -333,12 +335,14 @@ nic_xstats_clear(portid_t port_id)
+@@ -322,12 +324,14 @@ nic_xstats_clear(portid_t port_id)
ret = rte_eth_xstats_reset(port_id);
if (ret != 0) {
printf("%s: Error: failed to reset xstats (port %u): %s",
More information about the stable
mailing list