OSDN Git Service

selftests/bpf: Redo the switch to new libbpf XDP APIs
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 2 Feb 2022 22:59:15 +0000 (14:59 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 3 Feb 2022 15:32:25 +0000 (16:32 +0100)
commite4e284a8c0d9823c07ee674445de05928be67231
treeadfcdb8b548bb9120dab439ad8a3e0c3aa4c8d30
parent32e608f82946e1e600f8c92b765c18b7189e596d
selftests/bpf: Redo the switch to new libbpf XDP APIs

Switch to using new bpf_xdp_*() APIs across all selftests. Take
advantage of a more straightforward and user-friendly semantics of
old_prog_fd (0 means "don't care") in few places.

This is a redo of 544356524dd6 ("selftests/bpf: switch to new libbpf XDP
APIs"), which was previously reverted to minimize conflicts during bpf
and bpf-next tree merge.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20220202225916.3313522-6-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/xdp_attach.c
tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c
tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c
tools/testing/selftests/bpf/prog_tests/xdp_info.c
tools/testing/selftests/bpf/prog_tests/xdp_link.c
tools/testing/selftests/bpf/xdp_redirect_multi.c
tools/testing/selftests/bpf/xdping.c