net/ixgbe: fix link state timing on fiber ports
[dpdk.git] / app / test-pmd / config.c
index 035d336..5381207 100644 (file)
@@ -234,11 +234,26 @@ nic_stats_display(portid_t port_id)
 void
 nic_stats_clear(portid_t port_id)
 {
+       int ret;
+
        if (port_id_is_invalid(port_id, ENABLED_WARN)) {
                print_valid_ports();
                return;
        }
-       rte_eth_stats_reset(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));
+               return;
+       }
+
+       ret = rte_eth_stats_get(port_id, &ports[port_id].stats);
+       if (ret != 0) {
+               printf("%s: Error: failed to get stats (port %u): %s",
+                      __func__, port_id, strerror(ret));
+               return;
+       }
        printf("\n  NIC statistics for port %d cleared\n", port_id);
 }
 
@@ -314,10 +329,19 @@ nic_xstats_clear(portid_t port_id)
                print_valid_ports();
                return;
        }
+
        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));
+               return;
+       }
+
+       ret = rte_eth_stats_get(port_id, &ports[port_id].stats);
+       if (ret != 0) {
+               printf("%s: Error: failed to get stats (port %u): %s",
+                      __func__, port_id, strerror(ret));
+               return;
        }
 }