diff mbox series

[bpf] selftests/bpf: remove sockmap_ktls disconnect_after_delete test

Message ID 20250415163332.1836826-1-ihor.solodrai@linux.dev (mailing list archive)
State New
Delegated to: BPF
Headers show
Series [bpf] selftests/bpf: remove sockmap_ktls disconnect_after_delete test | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for bpf
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success Errors and warnings before: 26 (+2) this patch: 26 (+2)
netdev/cc_maintainers warning 10 maintainers not CCed: yonghong.song@linux.dev linux-kselftest@vger.kernel.org john.fastabend@gmail.com song@kernel.org sdf@fomichev.me martin.lau@linux.dev haoluo@google.com jolsa@kernel.org kpsingh@kernel.org shuah@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 80 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-VM_Test-0 success Logs for Lint
bpf/vmtest-bpf-VM_Test-2 success Logs for Unittests
bpf/vmtest-bpf-VM_Test-3 success Logs for Validate matrix.py
bpf/vmtest-bpf-VM_Test-5 success Logs for aarch64-gcc / build / build for aarch64 with gcc
bpf/vmtest-bpf-VM_Test-4 success Logs for aarch64-gcc / GCC BPF
bpf/vmtest-bpf-VM_Test-6 success Logs for aarch64-gcc / build-release
bpf/vmtest-bpf-VM_Test-11 success Logs for aarch64-gcc / veristat-kernel
bpf/vmtest-bpf-VM_Test-13 success Logs for s390x-gcc / GCC BPF
bpf/vmtest-bpf-VM_Test-12 success Logs for aarch64-gcc / veristat-meta
bpf/vmtest-bpf-VM_Test-14 success Logs for s390x-gcc / build / build for s390x with gcc
bpf/vmtest-bpf-VM_Test-15 success Logs for s390x-gcc / build-release
bpf/vmtest-bpf-VM_Test-19 success Logs for s390x-gcc / veristat-kernel
bpf/vmtest-bpf-VM_Test-20 success Logs for s390x-gcc / veristat-meta
bpf/vmtest-bpf-VM_Test-24 success Logs for x86_64-gcc / build-release
bpf/vmtest-bpf-VM_Test-21 success Logs for set-matrix
bpf/vmtest-bpf-VM_Test-23 success Logs for x86_64-gcc / build / build for x86_64 with gcc
bpf/vmtest-bpf-VM_Test-35 success Logs for x86_64-llvm-17 / build-release / build for x86_64 with llvm-17-O2
bpf/vmtest-bpf-VM_Test-34 success Logs for x86_64-llvm-17 / build / build for x86_64 with llvm-17
bpf/vmtest-bpf-VM_Test-40 success Logs for x86_64-llvm-17 / veristat-kernel
bpf/vmtest-bpf-VM_Test-41 success Logs for x86_64-llvm-17 / veristat-meta
bpf/vmtest-bpf-VM_Test-43 success Logs for x86_64-llvm-18 / build / build for x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-50 success Logs for x86_64-llvm-18 / veristat-kernel
bpf/vmtest-bpf-VM_Test-51 success Logs for x86_64-llvm-18 / veristat-meta
bpf/vmtest-bpf-VM_Test-44 success Logs for x86_64-llvm-18 / build-release / build for x86_64 with llvm-18-O2
bpf/vmtest-bpf-VM_Test-33 success Logs for x86_64-llvm-17 / GCC BPF / GCC BPF
bpf/vmtest-bpf-VM_Test-42 success Logs for x86_64-llvm-18 / GCC BPF / GCC BPF
bpf/vmtest-bpf-VM_Test-22 success Logs for x86_64-gcc / GCC BPF / GCC BPF
bpf/vmtest-bpf-VM_Test-32 success Logs for x86_64-gcc / veristat-meta / x86_64-gcc veristat_meta
bpf/vmtest-bpf-VM_Test-18 success Logs for s390x-gcc / test (test_verifier, false, 360) / test_verifier on s390x with gcc
bpf/vmtest-bpf-VM_Test-25 success Logs for x86_64-gcc / test (test_maps, false, 360) / test_maps on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-31 success Logs for x86_64-gcc / veristat-kernel / x86_64-gcc veristat_kernel
bpf/vmtest-bpf-VM_Test-8 success Logs for aarch64-gcc / test (test_progs, false, 360) / test_progs on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-7 success Logs for aarch64-gcc / test (test_maps, false, 360) / test_maps on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-10 success Logs for aarch64-gcc / test (test_verifier, false, 360) / test_verifier on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-26 success Logs for x86_64-gcc / test (test_progs, false, 360) / test_progs on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-27 success Logs for x86_64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-28 success Logs for x86_64-gcc / test (test_progs_no_alu32_parallel, true, 30) / test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-29 success Logs for x86_64-gcc / test (test_progs_parallel, true, 30) / test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-30 success Logs for x86_64-gcc / test (test_verifier, false, 360) / test_verifier on x86_64 with gcc
bpf/vmtest-bpf-VM_Test-36 success Logs for x86_64-llvm-17 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-17
bpf/vmtest-bpf-VM_Test-39 success Logs for x86_64-llvm-17 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-17
bpf/vmtest-bpf-VM_Test-46 success Logs for x86_64-llvm-18 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-45 success Logs for x86_64-llvm-18 / test (test_maps, false, 360) / test_maps on x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-48 success Logs for x86_64-llvm-18 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-47 success Logs for x86_64-llvm-18 / test (test_progs_cpuv4, false, 360) / test_progs_cpuv4 on x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-49 success Logs for x86_64-llvm-18 / test (test_verifier, false, 360) / test_verifier on x86_64 with llvm-18
bpf/vmtest-bpf-VM_Test-9 success Logs for aarch64-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-VM_Test-38 success Logs for x86_64-llvm-17 / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on x86_64 with llvm-17
bpf/vmtest-bpf-VM_Test-37 success Logs for x86_64-llvm-17 / test (test_progs, false, 360) / test_progs on x86_64 with llvm-17
bpf/vmtest-bpf-VM_Test-16 success Logs for s390x-gcc / test (test_progs, false, 360) / test_progs on s390x with gcc
bpf/vmtest-bpf-VM_Test-17 success Logs for s390x-gcc / test (test_progs_no_alu32, false, 360) / test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-PR fail merge-conflict

