MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nic_stats_clear

Function nic_stats_clear

dpdk/app/test-pmd/config.c:359–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359void
360nic_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
389void
390nic_xstats_display(portid_t port_id)

Callers 2

cmd_showportall_parsedFunction · 0.70
cmd_showport_parsedFunction · 0.70

Calls 5

port_id_is_invalidFunction · 0.85
print_valid_portsFunction · 0.85
rte_eth_stats_resetFunction · 0.85
rte_eth_stats_getFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected