* [PATCH] selftests/net: give more time to udpgro bg processes to complete startup
@ 2022-11-01 18:48 Adrien Thierry
2022-11-04 3:46 ` Jakub Kicinski
2022-11-04 10:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 5+ messages in thread
From: Adrien Thierry @ 2022-11-01 18:48 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Shuah Khan
Cc: Adrien Thierry, netdev, linux-kselftest
In some conditions, background processes in udpgro don't have enough
time to set up the sockets. When foreground processes start, this
results in the test failing with "./udpgso_bench_tx: sendmsg: Connection
refused". For instance, this happens from time to time on a Qualcomm
SA8540P SoC running CentOS Stream 9.
To fix this, increase the time given to background processes to
complete the startup before foreground processes start.
Signed-off-by: Adrien Thierry <athierry@redhat.com>
---
This is a continuation of the hack that's present in those tests. Other
ideas are welcome to fix this in a more permanent way.
tools/testing/selftests/net/udpgro.sh | 4 ++--
tools/testing/selftests/net/udpgro_bench.sh | 2 +-
tools/testing/selftests/net/udpgro_frglist.sh | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/net/udpgro.sh b/tools/testing/selftests/net/udpgro.sh
index ebbd0b282432..6a443ca3cd3a 100755
--- a/tools/testing/selftests/net/udpgro.sh
+++ b/tools/testing/selftests/net/udpgro.sh
@@ -50,7 +50,7 @@ run_one() {
echo "failed" &
# Hack: let bg programs complete the startup
- sleep 0.1
+ sleep 0.2
./udpgso_bench_tx ${tx_args}
ret=$?
wait $(jobs -p)
@@ -117,7 +117,7 @@ run_one_2sock() {
echo "failed" &
# Hack: let bg programs complete the startup
- sleep 0.1
+ sleep 0.2
./udpgso_bench_tx ${tx_args} -p 12345
sleep 0.1
# first UDP GSO socket should be closed at this point
diff --git a/tools/testing/selftests/net/udpgro_bench.sh b/tools/testing/selftests/net/udpgro_bench.sh
index fad2d1a71cac..8a1109a545db 100755
--- a/tools/testing/selftests/net/udpgro_bench.sh
+++ b/tools/testing/selftests/net/udpgro_bench.sh
@@ -39,7 +39,7 @@ run_one() {
ip netns exec "${PEER_NS}" ./udpgso_bench_rx -t ${rx_args} -r &
# Hack: let bg programs complete the startup
- sleep 0.1
+ sleep 0.2
./udpgso_bench_tx ${tx_args}
}
diff --git a/tools/testing/selftests/net/udpgro_frglist.sh b/tools/testing/selftests/net/udpgro_frglist.sh
index 832c738cc3c2..7fe85ba51075 100755
--- a/tools/testing/selftests/net/udpgro_frglist.sh
+++ b/tools/testing/selftests/net/udpgro_frglist.sh
@@ -44,7 +44,7 @@ run_one() {
ip netns exec "${PEER_NS}" ./udpgso_bench_rx ${rx_args} -r &
# Hack: let bg programs complete the startup
- sleep 0.1
+ sleep 0.2
./udpgso_bench_tx ${tx_args}
}
--
2.38.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] selftests/net: give more time to udpgro bg processes to complete startup
2022-11-01 18:48 [PATCH] selftests/net: give more time to udpgro bg processes to complete startup Adrien Thierry
@ 2022-11-04 3:46 ` Jakub Kicinski
2022-11-04 8:54 ` Paolo Abeni
2022-11-04 10:20 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2022-11-04 3:46 UTC (permalink / raw)
To: Adrien Thierry
Cc: David S. Miller, Eric Dumazet, Paolo Abeni, Shuah Khan, netdev,
linux-kselftest
On Tue, 1 Nov 2022 14:48:08 -0400 Adrien Thierry wrote:
> In some conditions, background processes in udpgro don't have enough
> time to set up the sockets. When foreground processes start, this
> results in the test failing with "./udpgso_bench_tx: sendmsg: Connection
> refused". For instance, this happens from time to time on a Qualcomm
> SA8540P SoC running CentOS Stream 9.
>
> To fix this, increase the time given to background processes to
> complete the startup before foreground processes start.
>
> Signed-off-by: Adrien Thierry <athierry@redhat.com>
> ---
> This is a continuation of the hack that's present in those tests. Other
> ideas are welcome to fix this in a more permanent way.
Perhaps we can add an option to the Rx side to daemonize itself after
setting up the socket, that way the bash script will be locked until
Rx is ready?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] selftests/net: give more time to udpgro bg processes to complete startup
2022-11-04 3:46 ` Jakub Kicinski
@ 2022-11-04 8:54 ` Paolo Abeni
2022-11-04 17:47 ` Jakub Kicinski
0 siblings, 1 reply; 5+ messages in thread
From: Paolo Abeni @ 2022-11-04 8:54 UTC (permalink / raw)
To: Jakub Kicinski, Adrien Thierry
Cc: David S. Miller, Eric Dumazet, Shuah Khan, netdev,
linux-kselftest
On Thu, 2022-11-03 at 20:46 -0700, Jakub Kicinski wrote:
> On Tue, 1 Nov 2022 14:48:08 -0400 Adrien Thierry wrote:
> > In some conditions, background processes in udpgro don't have enough
> > time to set up the sockets. When foreground processes start, this
> > results in the test failing with "./udpgso_bench_tx: sendmsg: Connection
> > refused". For instance, this happens from time to time on a Qualcomm
> > SA8540P SoC running CentOS Stream 9.
> >
> > To fix this, increase the time given to background processes to
> > complete the startup before foreground processes start.
> >
> > Signed-off-by: Adrien Thierry <athierry@redhat.com>
> > ---
> > This is a continuation of the hack that's present in those tests. Other
> > ideas are welcome to fix this in a more permanent way.
>
> Perhaps we can add an option to the Rx side to daemonize itself after
> setting up the socket, that way the bash script will be locked until
> Rx is ready?
Then it will be less straigh-forward for the running shell waiting for
all the running processes.
Another option would be replacing the sleep with a loop waiting for
the rx UDP socket to appear in the procfs or diag interface, alike what
mptcp self-tests (random example;) are doing:
https://elixir.bootlin.com/linux/v6.1-rc3/source/tools/testing/selftests/net/mptcp/mptcp_join.sh#L424
Cheers,
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] selftests/net: give more time to udpgro bg processes to complete startup
2022-11-04 8:54 ` Paolo Abeni
@ 2022-11-04 17:47 ` Jakub Kicinski
0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2022-11-04 17:47 UTC (permalink / raw)
To: Paolo Abeni
Cc: Adrien Thierry, David S. Miller, Eric Dumazet, Shuah Khan, netdev,
linux-kselftest
On Fri, 04 Nov 2022 09:54:10 +0100 Paolo Abeni wrote:
> Then it will be less straigh-forward for the running shell waiting for
> all the running processes.
The usual solution for that is to write the pid of the daemonized
process to a file, no?
> Another option would be replacing the sleep with a loop waiting for
> the rx UDP socket to appear in the procfs or diag interface, alike what
> mptcp self-tests (random example;) are doing:
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] selftests/net: give more time to udpgro bg processes to complete startup
2022-11-01 18:48 [PATCH] selftests/net: give more time to udpgro bg processes to complete startup Adrien Thierry
2022-11-04 3:46 ` Jakub Kicinski
@ 2022-11-04 10:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-04 10:20 UTC (permalink / raw)
To: Adrien Thierry
Cc: davem, edumazet, kuba, pabeni, shuah, netdev, linux-kselftest
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Tue, 1 Nov 2022 14:48:08 -0400 you wrote:
> In some conditions, background processes in udpgro don't have enough
> time to set up the sockets. When foreground processes start, this
> results in the test failing with "./udpgso_bench_tx: sendmsg: Connection
> refused". For instance, this happens from time to time on a Qualcomm
> SA8540P SoC running CentOS Stream 9.
>
> To fix this, increase the time given to background processes to
> complete the startup before foreground processes start.
>
> [...]
Here is the summary with links:
- selftests/net: give more time to udpgro bg processes to complete startup
https://git.kernel.org/netdev/net/c/cdb525ca92b1
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:[~2022-11-04 17:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-01 18:48 [PATCH] selftests/net: give more time to udpgro bg processes to complete startup Adrien Thierry
2022-11-04 3:46 ` Jakub Kicinski
2022-11-04 8:54 ` Paolo Abeni
2022-11-04 17:47 ` Jakub Kicinski
2022-11-04 10: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;
as well as URLs for NNTP newsgroup(s).