Commit Message

Ihor Solodrai April 15, 2025, 4:33 p.m. UTC
"sockmap_ktls disconnect_after_delete" test has been failing on BPF CI
after recent merges from netdev:
* https://github.com/kernel-patches/bpf/actions/runs/14458537639
* https://github.com/kernel-patches/bpf/actions/runs/14457178732

It happens because disconnect has been disabled for TLS [1], and it
renders the test case invalid. Remove it from the suite.

[1] https://lore.kernel.org/netdev/20250404180334.3224206-1-kuba@kernel.org/

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
---
 .../selftests/bpf/prog_tests/sockmap_ktls.c   | 68 -------------------
 1 file changed, 68 deletions(-)

Comments

Jiayuan Chen April 15, 2025, 4:53 p.m. UTC | #1
April 16, 2025 at 24:33, "Ihor Solodrai" <ihor.solodrai@linux.dev> wrote:
> 
> "sockmap_ktls disconnect_after_delete" test has been failing on BPF CI
> after recent merges from netdev:
> * https://github.com/kernel-patches/bpf/actions/runs/14458537639
> * https://github.com/kernel-patches/bpf/actions/runs/14457178732
> It happens because disconnect has been disabled for TLS [1], and it
> renders the test case invalid. Remove it from the suite.
> [1] https://lore.kernel.org/netdev/20250404180334.3224206-1-kuba@kernel.org/
> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>

Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>

The original selftest patch used disconnect to re-produce the endless
loop caused by tcp_bpf_unhash, which has already been removed.

I hope this doesn't conflict with bpf-next...

Thanks.
Ihor Solodrai April 15, 2025, 5 p.m. UTC | #2
On 4/15/25 9:53 AM, Jiayuan Chen wrote:
> April 16, 2025 at 24:33, "Ihor Solodrai" <ihor.solodrai@linux.dev> wrote:
>>
>> "sockmap_ktls disconnect_after_delete" test has been failing on BPF CI
>> after recent merges from netdev:
>> * https://github.com/kernel-patches/bpf/actions/runs/14458537639
>> * https://github.com/kernel-patches/bpf/actions/runs/14457178732
>> It happens because disconnect has been disabled for TLS [1], and it
>> renders the test case invalid. Remove it from the suite.
>> [1] https://lore.kernel.org/netdev/20250404180334.3224206-1-kuba@kernel.org/
>> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
>
> Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
>
> The original selftest patch used disconnect to re-produce the endless
> loop caused by tcp_bpf_unhash, which has already been removed.
>
> I hope this doesn't conflict with bpf-next...

