]> asedeno.scripts.mit.edu Git - linux.git/commit
samples/bpf: Convert XDP samples to libbpf usage
authorMaciej Fijalkowski <maciejromanfijalkowski@gmail.com>
Fri, 1 Feb 2019 21:42:25 +0000 (22:42 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 1 Feb 2019 22:37:51 +0000 (23:37 +0100)
commitbbaf6029c49ccf2dc93d9564af58a20d125947a1
treed01db083bd2806709339c7a78bf82daf0fde26c8
parent7313798b144c5b945dc47502a233cabb7022cb70
samples/bpf: Convert XDP samples to libbpf usage

Some of XDP samples that are attaching the bpf program to the interface
via libbpf's bpf_set_link_xdp_fd are still using the bpf_load.c for
loading and manipulating the ebpf program and maps. Convert them to do
this through libbpf usage and remove bpf_load from the picture.

While at it remove what looks like debug leftover in
xdp_redirect_map_user.c

In xdp_redirect_cpu, change the way that the program to be loaded onto
interface is chosen - user now needs to pass the program's section name
instead of the relative number. In case of typo print out the section
names to choose from.

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
samples/bpf/Makefile
samples/bpf/xdp_redirect_cpu_user.c
samples/bpf/xdp_redirect_map_user.c
samples/bpf/xdp_redirect_user.c
samples/bpf/xdp_router_ipv4_user.c
samples/bpf/xdp_tx_iptunnel_user.c