]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: Add test for bpf_list_{front,back}
authorMartin KaFai Lau <martin.lau@kernel.org>
Tue, 6 May 2025 01:58:55 +0000 (18:58 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 6 May 2025 17:21:06 +0000 (10:21 -0700)
commit29318b4d5dc348367dee8ad0ad7b89350cf1161e
tree8028502f766be88219e125a72a2c80ef3429fedd
parentfb5b480205bad3936b054b86f7c9d2bd7835caac
selftests/bpf: Add test for bpf_list_{front,back}

This patch adds the "list_peek" test to use the new
bpf_list_{front,back} kfunc.

The test_{front,back}* tests ensure that the return value
is a non_own_ref node pointer and requires the spinlock to be held.

Suggested-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> # check non_own_ref marking
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20250506015857.817950-9-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/linked_list.c
tools/testing/selftests/bpf/progs/linked_list_peek.c [new file with mode: 0644]