Re: [PATCH v1 bpf-next 01/18] bpf: Add BTF ID sets for fmod_ret targets
From: Anton Protopopov
Date: Mon Nov 09 2026 - 11:58:51 EST
On 26/11/06 09:02PM, Anton Protopopov wrote:
> Add BTF_SET8_FMODRET and the BTF_FMODRET_START() and BTF_FMODRET_END()
> macros to declare the functions BPF fmod_ret programs may attach to.
> They work like kfunc sets: each entry is a BTF_ID_FLAGS() line and
> KF_SLEEPABLE marks targets sleepable programs may attach to.
>
> Teach resolve_btfids to find these sets and tag every listed function in
> BTF with a "bpf_fmodret" decl tag, plus "bpf_fmodret_sleepable" when
> KF_SLEEPABLE is set. The sleepable tag never comes without "bpf_fmodret"
> and readers of the tags may rely on that. Share the set walk with the
> kfunc collection. Any other flag is an error. Nothing in the code refers
> to the sets, so keep .BTF_ids in the linker script, or --gc-sections may
> discard them.
going to send v2 to address robots comments + rebase (latest merge broke CI for me)