答复: [PATCH v2] libbpf: Clean up legacy bpf maps declaration in bpf_helpers

From: Liuxin(EulerOS)
Date: Mon Sep 12 2022 - 23:41:00 EST


Thanks to Song and Andrii for their advice, I will fix it in V3.

-----邮件原件-----
发件人: Andrii Nakryiko [mailto:andrii.nakryiko@xxxxxxxxx]
发送时间: 2022年9月10日 8:44
收件人: Liuxin(EulerOS) <liuxin350@xxxxxxxxxx>
抄送: andrii@xxxxxxxxxx; daniel@xxxxxxxxxxxxx; ast@xxxxxxxxxx; martin.lau@xxxxxxxxx; song@xxxxxxxxxx; yhs@xxxxxx; john.fastabend@xxxxxxxxx; kpsingh@xxxxxxxxxx; sdf@xxxxxxxxxx; haoluo@xxxxxxxxxx; jolsa@xxxxxxxxxx; bpf@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; 854182924@xxxxxx; Yanan (Euler) <yanan@xxxxxxxxxx>; Wuchangye (EulerOS) <wuchangye@xxxxxxxxxx>; Xiesongyang <xiesongyang@xxxxxxxxxx>; zhudi (E) <zhudi2@xxxxxxxxxx>; kongweibin (A) <kongweibin2@xxxxxxxxxx>
主题: Re: [PATCH v2] libbpf: Clean up legacy bpf maps declaration in bpf_helpers

On Tue, Sep 6, 2022 at 7:51 PM Liuxin(EulerOS) <liuxin350@xxxxxxxxxx> wrote:
>
> Legacy bpf maps declaration were no longer supported in Libbpf 1.0, so it was time to remove the definition of bpf_map_def in bpf_helpers.h.

please make sure that commit log lines are wrapped at <80 characters
>
> LINK:[1]
> https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0

don't add "LINK", just two spaces and then [0] and then refer to it from the above as "supported in Libbpf 1.0 ([0])"


>
> Acked-by: Song Liu <song@xxxxxxxxxx>
> Signed-off-by: Xin Liu<liuxin350@xxxxxxxxxx>

space after name and before opening < is missing

> ---
> Changes in v2:
> - Fix strange signatures
>

It looks good overall, but your patch doesn't apply. Please make sure you base it on top of bpf-next's master and you use git send-email which won't clobber the patch. Thanks.

> V1:
> https://lore.kernel.org/bpf/CAPhsuW7Em6q5hqiKWEZpJOaU5DTrZE+BPPHq+Chyz
> 0-+-yQ_ZA@xxxxxxxxxxxxxx/T/#t
>
> tools/lib/bpf/bpf_helpers.h | 12 ------------
> 1 file changed, 12 deletions(-)
>
> diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h
> index 867b73483..9cad13e7f 100644
> --- a/tools/lib/bpf/bpf_helpers.h
> +++ b/tools/lib/bpf/bpf_helpers.h
> @@ -167,18 +167,6 @@ bpf_tail_call_static(void *ctx, const void *map,
> const __u32 slot) } #endif
>
> -/*
> - * Helper structure used by eBPF C program
> - * to describe BPF map attributes to libbpf loader
> - */
> -struct bpf_map_def {
> - unsigned int type;
> - unsigned int key_size;
> - unsigned int value_size;
> - unsigned int max_entries;
> - unsigned int map_flags;
> -} __attribute__((deprecated("use BTF-defined maps in .maps
> section")));
> -
> enum libbpf_pin_type {
> LIBBPF_PIN_NONE,
> /* PIN_BY_NAME: pin maps by name (in /sys/fs/bpf by default)
> */
> --
> 2.33.0