public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: remove unused toggle in tc_tunnel
@ 2026-04-03  7:52 Alexis Lothoré (eBPF Foundation)
  2026-04-03 10:22 ` Paul Chaignon
  2026-04-06  1:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Alexis Lothoré (eBPF Foundation) @ 2026-04-03  7:52 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Kumar Kartikeya Dwivedi,
	Song Liu, Yonghong Song, Jiri Olsa, Shuah Khan
  Cc: ebpf, Bastien Curutchet, Thomas Petazzoni, bpf, linux-kselftest,
	linux-kernel, Alexis Lothoré (eBPF Foundation)

tc_tunnel test is based on a send_and_test_data function which takes a
subtest configuration, and a boolean indicating whether the connection
is supposed to fail or not. This boolean is systematically passed to
true, and is a remnant from the first (not integrated) attempts to
convert tc_tunnel to test_progs: those versions validated for
example that a connection properly fails when only one side of the
connection has tunneling enabled. This specific testing has not been
integrated because it involved large timeouts which increased quite a
lot the test duration, for little added value.

Remove the unused boolean from send_and_test_data to simplify the
generic part of subtests.

Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
---
 tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c b/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c
index 23b5c522ea9f..1aa7c9463980 100644
--- a/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c
+++ b/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c
@@ -206,18 +206,13 @@ static void disconnect_client_from_server(struct subtest_cfg *cfg,
 	free(conn);
 }
 
-static int send_and_test_data(struct subtest_cfg *cfg, bool must_succeed)
+static int send_and_test_data(struct subtest_cfg *cfg)
 {
 	struct connection *conn;
 	int err, res = -1;
 
 	conn = connect_client_to_server(cfg);
-	if (!must_succeed && !ASSERT_ERR_PTR(conn, "connection that must fail"))
-		goto end;
-	else if (!must_succeed)
-		return 0;
-
-	if (!ASSERT_OK_PTR(conn, "connection that must succeed"))
+	if (!ASSERT_OK_PTR(conn, "connect to server"))
 		return -1;
 
 	err = send(conn->client_fd, tx_buffer, DEFAULT_TEST_DATA_SIZE, 0);
@@ -391,7 +386,7 @@ static void run_test(struct subtest_cfg *cfg)
 		goto fail;
 
 	/* Basic communication must work */
-	if (!ASSERT_OK(send_and_test_data(cfg, true), "connect without any encap"))
+	if (!ASSERT_OK(send_and_test_data(cfg), "connect without any encap"))
 		goto fail;
 
 	/* Attach encapsulation program to client */
@@ -403,7 +398,7 @@ static void run_test(struct subtest_cfg *cfg)
 		if (!ASSERT_OK(configure_kernel_decapsulation(cfg),
 					"configure kernel decapsulation"))
 			goto fail;
-		if (!ASSERT_OK(send_and_test_data(cfg, true),
+		if (!ASSERT_OK(send_and_test_data(cfg),
 			       "connect with encap prog and kern decap"))
 			goto fail;
 	}
@@ -411,7 +406,7 @@ static void run_test(struct subtest_cfg *cfg)
 	/* Replace kernel decapsulation with BPF decapsulation, test must pass */
 	if (!ASSERT_OK(configure_ebpf_decapsulation(cfg), "configure ebpf decapsulation"))
 		goto fail;
-	ASSERT_OK(send_and_test_data(cfg, true), "connect with encap and decap progs");
+	ASSERT_OK(send_and_test_data(cfg), "connect with encap and decap progs");
 
 fail:
 	close_netns(nstoken);

---
base-commit: 9ebb4fa90266705741534924eac62d6f03895fea
change-id: 20260403-tc_tunnel_cleanup-bf03af4f8c7c

Best regards,
--  
Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>


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

* Re: [PATCH bpf-next] selftests/bpf: remove unused toggle in tc_tunnel
  2026-04-03  7:52 [PATCH bpf-next] selftests/bpf: remove unused toggle in tc_tunnel Alexis Lothoré (eBPF Foundation)
@ 2026-04-03 10:22 ` Paul Chaignon
  2026-04-06  1:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Chaignon @ 2026-04-03 10:22 UTC (permalink / raw)
  To: Alexis Lothoré (eBPF Foundation)
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Kumar Kartikeya Dwivedi,
	Song Liu, Yonghong Song, Jiri Olsa, Shuah Khan, ebpf,
	Bastien Curutchet, Thomas Petazzoni, bpf, linux-kselftest,
	linux-kernel

On Fri, Apr 03, 2026 at 09:52:06AM +0200, Alexis Lothoré (eBPF Foundation) wrote:
> tc_tunnel test is based on a send_and_test_data function which takes a
> subtest configuration, and a boolean indicating whether the connection
> is supposed to fail or not. This boolean is systematically passed to
> true, and is a remnant from the first (not integrated) attempts to
> convert tc_tunnel to test_progs: those versions validated for
> example that a connection properly fails when only one side of the
> connection has tunneling enabled. This specific testing has not been
> integrated because it involved large timeouts which increased quite a
> lot the test duration, for little added value.
> 
> Remove the unused boolean from send_and_test_data to simplify the
> generic part of subtests.
> 
> Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>

For reference, the discussion on the non-integrated version was at
https://lore.kernel.org/all/DDOOS5LR0GZH.ITEM5495FPOX@bootlin.com/.
Seems like a good bit of cleanup :)

Acked-by: Paul Chaignon <paul.chaignon@gmail.com>

> ---
>  tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c b/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c
> index 23b5c522ea9f..1aa7c9463980 100644
> --- a/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c
> +++ b/tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c
> @@ -206,18 +206,13 @@ static void disconnect_client_from_server(struct subtest_cfg *cfg,
>  	free(conn);
>  }
>  
> -static int send_and_test_data(struct subtest_cfg *cfg, bool must_succeed)
> +static int send_and_test_data(struct subtest_cfg *cfg)
>  {
>  	struct connection *conn;
>  	int err, res = -1;
>  
>  	conn = connect_client_to_server(cfg);
> -	if (!must_succeed && !ASSERT_ERR_PTR(conn, "connection that must fail"))
> -		goto end;
> -	else if (!must_succeed)
> -		return 0;
> -
> -	if (!ASSERT_OK_PTR(conn, "connection that must succeed"))
> +	if (!ASSERT_OK_PTR(conn, "connect to server"))
>  		return -1;
>  
>  	err = send(conn->client_fd, tx_buffer, DEFAULT_TEST_DATA_SIZE, 0);
> @@ -391,7 +386,7 @@ static void run_test(struct subtest_cfg *cfg)
>  		goto fail;
>  
>  	/* Basic communication must work */
> -	if (!ASSERT_OK(send_and_test_data(cfg, true), "connect without any encap"))
> +	if (!ASSERT_OK(send_and_test_data(cfg), "connect without any encap"))
>  		goto fail;
>  
>  	/* Attach encapsulation program to client */
> @@ -403,7 +398,7 @@ static void run_test(struct subtest_cfg *cfg)
>  		if (!ASSERT_OK(configure_kernel_decapsulation(cfg),
>  					"configure kernel decapsulation"))
>  			goto fail;
> -		if (!ASSERT_OK(send_and_test_data(cfg, true),
> +		if (!ASSERT_OK(send_and_test_data(cfg),
>  			       "connect with encap prog and kern decap"))
>  			goto fail;
>  	}
> @@ -411,7 +406,7 @@ static void run_test(struct subtest_cfg *cfg)
>  	/* Replace kernel decapsulation with BPF decapsulation, test must pass */
>  	if (!ASSERT_OK(configure_ebpf_decapsulation(cfg), "configure ebpf decapsulation"))
>  		goto fail;
> -	ASSERT_OK(send_and_test_data(cfg, true), "connect with encap and decap progs");
> +	ASSERT_OK(send_and_test_data(cfg), "connect with encap and decap progs");
>  
>  fail:
>  	close_netns(nstoken);
> 
> ---
> base-commit: 9ebb4fa90266705741534924eac62d6f03895fea
> change-id: 20260403-tc_tunnel_cleanup-bf03af4f8c7c
> 
> Best regards,
> --  
> Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
> 
> 

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

* Re: [PATCH bpf-next] selftests/bpf: remove unused toggle in tc_tunnel
  2026-04-03  7:52 [PATCH bpf-next] selftests/bpf: remove unused toggle in tc_tunnel Alexis Lothoré (eBPF Foundation)
  2026-04-03 10:22 ` Paul Chaignon
@ 2026-04-06  1:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-04-06  1:50 UTC (permalink / raw)
  To: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29_=3Calexis=2Elothore=40bo?=,
	=?utf-8?q?otlin=2Ecom=3E?=
  Cc: ast, daniel, andrii, martin.lau, eddyz87, memxor, song,
	yonghong.song, jolsa, shuah, ebpf, bastien.curutchet,
	thomas.petazzoni, bpf, linux-kselftest, linux-kernel

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Fri, 03 Apr 2026 09:52:06 +0200 you wrote:
> tc_tunnel test is based on a send_and_test_data function which takes a
> subtest configuration, and a boolean indicating whether the connection
> is supposed to fail or not. This boolean is systematically passed to
> true, and is a remnant from the first (not integrated) attempts to
> convert tc_tunnel to test_progs: those versions validated for
> example that a connection properly fails when only one side of the
> connection has tunneling enabled. This specific testing has not been
> integrated because it involved large timeouts which increased quite a
> lot the test duration, for little added value.
> 
> [...]

Here is the summary with links:
  - [bpf-next] selftests/bpf: remove unused toggle in tc_tunnel
    https://git.kernel.org/bpf/bpf-next/c/f254fb58dde3

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:[~2026-04-06  1:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03  7:52 [PATCH bpf-next] selftests/bpf: remove unused toggle in tc_tunnel Alexis Lothoré (eBPF Foundation)
2026-04-03 10:22 ` Paul Chaignon
2026-04-06  1:50 ` 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