I just tried applying to bpf-next, and it does indeed have a
conflict... Although kdiff3 merged it automatically.

What's the right way to resolve this? Send for bpf-next?


>From 21ecc409c7e78e52cbb27296b039c13860ace7fa Mon Sep 17 00:00:00 2001
From: Ihor Solodrai <ihor.solodrai@linux.dev>
Date: Tue, 15 Apr 2025 09:22:50 -0700
Subject: [PATCH] selftests/bpf: remove sockmap_ktls disconnect_after_delete
 test

"sockmap_ktls disconnect_after_delete" test has been failing on BPF CI
after recent merges from netdev:
* https://github.com/kernel-patches/bpf/actions/runs/14458537639
* https://github.com/kernel-patches/bpf/actions/runs/14457178732

It happens because disconnect has been disabled for TLS [1], and it
renders the test case invalid. Remove it from the suite.

[1] https://lore.kernel.org/netdev/20250404180334.3224206-1-kuba@kernel.org/

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
---
 .../selftests/bpf/prog_tests/sockmap_ktls.c   | 68 -------------------
 1 file changed, 68 deletions(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c b/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c
index 49b85c1c7552..3044f54b16d6 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c
@@ -61,72 +61,6 @@ static int create_ktls_pairs(int family, int sotype, int *c, int *p)
 	return 0;
 }
 
