OSDN Git Service

samples: bpf: convert some XDP samples from bpf_load to libbpf
authorJakub Kicinski <jakub.kicinski@netronome.com>
Thu, 10 May 2018 17:24:43 +0000 (10:24 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 10 May 2018 23:44:17 +0000 (01:44 +0200)
commitbe5bca44aa6b37b88e900d5f5f155911d6984d86
tree880940e6af0c8352acc8c5f2158ec1457a2dc08c
parent17387dd5ac2c9c4e5f7d38b5affcd70e059f0a8c
samples: bpf: convert some XDP samples from bpf_load to libbpf

Now that we can use full powers of libbpf in BPF samples, we
should perhaps make the simplest XDP programs not depend on
bpf_load helpers.  This way newcomers will be exposed to the
recommended library from the start.

Use of bpf_prog_load_xattr() will also make it trivial to later
on request offload of the programs by simply adding ifindex to
the xattr.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
samples/bpf/Makefile
samples/bpf/xdp1_user.c
samples/bpf/xdp_adjust_tail_user.c
samples/bpf/xdp_rxq_info_user.c