All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: menglong8.dong@gmail.com
Cc: ast@kernel.org, rostedt@goodmis.org, mingo@redhat.com,
	davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, benbjiang@tencent.com,
	flyingpeng@tencent.com, imagedong@tencent.com,
	edumazet@google.com, kafai@fb.com, talalahmad@google.com,
	keescook@chromium.org, mengensun@tencent.com,
	dongli.zhang@oracle.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH] bpf: init map_btf_id during compiling
Date: Tue, 26 Apr 2022 11:26:21 -0700	[thread overview]
Message-ID: <20220426182621.kgut2bpateytcxaj@MacBook-Pro.local> (raw)
In-Reply-To: <20220424092613.863290-1-imagedong@tencent.com>

On Sun, Apr 24, 2022 at 05:26:13PM +0800, menglong8.dong@gmail.com wrote:
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 0918a39279f6..588a001cc767 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -4727,30 +4727,6 @@ static const struct bpf_map_ops * const btf_vmlinux_map_ops[] = {
>  #undef BPF_MAP_TYPE
>  };
>  
> -static int btf_vmlinux_map_ids_init(const struct btf *btf,
> -				    struct bpf_verifier_log *log)
> -{
> -	const struct bpf_map_ops *ops;
> -	int i, btf_id;
> -
> -	for (i = 0; i < ARRAY_SIZE(btf_vmlinux_map_ops); ++i) {
> -		ops = btf_vmlinux_map_ops[i];
> -		if (!ops || (!ops->map_btf_name && !ops->map_btf_id))
> -			continue;
> -		if (!ops->map_btf_name || !ops->map_btf_id) {
> -			bpf_log(log, "map type %d is misconfigured\n", i);
> -			return -EINVAL;
> -		}
> -		btf_id = btf_find_by_name_kind(btf, ops->map_btf_name,
> -					       BTF_KIND_STRUCT);
> -		if (btf_id < 0)
> -			return btf_id;
> -		*ops->map_btf_id = btf_id;
> -	}
> -
> -	return 0;
> -}
> -
>  static int btf_translate_to_vmlinux(struct bpf_verifier_log *log,
>  				     struct btf *btf,
>  				     const struct btf_type *t,
> @@ -4812,11 +4788,6 @@ struct btf *btf_parse_vmlinux(void)
>  	/* btf_parse_vmlinux() runs under bpf_verifier_lock */
>  	bpf_ctx_convert.t = btf_type_by_id(btf, bpf_ctx_convert_btf_id[0]);
>  
> -	/* find bpf map structs for map_ptr access checking */
> -	err = btf_vmlinux_map_ids_init(btf, log);
> -	if (err < 0)
> -		goto errout;
> -

Looks nice. Please address build warn and resubmit.

  parent reply	other threads:[~2022-04-26 18:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-24  9:26 [PATCH] bpf: init map_btf_id during compiling menglong8.dong
2022-04-24 11:47 ` kernel test robot
2022-04-26 18:26 ` Alexei Starovoitov [this message]
2022-04-26 18:30   ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220426182621.kgut2bpateytcxaj@MacBook-Pro.local \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=benbjiang@tencent.com \
    --cc=davem@davemloft.net \
    --cc=dongli.zhang@oracle.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=flyingpeng@tencent.com \
    --cc=imagedong@tencent.com \
    --cc=kafai@fb.com \
    --cc=keescook@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mengensun@tencent.com \
    --cc=menglong8.dong@gmail.com \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=talalahmad@google.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.