From: "Ihor Solodrai" <ihor.solodrai@linux.dev>
To: "Jiayuan Chen" <jiayuan.chen@linux.dev>,
ast@kernel.org, andrii@kernel.org, daniel@iogearbox.net,
eddyz87@gmail.com
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, kuba@kernel.org,
pabeni@redhat.com, mykolal@fb.com, kernel-team@meta.com
Subject: Re: [PATCH bpf] selftests/bpf: remove sockmap_ktls disconnect_after_delete test
Date: Tue, 15 Apr 2025 17:00:54 +0000 [thread overview]
Message-ID: <02aa843af95ad3413fb37f898007cb17723dd1aa@linux.dev> (raw)
In-Reply-To: <3cb523bc8eb334cb420508a84f3f1d37543f4253@linux.dev>
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);
--
2.49.0
>
> Thanks.
next prev parent reply other threads:[~2025-04-15 17:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 16:33 [PATCH bpf] selftests/bpf: remove sockmap_ktls disconnect_after_delete test Ihor Solodrai
2025-04-15 16:53 ` Jiayuan Chen
2025-04-15 17:00 ` Ihor Solodrai [this message]
2025-04-15 17:05 ` Alexei Starovoitov
2025-04-15 17:37 ` Ihor Solodrai
2025-04-16 1:10 ` Jiayuan Chen
2025-04-16 1:43 ` Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=02aa843af95ad3413fb37f898007cb17723dd1aa@linux.dev \
--to=ihor.solodrai@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=jiayuan.chen@linux.dev \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=mykolal@fb.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.