Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Update xdp_redirect_map prog sections for libbpf

xdp_redirect_map.c is a bpf program used by test_xdp_veth.sh, which is not
handled by the generic test runner (test_progs). To allow converting this
test to test_progs, the corresponding program must be updated to allow
handling it through skeletons generated by bpftool and libbpf.

Update programs section names to allow to manipulate those with libbpf.

Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://lore.kernel.org/bpf/20240721-convert_test_xdp_veth-v4-1-23bdba21b2f9@bootlin.com
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>

authored by

Alexis Lothoré (eBPF Foundation) and committed by
Andrii Nakryiko
0bfdda9d 04a94133

+3 -3
+3 -3
tools/testing/selftests/bpf/progs/xdp_redirect_map.c
··· 10 10 __uint(value_size, sizeof(int)); 11 11 } tx_port SEC(".maps"); 12 12 13 - SEC("redirect_map_0") 13 + SEC("xdp") 14 14 int xdp_redirect_map_0(struct xdp_md *xdp) 15 15 { 16 16 return bpf_redirect_map(&tx_port, 0, 0); 17 17 } 18 18 19 - SEC("redirect_map_1") 19 + SEC("xdp") 20 20 int xdp_redirect_map_1(struct xdp_md *xdp) 21 21 { 22 22 return bpf_redirect_map(&tx_port, 1, 0); 23 23 } 24 24 25 - SEC("redirect_map_2") 25 + SEC("xdp") 26 26 int xdp_redirect_map_2(struct xdp_md *xdp) 27 27 { 28 28 return bpf_redirect_map(&tx_port, 2, 0);