BPF List
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Anton Protopopov <aspsk@isovalent.com>,
	 Alexei Starovoitov <ast@kernel.org>,
	 Andrii Nakryiko <andrii@kernel.org>,
	 Daniel Borkmann <daniel@iogearbox.net>,
	 Jiri Olsa <jolsa@kernel.org>,
	 Martin KaFai Lau <martin.lau@linux.dev>,
	 Stanislav Fomichev <sdf@google.com>,
	 Yonghong Song <yonghong.song@linux.dev>,
	 bpf@vger.kernel.org
Cc: Anton Protopopov <aspsk@isovalent.com>
Subject: RE: [PATCH v2 bpf-next] bpf: add a verbose message if map limit is reached
Date: Mon, 01 Apr 2024 18:49:53 -0700	[thread overview]
Message-ID: <660b6441860a3_801520892@john.notmuch> (raw)
In-Reply-To: <20240401100132.167226-1-aspsk@isovalent.com>

Anton Protopopov wrote:
> When more than 64 maps are used by a program and its subprograms the
> verifier returns -E2BIG. Add a verbose message which highlights the
> source of the error and also print the actual limit.
> 
> v1 -> v2:
>   * make the message more clear (Alexey)
> 
> Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
> Acked-by: Yonghong Song <yonghong.song@linux.dev>
> ---
>  kernel/bpf/verifier.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index edb650667f44..559526191ae7 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -18348,6 +18348,8 @@ static int resolve_pseudo_ldimm64(struct bpf_verifier_env *env)
>  			}
>  
>  			if (env->used_map_cnt >= MAX_USED_MAPS) {
> +				verbose(env, "The total number of maps per program is reached the limit of %u\n",
> +					MAX_USED_MAPS);
>  				fdput(f);
>  				return -E2BIG;
>  			}
> -- 
> 2.34.1
> 
> 

LGTM thanks.

Acked-by: John Fastabend <john.fastabend@gmail.com>

  reply	other threads:[~2024-04-02  1:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 10:01 [PATCH v2 bpf-next] bpf: add a verbose message if map limit is reached Anton Protopopov
2024-04-02  1:49 ` John Fastabend [this message]
2024-04-02  7:32   ` Anton Protopopov

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=660b6441860a3_801520892@john.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=andrii@kernel.org \
    --cc=aspsk@isovalent.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=yonghong.song@linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox