OSDN Git Service

bpf, cpumap: Bulk skb using netif_receive_skb_list
authorLorenzo Bianconi <lorenzo@kernel.org>
Fri, 23 Apr 2021 09:27:27 +0000 (11:27 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 27 Apr 2021 15:13:49 +0000 (17:13 +0200)
commitbb0247807744dc93407771e13ba20af0b270ca6a
treebe1bd4b75aa83649fc5fd39178f7c2d917d0e478
parent10bf4e83167cc68595b85fd73bb91e8f2c086e36
bpf, cpumap: Bulk skb using netif_receive_skb_list

Rely on netif_receive_skb_list routine to send skbs converted from
xdp_frames in cpu_map_kthread_run in order to improve i-cache usage.
The proposed patch has been tested running xdp_redirect_cpu bpf sample
available in the kernel tree that is used to redirect UDP frames from
ixgbe driver to a cpumap entry and then to the networking stack. UDP
frames are generated using pktgen. Packets are discarded by the UDP
layer.

$ xdp_redirect_cpu  --cpu <cpu> --progname xdp_cpu_map0 --dev <eth>

bpf-next: ~2.35Mpps
bpf-next + cpumap skb-list: ~2.72Mpps

Rename drops counter in kmem_alloc_drops since now it reports just
kmem_cache_alloc_bulk failures

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Link: https://lore.kernel.org/bpf/c729f83e5d7482d9329e0f165bdbe5adcefd1510.1619169700.git.lorenzo@kernel.org
kernel/bpf/cpumap.c