* [PATCH net-next] net/selftests: Add loopback link local route for self-connect
@ 2025-04-02 0:59 Dmitry Safonov via B4 Relay
2025-04-03 22:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Safonov via B4 Relay @ 2025-04-02 0:59 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Shuah Khan
Cc: netdev, linux-kselftest, linux-kernel, Dmitry Safonov
From: Dmitry Safonov <0x7f454c46@gmail.com>
self-connect-ipv6 got slightly flaky on netdev:
> # timeout set to 120
> # selftests: net/tcp_ao: self-connect_ipv6
> # 1..5
> # # 708[lib/setup.c:250] rand seed 1742872572
> # TAP version 13
> # # 708[lib/proc.c:213] Snmp6 Ip6OutNoRoutes: 0 => 1
> # not ok 1 # error 708[self-connect.c:70] failed to connect()
> # ok 2 No unexpected trace events during the test run
> # # Planned tests != run tests (5 != 2)
> # # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:1
> ok 1 selftests: net/tcp_ao: self-connect_ipv6
I can not reproduce it on my machines, but judging by "Ip6OutNoRoutes"
there is no route to the local_addr (::1).
Looking at the kernel code, I see that kernel does add link-local
address automatically in init_loopback(), but that is called from
ipv6 notifier block. So, in turn the userspace that brought up
the loopback interface may see rtnetlink ACK earlier than
addrconf_notify() does it's job (at least, on a slow VM such as netdev).
Probably, for ipv4 it's the same, judging by inetdev_event().
The fix is quite simple: set the link-local route straight after
bringing the loopback interface. That will make it synchronous.
Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
---
Sorry to send this during the merge window, it's a test stability fix.
It seems that netdev build bot has hit the issue a couple of times, but
seems not hitting it constantly at this moment:
https://netdev.bots.linux.dev/flakes.html?br-cnt=150&tn-needle=tcp-ao
I'm marking it net-next, so that build bot carries it until the merge
closes. If it's not fine, I can re-send it after the merge window.
---
tools/testing/selftests/net/tcp_ao/self-connect.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/net/tcp_ao/self-connect.c b/tools/testing/selftests/net/tcp_ao/self-connect.c
index 73b2f2276f3f5410aaa74bede7f366f81761bd6e..2c73bea698a677f9aedd7bec28f6e7fee7845d2e 100644
--- a/tools/testing/selftests/net/tcp_ao/self-connect.c
+++ b/tools/testing/selftests/net/tcp_ao/self-connect.c
@@ -16,6 +16,9 @@ static void __setup_lo_intf(const char *lo_intf,
if (link_set_up(lo_intf))
test_error("Failed to bring %s up", lo_intf);
+
+ if (ip_route_add(lo_intf, TEST_FAMILY, local_addr, local_addr))
+ test_error("Failed to add a local route %s", lo_intf);
}
static void setup_lo_intf(const char *lo_intf)
---
base-commit: 1a9239bb4253f9076b5b4b2a1a4e8d7defd77a95
change-id: 20250402-tcp-ao-selfconnect-flake-e0aabc03c076
Best regards,
--
Dmitry Safonov <0x7f454c46@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net/selftests: Add loopback link local route for self-connect
2025-04-02 0:59 [PATCH net-next] net/selftests: Add loopback link local route for self-connect Dmitry Safonov via B4 Relay
@ 2025-04-03 22:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-04-03 22:20 UTC (permalink / raw)
To: Dmitry Safonov
Cc: davem, edumazet, kuba, pabeni, horms, shuah, netdev,
linux-kselftest, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 02 Apr 2025 01:59:31 +0100 you wrote:
> From: Dmitry Safonov <0x7f454c46@gmail.com>
>
> self-connect-ipv6 got slightly flaky on netdev:
> > # timeout set to 120
> > # selftests: net/tcp_ao: self-connect_ipv6
> > # 1..5
> > # # 708[lib/setup.c:250] rand seed 1742872572
> > # TAP version 13
> > # # 708[lib/proc.c:213] Snmp6 Ip6OutNoRoutes: 0 => 1
> > # not ok 1 # error 708[self-connect.c:70] failed to connect()
> > # ok 2 No unexpected trace events during the test run
> > # # Planned tests != run tests (5 != 2)
> > # # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:1
> > ok 1 selftests: net/tcp_ao: self-connect_ipv6
>
> [...]
Here is the summary with links:
- [net-next] net/selftests: Add loopback link local route for self-connect
https://git.kernel.org/netdev/net/c/e5ddf19dbc3e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-03 22:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-02 0:59 [PATCH net-next] net/selftests: Add loopback link local route for self-connect Dmitry Safonov via B4 Relay
2025-04-03 22:20 ` patchwork-bot+netdevbpf
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®