Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/bpf: remove unused toggle in tc_tunnel

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>
Acked-by: Paul Chaignon <paul.chaignon@gmail.com>
Link: https://lore.kernel.org/r/20260403-tc_tunnel_cleanup-v1-1-4f1bb113d3ab@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Alexis Lothoré (eBPF Foundation) and committed by
Alexei Starovoitov
f254fb58 c6095cb9

+5 -10
+5 -10
tools/testing/selftests/bpf/prog_tests/test_tc_tunnel.c
··· 206 206 free(conn); 207 207 } 208 208 209 - static int send_and_test_data(struct subtest_cfg *cfg, bool must_succeed) 209 + static int send_and_test_data(struct subtest_cfg *cfg) 210 210 { 211 211 struct connection *conn; 212 212 int err, res = -1; 213 213 214 214 conn = connect_client_to_server(cfg); 215 - if (!must_succeed && !ASSERT_ERR_PTR(conn, "connection that must fail")) 216 - goto end; 217 - else if (!must_succeed) 218 - return 0; 219 - 220 - if (!ASSERT_OK_PTR(conn, "connection that must succeed")) 215 + if (!ASSERT_OK_PTR(conn, "connect to server")) 221 216 return -1; 222 217 223 218 err = send(conn->client_fd, tx_buffer, DEFAULT_TEST_DATA_SIZE, 0); ··· 386 391 goto fail; 387 392 388 393 /* Basic communication must work */ 389 - if (!ASSERT_OK(send_and_test_data(cfg, true), "connect without any encap")) 394 + if (!ASSERT_OK(send_and_test_data(cfg), "connect without any encap")) 390 395 goto fail; 391 396 392 397 /* Attach encapsulation program to client */ ··· 398 403 if (!ASSERT_OK(configure_kernel_decapsulation(cfg), 399 404 "configure kernel decapsulation")) 400 405 goto fail; 401 - if (!ASSERT_OK(send_and_test_data(cfg, true), 406 + if (!ASSERT_OK(send_and_test_data(cfg), 402 407 "connect with encap prog and kern decap")) 403 408 goto fail; 404 409 } ··· 406 411 /* Replace kernel decapsulation with BPF decapsulation, test must pass */ 407 412 if (!ASSERT_OK(configure_ebpf_decapsulation(cfg), "configure ebpf decapsulation")) 408 413 goto fail; 409 - ASSERT_OK(send_and_test_data(cfg, true), "connect with encap and decap progs"); 414 + ASSERT_OK(send_and_test_data(cfg), "connect with encap and decap progs"); 410 415 411 416 fail: 412 417 close_netns(nstoken);