* [PATCH v3 bpf-next] bpf: add a verbose message if map limit is reached
@ 2024-04-02 7:33 Anton Protopopov
2024-04-02 14:19 ` Daniel Borkmann
2024-04-02 14:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Anton Protopopov @ 2024-04-02 7:33 UTC (permalink / raw)
To: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, Jiri Olsa,
Martin KaFai Lau, Stanislav Fomichev, Yonghong Song,
John Fastabend, bpf
Cc: Anton Protopopov
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)
v2 -> v3:
* fixed grammar (Anton)
Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Acked-by: John Fastabend <john.fastabend@gmail.com>
---
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 has reached the limit of %u\n",
+ MAX_USED_MAPS);
fdput(f);
return -E2BIG;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3 bpf-next] bpf: add a verbose message if map limit is reached
2024-04-02 7:33 [PATCH v3 bpf-next] bpf: add a verbose message if map limit is reached Anton Protopopov
@ 2024-04-02 14:19 ` Daniel Borkmann
2024-04-02 14:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2024-04-02 14:19 UTC (permalink / raw)
To: Anton Protopopov, Alexei Starovoitov, Andrii Nakryiko, Jiri Olsa,
Martin KaFai Lau, Stanislav Fomichev, Yonghong Song,
John Fastabend, bpf
On 4/2/24 9:33 AM, 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)
> v2 -> v3:
> * fixed grammar (Anton)
>
> Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
> Acked-by: Yonghong Song <yonghong.song@linux.dev>
> Acked-by: John Fastabend <john.fastabend@gmail.com>
> ---
> 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 has reached the limit of %u\n",
> + MAX_USED_MAPS);
Btw, small nit, but might make sense to streamline capitalization across
verbose() messages. Bit of a mix of small and capital letters right now
in the verifier code. Either way, independent of this one.
Cheers,
Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3 bpf-next] bpf: add a verbose message if map limit is reached
2024-04-02 7:33 [PATCH v3 bpf-next] bpf: add a verbose message if map limit is reached Anton Protopopov
2024-04-02 14:19 ` Daniel Borkmann
@ 2024-04-02 14:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-02 14:20 UTC (permalink / raw)
To: Anton Protopopov
Cc: ast, andrii, daniel, jolsa, martin.lau, sdf, yonghong.song,
john.fastabend, bpf
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:
On Tue, 2 Apr 2024 07:33:47 +0000 you 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)
> v2 -> v3:
> * fixed grammar (Anton)
>
> [...]
Here is the summary with links:
- [v3,bpf-next] bpf: add a verbose message if map limit is reached
https://git.kernel.org/bpf/bpf-next/c/9dc182c58b5f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-02 14:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-02 7:33 [PATCH v3 bpf-next] bpf: add a verbose message if map limit is reached Anton Protopopov
2024-04-02 14:19 ` Daniel Borkmann
2024-04-02 14:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox