public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/bpf: skip verif_scale_pyperf600 on -E2BIG jump complexity limit
@ 2026-03-02  7:14 Sun Jian
  2026-03-04 11:24 ` Paul Chaignon
  0 siblings, 1 reply; 6+ messages in thread
From: Sun Jian @ 2026-03-02  7:14 UTC (permalink / raw)
  To: andrii, eddyz87
  Cc: ast, daniel, martin.lau, song, yonghong.song, john.fastabend,
	kpsingh, sdf, haoluo, jolsa, shuah, bpf, linux-kselftest,
	Sun Jian

verif_scale_pyperf600 loads pyperf600.bpf.o, a large scale case produced
by partial LLVM unrolling.

On some kernel/toolchain combinations, the verifier rejects it with -E2BIG:

  The sequence of 8193 jumps is too complex.

This hits the verifier jump sequence complexity limit (8192).

Treat -E2BIG for this test as SKIP rather than FAIL. Other pyperf600
variants are unaffected.

Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
---
 .../bpf/prog_tests/bpf_verif_scale.c          | 22 ++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
index 73f669014b69..181acdddea1c 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
@@ -112,13 +112,33 @@ void test_verif_scale_pyperf180()
 
 void test_verif_scale_pyperf600()
 {
+	libbpf_print_fn_t old_print_fn = NULL;
+	int err;
+
 	/* partial unroll. llvm will unroll loop ~150 times.
 	 * C loop count -> 600.
 	 * Asm loop count -> 4.
 	 * 16k insns in loop body.
 	 * Total of 5 such loops. Total program size ~82k insns.
 	 */
-	scale_test("pyperf600.bpf.o", BPF_PROG_TYPE_RAW_TRACEPOINT, false);
+
+	if (env.verifier_stats) {
+		test__force_log();
+		old_print_fn = libbpf_set_print(libbpf_debug_print);
+	}
+
+	err = check_load("pyperf600.bpf.o", BPF_PROG_TYPE_RAW_TRACEPOINT);
+
+	if (env.verifier_stats)
+		libbpf_set_print(old_print_fn);
+
+	if (err == -E2BIG) {
+		test__skip();
+		return;
+	}
+
+	ASSERT_OK(err, "expect_success");
+
 }
 
 void test_verif_scale_pyperf600_bpf_loop(void)

base-commit: 11439c4635edd669ae435eec308f4ab8a0804808
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] selftests/bpf: skip verif_scale_pyperf600 on -E2BIG jump complexity limit
  2026-03-02  7:14 [PATCH] selftests/bpf: skip verif_scale_pyperf600 on -E2BIG jump complexity limit Sun Jian
@ 2026-03-04 11:24 ` Paul Chaignon
  2026-03-05  0:49   ` sun jian
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Chaignon @ 2026-03-04 11:24 UTC (permalink / raw)
  To: Sun Jian
  Cc: andrii, eddyz87, ast, daniel, martin.lau, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, shuah, bpf,
	linux-kselftest

On Mon, Mar 02, 2026 at 03:14:34PM +0800, Sun Jian wrote:
> verif_scale_pyperf600 loads pyperf600.bpf.o, a large scale case produced
> by partial LLVM unrolling.
> 
> On some kernel/toolchain combinations, the verifier rejects it with -E2BIG:
> 
>   The sequence of 8193 jumps is too complex.
> 
> This hits the verifier jump sequence complexity limit (8192).
> 
> Treat -E2BIG for this test as SKIP rather than FAIL. Other pyperf600
> variants are unaffected.

This is a known issue with LLVM 19+ [1] and this test is already
skipped in CI [2, 3]. I don't think ignoring the error is the proper
fix here.

1 - https://lore.kernel.org/all/c8c590b2-40b2-4cc0-9eb7-410dbd080a49@linux.dev/
2 - https://github.com/kernel-patches/vmtest/commit/da142df34750386cac2ba10283d15216d5c8d033
3 - https://github.com/libbpf/libbpf/commit/02b3ec9ffc1b7000afa2a9ccc3dfd37de3bad8cb

Paul

> 
> Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
> ---
>  .../bpf/prog_tests/bpf_verif_scale.c          | 22 ++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
> index 73f669014b69..181acdddea1c 100644
> --- a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
> +++ b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
> @@ -112,13 +112,33 @@ void test_verif_scale_pyperf180()
>  
>  void test_verif_scale_pyperf600()
>  {
> +	libbpf_print_fn_t old_print_fn = NULL;
> +	int err;
> +
>  	/* partial unroll. llvm will unroll loop ~150 times.
>  	 * C loop count -> 600.
>  	 * Asm loop count -> 4.
>  	 * 16k insns in loop body.
>  	 * Total of 5 such loops. Total program size ~82k insns.
>  	 */
> -	scale_test("pyperf600.bpf.o", BPF_PROG_TYPE_RAW_TRACEPOINT, false);
> +
> +	if (env.verifier_stats) {
> +		test__force_log();
> +		old_print_fn = libbpf_set_print(libbpf_debug_print);
> +	}
> +
> +	err = check_load("pyperf600.bpf.o", BPF_PROG_TYPE_RAW_TRACEPOINT);
> +
> +	if (env.verifier_stats)
> +		libbpf_set_print(old_print_fn);
> +
> +	if (err == -E2BIG) {
> +		test__skip();
> +		return;
> +	}
> +
> +	ASSERT_OK(err, "expect_success");
> +
>  }
>  
>  void test_verif_scale_pyperf600_bpf_loop(void)
> 
> base-commit: 11439c4635edd669ae435eec308f4ab8a0804808
> -- 
> 2.43.0
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] selftests/bpf: skip verif_scale_pyperf600 on -E2BIG jump complexity limit
  2026-03-04 11:24 ` Paul Chaignon
