diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-05-31 15:07:15 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-05-31 15:07:15 +0200 |
commit | d8cdc6ab87550de9c93b1f6763ea6015f292d7fb (patch) | |
tree | e45481799a4436a4c5cb091151e2475e4da7df5c /xutils.c | |
parent | cacb34f95fb7937e81b1fe8add7b5dca91e3a4c5 (diff) |
ring: netsniff-ng: migrate capture only to TPACKET_V3
Lets migrate capturing to TPACKET_V3, since it will bring a better
performance due to fewer page cache misses caused by a higher density
of packets, since now they are contigous placed in the ring buffer.
It is said that TPACKET_V3 brings the following benefits:
*) ~15 - 20% reduction in CPU-usage
*) ~20% increase in packet capture rate
*) ~2x increase in packet density
*) Port aggregation analysis
*) Non static frame size to capture entire packet payload
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'xutils.c')
-rw-r--r-- | xutils.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -716,7 +716,7 @@ int device_bind_irq_to_cpu(int irq, int cpu) return (ret > 0 ? 0 : ret); } -void sock_print_net_stats(int sock, unsigned long skipped) +void sock_print_net_stats(int sock) { int ret; struct tpacket_stats kstats; @@ -730,10 +730,11 @@ void sock_print_net_stats(int sock, unsigned long skipped) uint64_t drops = kstats.tp_drops; printf("\r%12ld packets incoming\n", packets); - printf("\r%12ld packets passed filter\n", packets - drops - skipped); - printf("\r%12ld packets failed filter (out of space)\n", drops + skipped); + printf("\r%12ld packets passed filter\n", packets - drops); + printf("\r%12ld packets failed filter (out of space)\n", drops); if (kstats.tp_packets > 0) - printf("\r%12.4lf%\% packet droprate\n", (1.0 * drops / packets) * 100.0); + printf("\r%12.4lf%\% packet droprate\n", + (1.0 * drops / packets) * 100.0); } } |