[PATCH 0/2] bpf: Introduce the bpf_list_del API

From: Chengkaitao

Date: Sun Feb 08 2026 - 21:53:34 EST


From: Kaitao Cheng <chengkaitao@xxxxxxxxxx>

In BPF, a list can only be used to implement a stack structure.
Due to an incomplete API set, only FIFO or LIFO operations are
supported.

We propose introducing the bpf_list_del API, which allows users
to directly remove a node from the list if the node pointer is
obtained beforehand. This patch enhances the BPF list API,
making it more list-like.

Kaitao Cheng (2):
bpf: Introduce the bpf_list_del kfunc.
selftests/bpf: Add test cases for bpf_list_del

kernel/bpf/helpers.c | 19 +++++++++
kernel/bpf/verifier.c | 6 ++-
.../testing/selftests/bpf/bpf_experimental.h | 11 +++++
.../selftests/bpf/progs/refcounted_kptr.c | 41 +++++++++++++++++++
4 files changed, 76 insertions(+), 1 deletion(-)

--
2.50.1 (Apple Git-155)