* [PATCH net] selftests: tc_actions: don't dump 2MB of \0 to stdout
@ 2026-02-14 3:51 Jakub Kicinski
2026-02-16 12:11 ` Simon Horman
2026-02-18 1:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2026-02-14 3:51 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, Jakub Kicinski,
shuah, marcelo.leitner, jhs, dcaratti, linux-kselftest
Since we started running selftests in NIPA we have been seeing
tc_actions.sh generate a soft lockup warning on ~20% of the runs.
On the pre-netdev foundation setup it was actually a missed irq
splat from the console. Now it's either that or a lockup.
I initially suspected a socket locking issue since the test
is exercising local loopback with act_mirred.
After hours of staring at this I noticed in strace that ncat
when -o $file is specified _both_ saves the output to the file
and still prints it to stdout. Because the file being sent
is constructed with:
dd conv=sparse status=none if=/dev/zero bs=1M count=2 of=$mirred
^^^^^^^^^
the data printed is all \0. Most terminals don't display nul
characters (and neither does vng output capture save them).
But QEMU's serial console still has to poke them thru which
is very slow and causes the lockup (if the file is >600kB).
Replace the '-o $file' with '> $file'. This speeds the test up
from 2m20s to 18s on debug kernels, and prevents the warnings.
Fixes: ca22da2fbd69 ("act_mirred: use the backlog for nested calls to mirred ingress")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: shuah@kernel.org
CC: marcelo.leitner@gmail.com
CC: jhs@mojatatu.com
CC: dcaratti@redhat.com
CC: linux-kselftest@vger.kernel.org
---
tools/testing/selftests/net/forwarding/tc_actions.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/forwarding/tc_actions.sh b/tools/testing/selftests/net/forwarding/tc_actions.sh
index ea89e558672d..86edbc7e2489 100755
--- a/tools/testing/selftests/net/forwarding/tc_actions.sh
+++ b/tools/testing/selftests/net/forwarding/tc_actions.sh
@@ -223,7 +223,7 @@ mirred_egress_to_ingress_tcp_test()
ip_proto icmp \
action drop
- ip vrf exec v$h1 ncat --recv-only -w10 -l -p 12345 -o $mirred_e2i_tf2 &
+ ip vrf exec v$h1 ncat --recv-only -w10 -l -p 12345 > $mirred_e2i_tf2 &
local rpid=$!
ip vrf exec v$h1 ncat -w1 --send-only 192.0.2.2 12345 <$mirred_e2i_tf1
wait -n $rpid
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] selftests: tc_actions: don't dump 2MB of \0 to stdout
2026-02-14 3:51 [PATCH net] selftests: tc_actions: don't dump 2MB of \0 to stdout Jakub Kicinski
@ 2026-02-16 12:11 ` Simon Horman
2026-02-18 1:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-02-16 12:11 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, shuah,
marcelo.leitner, jhs, dcaratti, linux-kselftest
On Fri, Feb 13, 2026 at 07:51:59PM -0800, Jakub Kicinski wrote:
> Since we started running selftests in NIPA we have been seeing
> tc_actions.sh generate a soft lockup warning on ~20% of the runs.
> On the pre-netdev foundation setup it was actually a missed irq
> splat from the console. Now it's either that or a lockup.
>
> I initially suspected a socket locking issue since the test
> is exercising local loopback with act_mirred.
> After hours of staring at this I noticed in strace that ncat
Ouch!
> when -o $file is specified _both_ saves the output to the file
> and still prints it to stdout. Because the file being sent
> is constructed with:
>
> dd conv=sparse status=none if=/dev/zero bs=1M count=2 of=$mirred
> ^^^^^^^^^
>
> the data printed is all \0. Most terminals don't display nul
> characters (and neither does vng output capture save them).
> But QEMU's serial console still has to poke them thru which
> is very slow and causes the lockup (if the file is >600kB).
>
> Replace the '-o $file' with '> $file'. This speeds the test up
> from 2m20s to 18s on debug kernels, and prevents the warnings.
>
> Fixes: ca22da2fbd69 ("act_mirred: use the backlog for nested calls to mirred ingress")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
I exercise this by running ncat locally on Fedora 43.
$ ncat --version
Ncat: Version 7.92 ( https://nmap.org/ncat )
And confirmed the behaviour you describe.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] selftests: tc_actions: don't dump 2MB of \0 to stdout
2026-02-14 3:51 [PATCH net] selftests: tc_actions: don't dump 2MB of \0 to stdout Jakub Kicinski
2026-02-16 12:11 ` Simon Horman
@ 2026-02-18 1:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-02-18 1:20 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah,
marcelo.leitner, jhs, dcaratti, linux-kselftest
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 13 Feb 2026 19:51:59 -0800 you wrote:
> Since we started running selftests in NIPA we have been seeing
> tc_actions.sh generate a soft lockup warning on ~20% of the runs.
> On the pre-netdev foundation setup it was actually a missed irq
> splat from the console. Now it's either that or a lockup.
>
> I initially suspected a socket locking issue since the test
> is exercising local loopback with act_mirred.
> After hours of staring at this I noticed in strace that ncat
> when -o $file is specified _both_ saves the output to the file
> and still prints it to stdout. Because the file being sent
> is constructed with:
>
> [...]
Here is the summary with links:
- [net] selftests: tc_actions: don't dump 2MB of \0 to stdout
https://git.kernel.org/netdev/net/c/32b70e62034a
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] 3+ messages in thread
end of thread, other threads:[~2026-02-18 1:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-14 3:51 [PATCH net] selftests: tc_actions: don't dump 2MB of \0 to stdout Jakub Kicinski
2026-02-16 12:11 ` Simon Horman
2026-02-18 1: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