]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Add test cases for bpf_list_del/add/is_first/is_last/empty
authorKaitao Cheng <chengkaitao@kylinos.cn>
Thu, 21 May 2026 03:23:06 +0000 (11:23 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 21 May 2026 09:47:46 +0000 (02:47 -0700)
commitba3dc064f4065471487a8cc93c47efda4fe358dd
tree7f8baa00d7e991880b7abeaf01411c86e17676ed
parent745515d386eb5e6891d9f91a92ad15dace3a33ef
selftests/bpf: Add test cases for bpf_list_del/add/is_first/is_last/empty

Extend refcounted_kptr with tests for bpf_list_add (including prev from
bpf_list_front and bpf_refcount_acquire), bpf_list_del (including node
from bpf_list_front, bpf_rbtree_remove and bpf_refcount_acquire),
bpf_list_empty, bpf_list_is_first/last, and push_back on uninit head.

To verify the validity of bpf_list_del/add, the test also expects the
verifier to reject calls to bpf_list_del/add made without holding the
spin_lock.

Signed-off-by: Kaitao Cheng <chengkaitao@kylinos.cn>
Link: https://lore.kernel.org/r/20260521032306.97118-9-kaitao.cheng@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/refcounted_kptr.c