Re: [PATCH bpf-next v3 2/4] bpf: Introduce __bpf_kfunc_mark_deprecated annotation

Kumar Kartikeya Dwivedi
2026-04-20T18:19:53Z

On Mon, 20 Apr 2026 at 20:15, David Faust <david.faust@oracle.com> wrote:
>
>
>
> On 4/18/26 10:16, Kumar Kartikeya Dwivedi wrote:
> > Documentation for KF_DEPRECATED documents the expectations and
> > recommendations for deprecating existing kfuncs. Until now, such a flag
> > never materialized. Unlike other kfunc flags, more context needs to be
> > carried with such a flag, thus we introduce __bpf_kfunc_mark_deprecated
> > as a replacement for the (non-existent) kfunc flag which takes a
> > replacement kfunc to provide recommendations to the user.
> >
> > Apply it to all existing impl-suffixed kfuncs that are preserved for
> > backwards compatibility for a few kernel releases, after we introduced
> > versions with KF_IMPLICIT_ARGS.
> >
> > Note that this is only supported by LLVM-compiled kernels as of writing,
> > since GCC does not support for BTF declaration tags.
>
> FYI support in GCC for BTF tags (both declaration and type) has been merged
> and will be available in gcc 16:
>
> https://inbox.sourceware.org/gcc-patches/f8ef5eca-4f1c-4efb-96a9-c65533e4573a@oracle.com/
>

Great news, thanks for letting me know! Hopefully, once this is out
and widespread, we'll be able to completely drop the ugly double
underscored suffixes for kfunc arguments by reusing declaration tags
there as well.

> We have been using it successfully with the selftest harness' __failure
> __msg etc. macros with gcc master.
>
> >
> …