On Fri, Jul 8, 2016 at 5:15 AM, Brenden Blanco <bbla...@plumgrid.com> wrote: > Add a sample program that only drops packets at the BPF_PROG_TYPE_XDP_RX > hook of a link. With the drop-only program, observed single core rate is > ~20Mpps. > > Other tests were run, for instance without the dropcnt increment or > without reading from the packet header, the packet rate was mostly > unchanged. > > $ perf record -a samples/bpf/xdp1 $(</sys/class/net/eth0/ifindex) > proto 17: 20403027 drops/s > > ./pktgen_sample03_burst_single_flow.sh -i $DEV -d $IP -m $MAC -t 4 > Running... ctrl^C to stop > Device: eth4@0 > Result: OK: 11791017(c11788327+d2689) usec, 59622913 (60byte,0frags) > 5056638pps 2427Mb/sec (2427186240bps) errors: 0 > Device: eth4@1 > Result: OK: 11791012(c11787906+d3106) usec, 60526944 (60byte,0frags) > 5133311pps 2463Mb/sec (2463989280bps) errors: 0 > Device: eth4@2 > Result: OK: 11791019(c11788249+d2769) usec, 59868091 (60byte,0frags) > 5077431pps 2437Mb/sec (2437166880bps) errors: 0 > Device: eth4@3 > Result: OK: 11795039(c11792403+d2636) usec, 59483181 (60byte,0frags) > 5043067pps 2420Mb/sec (2420672160bps) errors: 0 > > perf report --no-children: > 26.05% ksoftirqd/0 [mlx4_en] [k] mlx4_en_process_rx_cq > 17.84% ksoftirqd/0 [mlx4_en] [k] mlx4_en_alloc_frags > 5.52% ksoftirqd/0 [mlx4_en] [k] mlx4_en_free_frag
This just proves my point on the previous patch, reusing the rx_desc buffers we are going to drop will save us here ~23% CPU wasted on (alloc_frags & free_frags ) ! and this can improve some benchmarks results where the CPU is the bottleneck.