From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: <bot+bpf-ci@kernel.org>, <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>, <martin.lau@kernel.org>,
<clm@meta.com>
Subject: Re: [PATCH bpf v6] selftests/bpf: allocate a larger timeout for connection
Date: Tue, 18 Aug 2026 14:49:30 +0200 [thread overview]
Message-ID: <DKS2YUE3JPJO.1QKR47OVLV5UW@bootlin.com> (raw)
In-Reply-To: <c7945c532eb31abc4d3fbbd0720d7a1f47eff936621cf8d11ecdfd9aeef27f93@mail.kernel.org>
On Mon Aug 17, 2026 at 10:14 PM CEST, bot+bpf-ci wrote:
>> diff --git a/tools/testing/selftests/bpf/network_helpers.c b/tools/testing/selftests/bpf/network_helpers.c
>> index b82f572641b7..1fda1fa7281c 100644
>> --- a/tools/testing/selftests/bpf/network_helpers.c
>> +++ b/tools/testing/selftests/bpf/network_helpers.c
[...]
>> +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;
>> + }
>> +
>> + /*
>> + * If the timeout configured by the test is different from the
>> + * connect timeout, restore it
>> + */
>
> This isn't a bug, but do the two block comments here add anything over
> the code they sit above? The first sits above settimeo(fd,
> connect_timeout_ms) where connect_timeout_ms was computed with MAX(...,
> CONNECT_MIN_TIMEOUT_MS) on the line before. The second transliterates
> the condition on the line below (timeout_ms != connect_timeout_ms means
> "restore it"). Could they be trimmed to a single line about why a larger
> connect budget is needed?
This is slowly turning into bikeshedding (and if the comment wasn't
there, another LLM run could possibly request it to clarify the
intent...) so I'll keep it as-is.
[...]
>> - if (connect(client_fd, (const struct sockaddr *)&addr, len)) {
>> - log_err("Failed to connect to server");
>> - return -1;
>> - }
>> -
>> - return 0;
>> + return connect_with_timeout(client_fd,
>> + &addr, len,
>> + timeout_ms);
> ^^^^
>
> This isn't a bug, but could this call fit on one line? With the leading
> tab it comes to about 71 columns as a single statement, well inside the
> 80-column limit. Elsewhere the file only wraps arguments when the line
> doesn't fit.
True. Will be fixed.
Alexis
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
prev parent reply other threads:[~2026-08-18 12:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 19:04 Alexis Lothoré (eBPF Foundation)
2026-08-17 20:14 ` bot+bpf-ci
2026-08-18 12:49 ` Alexis Lothoré [this message]
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=DKS2YUE3JPJO.1QKR47OVLV5UW@bootlin.com \
--to=alexis.lothore@bootlin.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bastien.curutchet@bootlin.com \
--cc=bot+bpf-ci@kernel.org \
--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®