From: bot+bpf-ci@kernel.org
To: alexis.lothore@bootlin.com,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,jolsa@kernel.org,emil@etsalapatis.com,shuah@kernel.org
Cc: ebpf@linuxfoundation.org,bastien.curutchet@bootlin.com,thomas.petazzoni@bootlin.com,bpf@vger.kernel.org,linux-kselftest@vger.kernel.org,linux-kernel@vger.kernel.org,ihor.solodrai@linux.dev,alexis.lothore@bootlin.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,clm@meta.com,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf v7] selftests/bpf: allocate a larger timeout for connection
Date: Tue, 18 Aug 2026 19:23:04 +0000 (UTC) [thread overview]
Message-ID: <60472e2d261b280c49f896716cf5c50d1188c4dc33cf86a5a7139b91078c4e54@mail.kernel.org> (raw)
In-Reply-To: <20260818-tc_tunnel_flaky-v7-1-aec161e74ef2@bootlin.com>
[-- Attachment #1: Type: text/plain, Size: 2567 bytes --]
> diff --git a/tools/testing/selftests/bpf/network_helpers.c b/tools/testing/selftests/bpf/network_helpers.c
> index b82f572641b7..380b776f182d 100644
> --- a/tools/testing/selftests/bpf/network_helpers.c
> +++ b/tools/testing/selftests/bpf/network_helpers.c
> @@ -49,6 +49,8 @@
> errno = __save; \
> })
>
> +#define CONNECT_MIN_TIMEOUT_MS 5000
[ ... ]
> @@ -291,6 +293,37 @@ int client_socket(int family, int type,
> return -1;
> }
>
> +static int connect_with_timeout(int fd, const struct sockaddr_storage *addr,
> + socklen_t addrlen, int timeout_ms)
> +{
> + int connect_timeout_ms = MAX(timeout_ms, CONNECT_MIN_TIMEOUT_MS);
> +
> + /*
> + * Override timeout configuration with a larger value for the
> + * connection
> + */
> + if (settimeo(fd, connect_timeout_ms)) {
> + log_err("Failed to set connect timeout");
> + return -1;
> + }
> +
> + if (connect(fd, (const struct sockaddr *)addr, addrlen)) {
> + log_err("Failed to connect");
> + return -1;
> + }
Does the 5-second floor apply to callers that deliberately set a small
timeout because they expect the connect to fail?
Looking at cgroup_skb_sk_lookup.c, the test expects a connection to time
out after 1 second:
/* Client outside of test cgroup should fail to connect by timeout. */
err = connect_fd_to_fd(out_sk, serv_sk, 1000);
if (CHECK(!err || errno != EINPROGRESS, "connect_fd_to_fd", ...))
The call chain is:
test_cgroup_skb_sk_lookup()
-> run_cgroup_bpf_test()
-> run_lookup_test()
-> connect_fd_to_fd(out_sk, serv_sk, 1000)
-> connect_with_timeout(..., 1000)
With MAX(1000, 5000) returning 5000, settimeo(fd, 5000) is installed,
and the deliberately-dropped connect() now blocks for 5 seconds instead
of 1 second.
The test still passes because the cgroup_skb program drops the SYNs
permanently, so at 5 seconds the socket is still in SYN_SENT and
connect() returns EINPROGRESS. But the test now waits 5 times longer than
intended.
The commit message mentions that some tests expect data transfer to fail
and that increasing timeout would increase execution duration, which is
what happens here for connects expected to time out.
Would it make sense to honour the caller's timeout_ms when explicitly set,
and only apply the 5-second floor when timeout_ms is 0 or use a default?
[ ... ]
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/32172718494
next prev parent reply other threads:[~2026-08-18 19:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 18:43 Alexis Lothoré (eBPF Foundation)
2026-08-18 19:23 ` bot+bpf-ci [this message]
2026-08-21 19:20 ` patchwork-bot+netdevbpf
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=60472e2d261b280c49f896716cf5c50d1188c4dc33cf86a5a7139b91078c4e54@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=alexis.lothore@bootlin.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bastien.curutchet@bootlin.com \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=ebpf@linuxfoundation.org \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=yonghong.song@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®