| 357 | } |
| 358 | |
| 359 | void |
| 360 | nic_stats_clear(portid_t port_id) |
| 361 | { |
| 362 | int ret; |
| 363 | |
| 364 | if (port_id_is_invalid(port_id, ENABLED_WARN)) { |
| 365 | print_valid_ports(); |
| 366 | return; |
| 367 | } |
| 368 | |
| 369 | ret = rte_eth_stats_reset(port_id); |
| 370 | if (ret != 0) { |
| 371 | fprintf(stderr, |
| 372 | "%s: Error: failed to reset stats (port %u): %s", |
| 373 | __func__, port_id, strerror(-ret)); |
| 374 | return; |
| 375 | } |
| 376 | |
| 377 | ret = rte_eth_stats_get(port_id, &ports[port_id].stats); |
| 378 | if (ret != 0) { |
| 379 | if (ret < 0) |
| 380 | ret = -ret; |
| 381 | fprintf(stderr, |
| 382 | "%s: Error: failed to get stats (port %u): %s", |
| 383 | __func__, port_id, strerror(ret)); |
| 384 | return; |
| 385 | } |
| 386 | printf("\n NIC statistics for port %d cleared\n", port_id); |
| 387 | } |
| 388 | |
| 389 | void |
| 390 | nic_xstats_display(portid_t port_id) |
no test coverage detected