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

Function report_packet_stats

dpdk/app/dumpcap/main.c:564–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

562}
563
564static void
565report_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.

Callers 1

mainFunction · 0.85

Calls 2

rte_pcapng_write_statsFunction · 0.85
rte_pdump_statsClass · 0.70

Tested by

no test coverage detected