bpf: support multiple tags per argument
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 5 Jan 2024 00:09:05 +0000 (16:09 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 23 Jan 2024 22:40:21 +0000 (14:40 -0800)
commit522bb2c1f82b12eb7befaae815d1d959b8e6bba2
tree7ff504f352fe6f75aa63f2c612504b0ffbe22483
parent54c11ec4935a61af32bb03fc52e7172c97bd7203
bpf: support multiple tags per argument

Add ability to iterate multiple decl_tag types pointed to the same
function argument. Use this to support multiple __arg_xxx tags per
global subprog argument.

We leave btf_find_decl_tag_value() intact, but change its implementation
to use a new btf_find_next_decl_tag() which can be straightforwardly
used to find next BTF type ID of a matching btf_decl_tag type.
btf_prepare_func_args() is switched from btf_find_decl_tag_value() to
btf_find_next_decl_tag() to gain multiple tags per argument support.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20240105000909.2818934-5-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
kernel/bpf/btf.c