@ 2026-03-05  0:49   ` sun jian
  2026-03-06  1:14     ` Alexei Starovoitov
  0 siblings, 1 reply; 6+ messages in thread
From: sun jian @ 2026-03-05  0:49 UTC (permalink / raw)
  To: Paul Chaignon
  Cc: andrii, eddyz87, ast, daniel, martin.lau, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, shuah, bpf,
	linux-kselftest

On Wed, Mar 4, 2026 at 7:24 PM Paul Chaignon <paul.chaignon@gmail.com> wrote:
>
> On Mon, Mar 02, 2026 at 03:14:34PM +0800, Sun Jian wrote:
> > verif_scale_pyperf600 loads pyperf600.bpf.o, a large scale case produced
> > by partial LLVM unrolling.
>
> This is a known issue with LLVM 19+ [1] and this test is already
> skipped in CI [2, 3]. I don't think ignoring the error is the proper
> fix here.
>
 Thanks for the pointers. Agreed — since this is a known LLVM issue, I'll drop
this patch.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] selftests/bpf: skip verif_scale_pyperf600 on -E2BIG jump complexity limit
  2026-03-05  0:49   ` sun jian
@ 2026-03-06  1:14     ` Alexei Starovoitov
  2026-03-06  2:08       ` sun jian
  0 siblings, 1 reply; 6+ messages in thread
From: Alexei Starovoitov @ 2026-03-06  1:14 UTC (permalink / raw)
  To: sun jian
  Cc: Paul Chaignon, Andrii Nakryiko, Eduard, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Shuah Khan, bpf, open list:KERNEL SELFTEST FRAMEWORK

On Wed, Mar 4, 2026 at 4:49 PM sun jian <sun.jian.kdev@gmail.com> wrote:
>
> On Wed, Mar 4, 2026 at 7:24 PM Paul Chaignon <paul.chaignon@gmail.com> wrote:
> >
> > On Mon, Mar 02, 2026 at 03:14:34PM +0800, Sun Jian wrote:
> > > verif_scale_pyperf600 loads pyperf600.bpf.o, a large scale case produced
> > > by partial LLVM unrolling.
> >
> > This is a known issue with LLVM 19+ [1] and this test is already
> > skipped in CI [2, 3]. I don't think ignoring the error is the proper
> > fix here.
> >
>  Thanks for the pointers. Agreed — since this is a known LLVM issue, I'll drop
> this patch.

It's been failing for too long.
Pls do a minimal change to its source to workaround this 8k limit.

pw-bot: cr

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] selftests/bpf: skip verif_scale_pyperf600 on -E2BIG jump complexity limit
  2026-03-06  1:14     ` Alexei Starovoitov
@ 2026-03-06  2:08       ` sun jian
  2026-03-06 12:08         ` sun jian
  0 siblings, 1 reply; 6+ messages in thread
From: sun jian @ 2026-03-06  2:08 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Paul Chaignon, Andrii Nakryiko, Eduard, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Shuah Khan, bpf, open list:KERNEL SELFTEST FRAMEWORK

On Fri, Mar 6, 2026 at 9:14 AM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
> It's been failing for too long.
> Pls do a minimal change to its source to workaround this 8k limit.

Will do, sending v2.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] selftests/bpf: skip verif_scale_pyperf600 on -E2BIG jump complexity limit
  2026-03-06  2:08       ` sun jian
@ 2026-03-06 12:08         ` sun jian
  0 siblings, 0 replies; 6+ messages in thread
From: sun jian @ 2026-03-06 12:08 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Paul Chaignon, Andrii Nakryiko, Eduard, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Shuah Khan, bpf, open list:KERNEL SELFTEST FRAMEWORK

v2 sent:
https://lore.kernel.org/bpf/20260306120024.1032301-1-sun.jian.kdev@gmail.com/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-06 12:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02  7:14 [PATCH] selftests/bpf: skip verif_scale_pyperf600 on -E2BIG jump complexity limit Sun Jian
2026-03-04 11:24 ` Paul Chaignon
2026-03-05  0:49   ` sun jian
2026-03-06  1:14     ` Alexei Starovoitov
2026-03-06  2:08       ` sun jian
2026-03-06 12:08         ` sun jian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox