Re: [PATCH bpf-next v2 6/6] docs/bpf: Describe how to change a kfunc's prototype

From: bot+bpf-ci

Date: Fri Nov 20 2026 - 19:58:10 EST


> docs/bpf: Describe how to change a kfunc's prototype

TL;DR: Docs-only question: the kfuncs.rst paragraph warning against renaming a
___vN kfunc for older libbpf seems to contradict the statement that older
libbpf can't see it; which case does it protect?

> diff --git a/Documentation/bpf/kfuncs.rst b/Documentation/bpf/kfuncs.rst
> --- a/Documentation/bpf/kfuncs.rst
> +++ b/Documentation/bpf/kfuncs.rst

[ ... ]

> +Only libbpf 1.9 and later look for ``bpf_foo___v1``. Older libbpf and light
> +skeletons see only ``bpf_foo``, as after an in-place change.

[ ... ]

> +Don't rename a ``<name>___vN`` kfunc while older libbpf or light skeletons
> +still load programs that call it by that name. libbpf 1.9 and later bind by
> +prototype, so a rename doesn't affect them.

This paragraph seems to contradict the earlier statement that older libbpf
and light skeletons see only bpf_foo.

Older libbpf strips the last ___ suffix from the declared name and looks up
the exact remaining name, so it should never resolve a kernel function
named <name>___vN, whatever name the program declares.

If so, can a rename of bpf_foo___v1 break programs loaded by older libbpf,
given that they could not bind it in the first place?

Is there a case this paragraph is meant to protect, such as a program using
a differently named declaration? If so, could it be described, so that
maintainers know which renames are safe?


---
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/44845964556