-static int tcp_server(int family)
-{
-	int err, s;
-
-	s = socket(family, SOCK_STREAM, 0);
-	if (!ASSERT_GE(s, 0, "socket"))
-		return -1;
-
-	err = listen(s, SOMAXCONN);
-	if (!ASSERT_OK(err, "listen"))
-		return -1;
-
-	return s;
-}
-
-static int disconnect(int fd)
-{
-	struct sockaddr unspec = { AF_UNSPEC };
-
-	return connect(fd, &unspec, sizeof(unspec));
-}
-
-/* Disconnect (unhash) a kTLS socket after removing it from sockmap. */
-static void test_sockmap_ktls_disconnect_after_delete(int family, int map)
-{
-	struct sockaddr_storage addr = {0};
-	socklen_t len = sizeof(addr);
-	int err, cli, srv, zero = 0;
-
-	srv = tcp_server(family);
-	if (srv == -1)
-		return;
-
-	err = getsockname(srv, (struct sockaddr *)&addr, &len);
-	if (!ASSERT_OK(err, "getsockopt"))
-		goto close_srv;
-
-	cli = socket(family, SOCK_STREAM, 0);
-	if (!ASSERT_GE(cli, 0, "socket"))
-		goto close_srv;
-
-	err = connect(cli, (struct sockaddr *)&addr, len);
-	if (!ASSERT_OK(err, "connect"))
-		goto close_cli;
-
-	err = bpf_map_update_elem(map, &zero, &cli, 0);
-	if (!ASSERT_OK(err, "bpf_map_update_elem"))
-		goto close_cli;
-
-	err = setsockopt(cli, IPPROTO_TCP, TCP_ULP, "tls", strlen("tls"));
-	if (!ASSERT_OK(err, "setsockopt(TCP_ULP)"))
-		goto close_cli;
-
-	err = bpf_map_delete_elem(map, &zero);
-	if (!ASSERT_OK(err, "bpf_map_delete_elem"))
-		goto close_cli;
-
-	err = disconnect(cli);
-	ASSERT_OK(err, "disconnect");
-
-close_cli:
-	close(cli);
-close_srv:
-	close(srv);
-}
-
 static void test_sockmap_ktls_update_fails_when_sock_has_ulp(int family, int map)
 {
 	struct sockaddr_storage addr = {};
@@ -314,8 +248,6 @@ static void run_tests(int family, enum bpf_map_type map_type)
 	if (!ASSERT_GE(map, 0, "bpf_map_create"))
 		return;
 
-	if (test__start_subtest(fmt_test_name("disconnect_after_delete", family, map_type)))
-		test_sockmap_ktls_disconnect_after_delete(family, map);
 	if (test__start_subtest(fmt_test_name("update_fails_when_sock_has_ulp", family, map_type)))
 		test_sockmap_ktls_update_fails_when_sock_has_ulp(family, map);
Alexei Starovoitov April 15, 2025, 5:05 p.m. UTC | #3
On Tue, Apr 15, 2025 at 10:01 AM Ihor Solodrai <ihor.solodrai@linux.dev> wrote:
>
> On 4/15/25 9:53 AM, Jiayuan Chen wrote:
> > April 16, 2025 at 24:33, "Ihor Solodrai" <ihor.solodrai@linux.dev> wrote:
> >>
> >> "sockmap_ktls disconnect_after_delete" test has been failing on BPF CI
> >> after recent merges from netdev:
> >> * https://github.com/kernel-patches/bpf/actions/runs/14458537639
> >> * https://github.com/kernel-patches/bpf/actions/runs/14457178732
> >> It happens because disconnect has been disabled for TLS [1], and it
> >> renders the test case invalid. Remove it from the suite.
> >> [1] https://lore.kernel.org/netdev/20250404180334.3224206-1-kuba@kernel.org/
> >> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
> >
> > Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
> >
> > The original selftest patch used disconnect to re-produce the endless
> > loop caused by tcp_bpf_unhash, which has already been removed.
> >
> > I hope this doesn't conflict with bpf-next...
>
> I just tried applying to bpf-next, and it does indeed have a
> conflict... Although kdiff3 merged it automatically.
>
> What's the right way to resolve this? Send for bpf-next?

What commit in bpf-next does it conflict with ?

In general, avoiding merge conflicts is preferred.
Ihor Solodrai April 15, 2025, 5:37 p.m. UTC | #4
On 4/15/25 10:05 AM, Alexei Starovoitov wrote:
> On Tue, Apr 15, 2025 at 10:01 AM Ihor Solodrai <ihor.solodrai@linux.dev> wrote:
>>
>> On 4/15/25 9:53 AM, Jiayuan Chen wrote:
>>> April 16, 2025 at 24:33, "Ihor Solodrai" <ihor.solodrai@linux.dev> wrote:
>>>>
>>>> "sockmap_ktls disconnect_after_delete" test has been failing on BPF CI
>>>> after recent merges from netdev:
>>>> * https://github.com/kernel-patches/bpf/actions/runs/14458537639
>>>> * https://github.com/kernel-patches/bpf/actions/runs/14457178732
>>>> It happens because disconnect has been disabled for TLS [1], and it
>>>> renders the test case invalid. Remove it from the suite.
>>>> [1] https://lore.kernel.org/netdev/20250404180334.3224206-1-kuba@kernel.org/
>>>> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
>>>
>>> Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
>>>
>>> The original selftest patch used disconnect to re-produce the endless
>>> loop caused by tcp_bpf_unhash, which has already been removed.
>>>
>>> I hope this doesn't conflict with bpf-next...
>>
>> I just tried applying to bpf-next, and it does indeed have a
>> conflict... Although kdiff3 merged it automatically.
>>
>> What's the right way to resolve this? Send for bpf-next?
>
> What commit in bpf-next does it conflict with ?
>
> In general, avoiding merge conflicts is preferred.

https://web.git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=05ebde1bcb50a71cd56d8edd3008f53a781146e9
https://lore.kernel.org/bpf/20250219052015.274405-1-jiayuan.chen@linux.dev/

It adds tests in the same file. The code to delete simply moved.

I think we can avoid conflict by applying 05ebde1bcb50 to bpf first,
if that's an option (it might depend on other changes, idk).
Then the version of the patch for bpf-next would apply to both trees.

If not, then apply only to bpf-next, and disable the test on CI?
Jiayuan Chen April 16, 2025, 1:10 a.m. UTC | #5
April 16, 2025 at 01:37, "Ihor Solodrai" <ihor.solodrai@linux.dev> wrote:



> 
> On 4/15/25 10:05 AM, Alexei Starovoitov wrote:
> 
> > 
> > On Tue, Apr 15, 2025 at 10:01 AM Ihor Solodrai <ihor.solodrai@linux.dev> wrote:
> > 
> > > 
> > > On 4/15/25 9:53 AM, Jiayuan Chen wrote:
> > > 
> > 
> >  April 16, 2025 at 24:33, "Ihor Solodrai" <ihor.solodrai@linux.dev> wrote:
> > 
> >  "sockmap_ktls disconnect_after_delete" test has been failing on BPF CI
> > 
> >  after recent merges from netdev:
> > 
> >  * https://github.com/kernel-patches/bpf/actions/runs/14458537639
> > 
> >  * https://github.com/kernel-patches/bpf/actions/runs/14457178732
> > 
> >  It happens because disconnect has been disabled for TLS [1], and it
> > 
> >  renders the test case invalid. Remove it from the suite.
> > 
> >  [1] https://lore.kernel.org/netdev/20250404180334.3224206-1-kuba@kernel.org/
> > 
> >  Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
> > 
> >  Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
> > 
> >  The original selftest patch used disconnect to re-produce the endless
> >  loop caused by tcp_bpf_unhash, which has already been removed.
> >  I hope this doesn't conflict with bpf-next...
> > 
> > > 
> > > I just tried applying to bpf-next, and it does indeed have a
> > >  conflict... Although kdiff3 merged it automatically.
> > >  What's the right way to resolve this? Send for bpf-next?
> > > 
> >  What commit in bpf-next does it conflict with ?
> >  In general, avoiding merge conflicts is preferred.
> > 
> https://web.git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=05ebde1bcb50a71cd56d8edd3008f53a781146e9
> https://lore.kernel.org/bpf/20250219052015.274405-1-jiayuan.chen@linux.dev/
> It adds tests in the same file. The code to delete simply moved.
> I think we can avoid conflict by applying 05ebde1bcb50 to bpf first,
> if that's an option (it might depend on other changes, idk).
> Then the version of the patch for bpf-next would apply to both trees.
> If not, then apply only to bpf-next, and disable the test on CI?
>


I'm not sure whether we can cherry-pick the commit to bpf branch.

I believe it would be more convenient for the maintainer to merge the
patch that only removes 'ASSERT_OK(err, "disconnect");', as this change
will not introduce conflicts with the bpf-next branch.
Once the bpf branch is merged into bpf-next, you can then remove the
entire function in the bpf-next branch.
Alexei Starovoitov April 16, 2025, 1:43 a.m. UTC | #6
On Tue, Apr 15, 2025 at 6:10 PM Jiayuan Chen <jiayuan.chen@linux.dev> wrote:
>
> April 16, 2025 at 01:37, "Ihor Solodrai" <ihor.solodrai@linux.dev> wrote:
>
>
>
> >
> > On 4/15/25 10:05 AM, Alexei Starovoitov wrote:
> >
> > >
> > > On Tue, Apr 15, 2025 at 10:01 AM Ihor Solodrai <ihor.solodrai@linux.dev> wrote:
> > >
> > > >
> > > > On 4/15/25 9:53 AM, Jiayuan Chen wrote:
> > > >
> > >
> > >  April 16, 2025 at 24:33, "Ihor Solodrai" <ihor.solodrai@linux.dev> wrote:
> > >
> > >  "sockmap_ktls disconnect_after_delete" test has been failing on BPF CI
> > >
> > >  after recent merges from netdev:
> > >
> > >  * https://github.com/kernel-patches/bpf/actions/runs/14458537639
> > >
> > >  * https://github.com/kernel-patches/bpf/actions/runs/14457178732
> > >
> > >  It happens because disconnect has been disabled for TLS [1], and it
> > >
> > >  renders the test case invalid. Remove it from the suite.
> > >
> > >  [1] https://lore.kernel.org/netdev/20250404180334.3224206-1-kuba@kernel.org/
> > >
> > >  Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
> > >
> > >  Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
> > >
> > >  The original selftest patch used disconnect to re-produce the endless
> > >  loop caused by tcp_bpf_unhash, which has already been removed.
> > >  I hope this doesn't conflict with bpf-next...
> > >
> > > >
> > > > I just tried applying to bpf-next, and it does indeed have a
> > > >  conflict... Although kdiff3 merged it automatically.
> > > >  What's the right way to resolve this? Send for bpf-next?
> > > >
> > >  What commit in bpf-next does it conflict with ?
> > >  In general, avoiding merge conflicts is preferred.
> > >
> > https://web.git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=05ebde1bcb50a71cd56d8edd3008f53a781146e9
> > https://lore.kernel.org/bpf/20250219052015.274405-1-jiayuan.chen@linux.dev/
> > It adds tests in the same file. The code to delete simply moved.
> > I think we can avoid conflict by applying 05ebde1bcb50 to bpf first,
> > if that's an option (it might depend on other changes, idk).
> > Then the version of the patch for bpf-next would apply to both trees.
> > If not, then apply only to bpf-next, and disable the test on CI?
> >
>
>
> I'm not sure whether we can cherry-pick the commit to bpf branch.
>
> I believe it would be more convenient for the maintainer to merge the
> patch that only removes 'ASSERT_OK(err, "disconnect");', as this change
> will not introduce conflicts with the bpf-next branch.
> Once the bpf branch is merged into bpf-next, you can then remove the
> entire function in the bpf-next branch.

Let's do that. Pls prepare such single-liner against bpf tree.
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c b/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c
index 2d0796314862..47c0701e0938 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c
@@ -10,72 +10,6 @@ 
 #define MAX_TEST_NAME 80
 #define TCP_ULP 31
 
-static int tcp_server(int family)
-{
-	int err, s;
-
-	s = socket(family, SOCK_STREAM, 0);
-	if (!ASSERT_GE(s, 0, "socket"))
-		return -1;
-
-	err = listen(s, SOMAXCONN);
-	if (!ASSERT_OK(err, "listen"))
-		return -1;
-
-	return s;
-}
-
-static int disconnect(int fd)
-{
-	struct sockaddr unspec = { AF_UNSPEC };
-
-	return connect(fd, &unspec, sizeof(unspec));
-}
-
-/* Disconnect (unhash) a kTLS socket after removing it from sockmap. */
-static void test_sockmap_ktls_disconnect_after_delete(int family, int map)
-{
-	struct sockaddr_storage addr = {0};
-	socklen_t len = sizeof(addr);
-	int err, cli, srv, zero = 0;
-
-	srv = tcp_server(family);
-	if (srv == -1)
-		return;
-
-	err = getsockname(srv, (struct sockaddr *)&addr, &len);
-	if (!ASSERT_OK(err, "getsockopt"))
-		goto close_srv;
-
-	cli = socket(family, SOCK_STREAM, 0);
-	if (!ASSERT_GE(cli, 0, "socket"))
-		goto close_srv;
-
-	err = connect(cli, (struct sockaddr *)&addr, len);
-	if (!ASSERT_OK(err, "connect"))
-		goto close_cli;
-
-	err = bpf_map_update_elem(map, &zero, &cli, 0);
-	if (!ASSERT_OK(err, "bpf_map_update_elem"))
-		goto close_cli;
-
-	err = setsockopt(cli, IPPROTO_TCP, TCP_ULP, "tls", strlen("tls"));
-	if (!ASSERT_OK(err, "setsockopt(TCP_ULP)"))
-		goto close_cli;
-
-	err = bpf_map_delete_elem(map, &zero);
-	if (!ASSERT_OK(err, "bpf_map_delete_elem"))
-		goto close_cli;
-
-	err = disconnect(cli);
-	ASSERT_OK(err, "disconnect");
-
-close_cli:
-	close(cli);
-close_srv:
-	close(srv);
-}
-
 static void test_sockmap_ktls_update_fails_when_sock_has_ulp(int family, int map)
 {
 	struct sockaddr_storage addr = {};
@@ -154,8 +88,6 @@  static void run_tests(int family, enum bpf_map_type map_type)
 	if (!ASSERT_GE(map, 0, "bpf_map_create"))
 		return;
 
-	if (test__start_subtest(fmt_test_name("disconnect_after_delete", family, map_type)))
-		test_sockmap_ktls_disconnect_after_delete(family, map);
 	if (test__start_subtest(fmt_test_name("update_fails_when_sock_has_ulp", family, map_type)))
 		test_sockmap_ktls_update_fails_when_sock_has_ulp(family, map);