From: Breno Leitao <leitao@debian.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
shuah@kernel.org, bobbyeshleman@meta.com, sdf@fomichev.me,
razor@blackwall.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next] selftests: drv-net: devmem: set reuseaddr on the sender's source port
Date: Wed, 9 Sep 2026 02:19:17 -0700 [thread overview]
Message-ID: <aqEjHhr-4aXTV1M6@gmail.com> (raw)
In-Reply-To: <20260908183420.1369630-1-kuba@kernel.org>
On Tue, Sep 08, 2026 at 11:34:20AM -0700, Jakub Kicinski wrote:
> devmem.py fails on the HW runners with:
>
> CMD[remote]: dd if=/dev/zero bs=512 count=1 2>/dev/null | socat -b 512 \
> -u - TCP6:[fd00:2::1]:50051,bind=[fd00:2::2]:50051,nodelay
> STDERR: socat[41018] W bind(5, {AF=10 [fd00:2::2]:50051}, 28): \
> Address already in use
>
> ncdevmem installs a 5-tuple flow rule which matches the source port, so
> socat has to bind it explicitly. The port comes from rand_port(), which
> checks availability on the DUT - but we bind on the remote...
> That said the failure rate seems to high to be random collisions
> (~2% per sub-test). It's probably TIME_WAIT sockets on the remote,
> run_rx_hds() alone creates 12 of them.
>
> Set reuseaddr so a TIME_WAIT socket does not fail the bind. Collisions
> with a live socket are still possible, we'll see if they are frequent
> enough to care.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
> --- a/tools/testing/selftests/drivers/net/hw/devmem_lib.py
> +++ b/tools/testing/selftests/drivers/net/hw/devmem_lib.py
> @@ -201,7 +201,7 @@ def ncdevmem_rx(cfg, port, verify=True, fail_on_linear=False, flow_steer=False,
> else:
> addr = cfg.baddr
>
> - suffix = f",bind={cfg.remote_baddr}:{port}"
> + suffix = f",bind={cfg.remote_baddr}:{port},reuseaddr"
socat_listen(), used by run_tx() and run_tx_chunks(), still builds
without reuseaddr. From my reading, I understand we don't need it given
ncdevmem does the active close on those tests. Leaving it alone seems
right.
next prev parent reply other threads:[~2026-09-09 9:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 18:34 [PATCH net-next] selftests: drv-net: devmem: set reuseaddr on the sender's source port Jakub Kicinski
2026-09-09 9:19 ` Breno Leitao [this message]
2026-09-09 18:35 ` netdev-bot+sashiko
2026-09-09 18:40 ` Bobby Eshleman
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=aqEjHhr-4aXTV1M6@gmail.com \
--to=leitao@debian.org \
--cc=andrew+netdev@lunn.ch \
--cc=bobbyeshleman@meta.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
/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