]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: add proper section name to bpf prog and rename it
authorAlexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Tue, 13 Aug 2024 12:45:07 +0000 (14:45 +0200)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 15 Aug 2024 01:10:47 +0000 (18:10 -0700)
commit7b4400a0a69b8255a2afed0bead0ce2c2c457545
treecbbc0a2b46319a53c5dac3ee382201a9ce5a74a6
parent37a14cfd667a22662867b986925f1ad4205c17df
selftests/bpf: add proper section name to bpf prog and rename it

test_skb_cgroup_id_kern.c is currently involved in a manual test. In its
current form, it can not be used with the auto-generated skeleton APIs,
because the section name is not valid to allow libbpf to deduce the program
type.

Update section name to allow skeleton APIs usage. Also rename the program
name to make it shorter and more straighforward regarding the API it is
testing. While doing so, make sure that test_skb_cgroup_id.sh passes to get
a working reference before converting it to test_progs
- update the obj name
- fix loading issue (verifier rejecting the program when loaded through tc,
  because of map not found), by preloading the whole obj with bpftool

Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Link: https://lore.kernel.org/r/20240813-convert_cgroup_tests-v4-3-a33c03458cf6@bootlin.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/progs/cgroup_ancestor.c [moved from tools/testing/selftests/bpf/progs/test_skb_cgroup_id_kern.c with 97% similarity]
tools/testing/selftests/bpf/test_skb_cgroup_id.sh