* [PATCH bpf-next] tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind
@ 2024-12-02 20:45 Marco Leogrande
2024-12-03 0:15 ` Stanislav Fomichev
2024-12-04 17:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 5+ messages in thread
From: Marco Leogrande @ 2024-12-02 20:45 UTC (permalink / raw)
To: Andrii Nakryiko, Eduard Zingerman, Mykola Lysenko,
Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Shuah Khan, Alessandro Carminati (Red Hat)
Cc: willemb, zhuyifei, bpf, linux-kselftest, linux-kernel,
Marco Leogrande
Commit f803bcf9208a ("selftests/bpf: Prevent client connect before
server bind in test_tc_tunnel.sh") added code that waits for the
netcat server to start before the netcat client attempts to connect to
it. However, not all calls to 'server_listen' were guarded.
This patch adds the existing 'wait_for_port' guard after the remaining
call to 'server_listen'.
Fixes: f803bcf9208a ("selftests/bpf: Prevent client connect before server bind in test_tc_tunnel.sh")
Signed-off-by: Marco Leogrande <leogrande@google.com>
---
tools/testing/selftests/bpf/test_tc_tunnel.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/bpf/test_tc_tunnel.sh b/tools/testing/selftests/bpf/test_tc_tunnel.sh
index 7989ec6084545..cb55a908bb0d7 100755
--- a/tools/testing/selftests/bpf/test_tc_tunnel.sh
+++ b/tools/testing/selftests/bpf/test_tc_tunnel.sh
@@ -305,6 +305,7 @@ else
client_connect
verify_data
server_listen
+ wait_for_port ${port} ${netcat_opt}
fi
# serverside, use BPF for decap
--
2.47.0.338.g60cca15819-goog
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH bpf-next] tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind
2024-12-02 20:45 [PATCH bpf-next] tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind Marco Leogrande
@ 2024-12-03 0:15 ` Stanislav Fomichev
2024-12-03 17:23 ` Marco Leogrande
2024-12-04 17:10 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 5+ messages in thread
From: Stanislav Fomichev @ 2024-12-03 0:15 UTC (permalink / raw)
To: Marco Leogrande
Cc: Andrii Nakryiko, Eduard Zingerman, Mykola Lysenko,
Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Shuah Khan, Alessandro Carminati (Red Hat),
willemb, zhuyifei, bpf, linux-kselftest, linux-kernel
On 12/02, Marco Leogrande wrote:
> Commit f803bcf9208a ("selftests/bpf: Prevent client connect before
> server bind in test_tc_tunnel.sh") added code that waits for the
> netcat server to start before the netcat client attempts to connect to
> it. However, not all calls to 'server_listen' were guarded.
>
> This patch adds the existing 'wait_for_port' guard after the remaining
> call to 'server_listen'.
>
> Fixes: f803bcf9208a ("selftests/bpf: Prevent client connect before server bind in test_tc_tunnel.sh")
> Signed-off-by: Marco Leogrande <leogrande@google.com>
> ---
> tools/testing/selftests/bpf/test_tc_tunnel.sh | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/bpf/test_tc_tunnel.sh b/tools/testing/selftests/bpf/test_tc_tunnel.sh
> index 7989ec6084545..cb55a908bb0d7 100755
> --- a/tools/testing/selftests/bpf/test_tc_tunnel.sh
> +++ b/tools/testing/selftests/bpf/test_tc_tunnel.sh
> @@ -305,6 +305,7 @@ else
> client_connect
> verify_data
> server_listen
> + wait_for_port ${port} ${netcat_opt}
> fi
>
> # serverside, use BPF for decap
> --
> 2.47.0.338.g60cca15819-goog
>
Do you see this failing in your CI or in the BPF CI? It seems ok
to add wait_for_port here, but the likelihood of the issue seems
minuscule. There is a bunch of ip/tc/etc calls between this
server_listen and the next client_connect (and I'd be surprised to hear
that netcat is still not listening by the time we reach next
client_connect).
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH bpf-next] tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind
2024-12-03 0:15 ` Stanislav Fomichev
@ 2024-12-03 17:23 ` Marco Leogrande
2024-12-04 15:37 ` Stanislav Fomichev
0 siblings, 1 reply; 5+ messages in thread
From: Marco Leogrande @ 2024-12-03 17:23 UTC (permalink / raw)
To: Stanislav Fomichev
Cc: Andrii Nakryiko, Eduard Zingerman, Mykola Lysenko,
Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Shuah Khan, Alessandro Carminati (Red Hat),
willemb, zhuyifei, bpf, linux-kselftest, linux-kernel
On Mon, Dec 2, 2024 at 4:15 PM Stanislav Fomichev <stfomichev@gmail.com> wrote:
> Do you see this failing in your CI or in the BPF CI?
I see this failing in our internal CI, in around 1% to 2% of the CI runs.
> It seems ok
> to add wait_for_port here, but the likelihood of the issue seems
> minuscule. There is a bunch of ip/tc/etc calls between this
> server_listen and the next client_connect (and I'd be surprised to hear
> that netcat is still not listening by the time we reach next
> client_connect).
I'm surprised as well, and I've not found a good correlation with the
root cause of the delayed server start, besides generic "slowness".
You also make a good point - by calling wait_for_port this early we
"waste" the opportunity to run the other ip commands in parallel in
the meantime.
I had considered moving this wait down, just before the next
client_connect, but I concluded it might be less readable since it
would be so distant from the server_listen it pairs with. But I can
make that change if it seems better.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH bpf-next] tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind
2024-12-03 17:23 ` Marco Leogrande
@ 2024-12-04 15:37 ` Stanislav Fomichev
0 siblings, 0 replies; 5+ messages in thread
From: Stanislav Fomichev @ 2024-12-04 15:37 UTC (permalink / raw)
To: Marco Leogrande
Cc: Andrii Nakryiko, Eduard Zingerman, Mykola Lysenko,
Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Shuah Khan, Alessandro Carminati (Red Hat),
willemb, zhuyifei, bpf, linux-kselftest, linux-kernel
On 12/03, Marco Leogrande wrote:
> On Mon, Dec 2, 2024 at 4:15 PM Stanislav Fomichev <stfomichev@gmail.com> wrote:
> > Do you see this failing in your CI or in the BPF CI?
>
> I see this failing in our internal CI, in around 1% to 2% of the CI runs.
>
> > It seems ok
> > to add wait_for_port here, but the likelihood of the issue seems
> > minuscule. There is a bunch of ip/tc/etc calls between this
> > server_listen and the next client_connect (and I'd be surprised to hear
> > that netcat is still not listening by the time we reach next
> > client_connect).
>
> I'm surprised as well, and I've not found a good correlation with the
> root cause of the delayed server start, besides generic "slowness".
>
> You also make a good point - by calling wait_for_port this early we
> "waste" the opportunity to run the other ip commands in parallel in
> the meantime.
> I had considered moving this wait down, just before the next
> client_connect, but I concluded it might be less readable since it
> would be so distant from the server_listen it pairs with. But I can
> make that change if it seems better.
Thanks for the details, let's keep as is.
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH bpf-next] tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind
2024-12-02 20:45 [PATCH bpf-next] tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind Marco Leogrande
2024-12-03 0:15 ` Stanislav Fomichev
@ 2024-12-04 17:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-04 17:10 UTC (permalink / raw)
To: Marco Leogrande
Cc: andrii, eddyz87, mykolal, ast, daniel, martin.lau, song,
yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, shuah,
alessandro.carminati, willemb, zhuyifei, bpf, linux-kselftest,
linux-kernel
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Mon, 2 Dec 2024 12:45:30 -0800 you wrote:
> Commit f803bcf9208a ("selftests/bpf: Prevent client connect before
> server bind in test_tc_tunnel.sh") added code that waits for the
> netcat server to start before the netcat client attempts to connect to
> it. However, not all calls to 'server_listen' were guarded.
>
> This patch adds the existing 'wait_for_port' guard after the remaining
> call to 'server_listen'.
>
> [...]
Here is the summary with links:
- [bpf-next] tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind
https://git.kernel.org/bpf/bpf-next/c/e2f0791124a1
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] 5+ messages in thread
end of thread, other threads:[~2024-12-04 17:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 20:45 [PATCH bpf-next] tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind Marco Leogrande
2024-12-03 0:15 ` Stanislav Fomichev
2024-12-03 17:23 ` Marco Leogrande
2024-12-04 15:37 ` Stanislav Fomichev
2024-12-04 17:10 ` 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