Message ID | 20220623212205.2805002-6-deso@posteo.net (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | BPF |
Headers | show |
Series | Introduce type match support | expand |
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index f08037..d06855d 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -7524,6 +7524,15 @@ int bpf_core_types_are_compat(const struct btf *local_btf, __u32 local_id, MAX_TYPES_ARE_COMPAT_DEPTH); } +#define MAX_TYPES_MATCH_DEPTH 2 + +int bpf_core_types_match(const struct btf *local_btf, u32 local_id, + const struct btf *targ_btf, u32 targ_id) +{ + return __bpf_core_types_match(local_btf, local_id, targ_btf, targ_id, + MAX_TYPES_MATCH_DEPTH); +} + static bool bpf_core_is_flavor_sep(const char *s) { /* check X___Y name pattern, where X and Y are not underscores */
This change implements the kernel side of the "type matches" support, just calling the previously added core logic in relo_core.c. Signed-off-by: Daniel Müller <deso@posteo.net> --- kernel/bpf/btf.c | 9 +++++++++ 1 file changed, 9 insertions(+)