| 562 | } |
| 563 | |
| 564 | static void |
| 565 | report_packet_stats(dumpcap_out_t out) |
| 566 | { |
| 567 | struct rte_pdump_stats pdump_stats; |
| 568 | struct interface *intf; |
| 569 | uint64_t ifrecv, ifdrop; |
| 570 | double percent; |
| 571 | |
| 572 | fputc('\n', stderr); |
| 573 | TAILQ_FOREACH(intf, &interfaces, next) { |
| 574 | if (rte_pdump_stats(intf->port, &pdump_stats) < 0) |
| 575 | continue; |
| 576 | |
| 577 | /* do what Wiretap does */ |
| 578 | ifrecv = pdump_stats.accepted + pdump_stats.filtered; |
| 579 | ifdrop = pdump_stats.nombuf + pdump_stats.ringfull; |
| 580 | |
| 581 | if (use_pcapng) |
| 582 | rte_pcapng_write_stats(out.pcapng, intf->port, |
| 583 | ifrecv, ifdrop, NULL); |
| 584 | |
| 585 | if (ifrecv == 0) |
| 586 | percent = 0; |
| 587 | else |
| 588 | percent = 100. * ifrecv / (ifrecv + ifdrop); |
| 589 | |
| 590 | fprintf(stderr, |
| 591 | "Packets received/dropped on interface '%s': " |
| 592 | "%"PRIu64 "/%" PRIu64 " (%.1f)\n", |
| 593 | intf->name, ifrecv, ifdrop, percent); |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | /* |
| 598 | * Start DPDK EAL with arguments. |
no test coverage detected