Re: [PATCH bpf-next 1/2] libbpf: Move core "types_are_compat" logic into relo_core.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 22, 2022 at 05:35:05PM +0000, Daniel Müller wrote:
> diff --git a/tools/lib/bpf/relo_core.c b/tools/lib/bpf/relo_core.c
> index 6ad3c3..e54370 100644
> --- a/tools/lib/bpf/relo_core.c
> +++ b/tools/lib/bpf/relo_core.c
> @@ -141,6 +141,84 @@ static bool core_relo_is_enumval_based(enum bpf_core_relo_kind kind)
>  	}
>  }
>  
> +int bpf_core_types_are_compat_recur(const struct btf *local_btf, __u32 local_id,
> +				    const struct btf *targ_btf, __u32 targ_id, int level)
> +{

[...]

> +
> +		/* tail recurse for return type check */
> +		skip_mods_and_typedefs(local_btf, local_type->type, &local_id);
> +		skip_mods_and_typedefs(targ_btf, targ_type->type, &targ_id);
> +		goto recur;
> +	}
> +	default:
> +		return 0;

I actually left out the pr_warn here (present in libbpf but not the kernel). I
suppose it would be best to carry it over from libbpf?

Thanks,
Daniel



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux