libbpf: Add support for BPF XDP link
authorAndrii Nakryiko <andriin@fb.com>
Wed, 22 Jul 2020 06:46:00 +0000 (23:46 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 26 Jul 2020 03:37:02 +0000 (20:37 -0700)
commitdc8698cac7aada9b61a612cb819341d84591163e
treed3be5774e01e3c0ec41e4d2653b0c06a99437744
parentc1931c9784ebb5787c0784c112fb8baa5e8455b3
libbpf: Add support for BPF XDP link

Sync UAPI header and add support for using bpf_link-based XDP attachment.
Make xdp/ prog type set expected attach type. Kernel didn't enforce
attach_type for XDP programs before, so there is no backwards compatiblity
issues there.

Also fix section_names selftest to recognize that xdp prog types now have
expected attach type.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200722064603.3350758-8-andriin@fb.com
tools/include/uapi/linux/bpf.h
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map
tools/testing/selftests/bpf/prog_tests/section_names.c