]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
libbpf: mark bpf_iter_num_{new,next,destroy} as __weak
authorAndrii Nakryiko <andrii@kernel.org>
Tue, 18 Apr 2023 00:21:48 +0000 (17:21 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 18 Apr 2023 19:45:11 +0000 (12:45 -0700)
commit94dccba7952072ce448a3278c66405fbb2a44ec5
treec069a1e9e77fac7fa75e3d6e249d3cf60e82a219
parentc5e64741670883a5b35d42f3125d611f5a4aa14f
libbpf: mark bpf_iter_num_{new,next,destroy} as __weak

Mark bpf_iter_num_{new,next,destroy}() kfuncs declared for
bpf_for()/bpf_repeat() macros as __weak to allow users to feature-detect
their presence and guard bpf_for()/bpf_repeat() loops accordingly for
backwards compatibility with old kernels.

Now that libbpf supports kfunc calls poisoning and better reporting of
unresolved (but called) kfuncs, declaring number iterator kfuncs in
bpf_helpers.h won't degrade user experience and won't cause unnecessary
kernel feature dependencies.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230418002148.3255690-7-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/bpf_helpers.h