Message ID | 1591326079-47091-1-git-send-email-xavier.huwei@huawei.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Ferruh Yigit |
Headers | |
Series | [v2] app/testpmd: fix passing negative parameter to strerror | |
Checks
Context | Check | Description |
---|---|---|
ci/iol-broadcom-Performance | success | Performance Testing PASS |
ci/iol-intel-Performance | success | Performance Testing PASS |
ci/iol-nxp-Performance | success | Performance Testing PASS |
ci/Intel-compilation | success | Compilation OK |
ci/iol-mellanox-Performance | success | Performance Testing PASS |
ci/iol-testing | warning | Testing issues |
ci/travis-robot | success | Travis build: passed |
ci/checkpatch | warning | coding style issues |
Commit Message
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 5381207..016bcb0 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -244,12 +244,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; @@ -333,12 +335,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;