> diff --git a/tools/testing/selftests/bpf/bpf_experimental.h
> b/tools/testing/selftests/bpf/bpf_experimental.h
> --- a/tools/testing/selftests/bpf/bpf_experimental.h
> +++ b/tools/testing/selftests/bpf/bpf_experimental.h
> @@ -86,6 +86,22 @@ #define bpf_list_push_front(head, node)
> bpf_list_push_front_impl(head, node, NULL, 0)
> #define bpf_list_push_back(head, node) bpf_list_push_back_impl(head, node,
> NULL, 0)
>
> +/* Description
> + * Insert 'new' after 'prev' in the BPF linked list with head 'head'.
[ ... ]
> +extern int bpf_list_add_impl(struct bpf_list_head *head, struct
> bpf_list_node *new,
> + struct bpf_list_node *prev, void *meta, __u64 off)
> __ksym;
> +
> +/* Convenience macro to wrap over bpf_list_add_impl */
> +#define bpf_list_add(head, new, prev) bpf_list_add_impl(head, new, prev,
> NULL, 0)
This adds the extern declaration for bpf_list_add_impl, but the test
also calls bpf_list_del(), bpf_list_empty(), bpf_list_is_first(),
bpf_list_is_last(), and bpf_list_front(). Are the extern __ksym
declarations for those five kfuncs missing from this header?
The v6 of this series added all the declarations here (39 lines), but
v7 reduced it to just bpf_list_add_impl. The btf_dump code in libbpf
(btf_dump.c) treats BTF_KIND_FUNC as unsupported data and does not emit
function prototypes into vmlinux.h:
tools/lib/bpf/btf_dump.c:btf_dump_emit_type_decl_via_under() {
...
case BTF_KIND_FUNC:
case BTF_KIND_FUNC_PROTO:
err = btf_dump_unsupported_data(d, t, id);
...
}
Without declarations, the BPF program will not compile. The existing
kfuncs in this file (bpf_list_push_front_impl, bpf_list_pop_front,
bpf_list_pop_back, etc.) all have explicit extern __ksym declarations
here. Would something like the following be needed?
extern struct bpf_list_node *bpf_list_del(struct bpf_list_head *head,
struct bpf_list_node *node)
__ksym;
extern bool bpf_list_is_first(struct bpf_list_head *head,
struct bpf_list_node *node) __ksym;
extern bool bpf_list_is_last(struct bpf_list_head *head,
struct bpf_list_node *node) __ksym;
extern bool bpf_list_empty(struct bpf_list_head *head) __ksym;
extern struct bpf_list_node *bpf_list_front(struct bpf_list_head *head)
__ksym;
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/22822524869