Add a set of __arg_xxx macros which can be used to augment BPF global subprogs/functions with extra information for use by BPF verifier. Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx> --- tools/lib/bpf/bpf_helpers.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h index 77ceea575dc7..6e3f24f569b7 100644 --- a/tools/lib/bpf/bpf_helpers.h +++ b/tools/lib/bpf/bpf_helpers.h @@ -188,6 +188,15 @@ enum libbpf_tristate { !!sym; \ }) +#define __arg_nonnull __attribute((btf_decl_tag("arg:nonnull"))) + +#define __arg_ctx __attribute__((btf_decl_tag("arg:ctx"))) +#define __arg_dynptr __attribute__((btf_decl_tag("arg:dynptr"))) + +#define __arg_pkt_meta __attribute__((btf_decl_tag("arg:pkt_meta"))) +#define __arg_pkt_data __attribute__((btf_decl_tag("arg:pkt_data"))) +#define __arg_pkt_end __attribute__((btf_decl_tag("arg:pkt_end"))) + #ifndef ___bpf_concat #define ___bpf_concat(a, b) a ## b #endif -- 2.34.1