summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorIgor Romanov <igor.romanov@oktetlabs.ru>2019-09-06 15:34:53 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-07 15:00:54 +0200
commitda328f7f115a459a64fd7005d4acc1ec9e1ba8bd (patch)
treec00d9a77f2373da8b017f115a881938d23a4a058 /app
parentf430bbcecf3eed93916f45654f51dd19d6955aa2 (diff)
downloaddpdk-da328f7f115a459a64fd7005d4acc1ec9e1ba8bd.zip
dpdk-da328f7f115a459a64fd7005d4acc1ec9e1ba8bd.tar.gz
dpdk-da328f7f115a459a64fd7005d4acc1ec9e1ba8bd.tar.xz
ethdev: change xstats reset function to return int
Change rte_eth_xstats_reset() return value from void to int and return negative errno values in case of error conditions. Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'app')
-rw-r--r--app/proc-info/main.c10
-rw-r--r--app/test-pmd/config.c8
2 files changed, 16 insertions, 2 deletions
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 34eb7a7..94e808d 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -580,8 +580,16 @@ err:
static void
nic_xstats_clear(uint16_t port_id)
{
+ int ret;
+
printf("\n Clearing NIC xstats for port %d\n", port_id);
- rte_eth_xstats_reset(port_id);
+ ret = rte_eth_xstats_reset(port_id);
+ if (ret != 0) {
+ printf("\n Error clearing xstats for port %d: %s\n", port_id,
+ strerror(-ret));
+ return;
+ }
+
printf("\n NIC extended statistics for port %d cleared\n", port_id);
}
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 24158e5..857b6da 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -273,7 +273,13 @@ nic_xstats_display(portid_t port_id)
void
nic_xstats_clear(portid_t port_id)
{
- rte_eth_xstats_reset(port_id);
+ int ret;
+
+ 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));
+ }
}
void