Skip to contentSkip to conversation

selftests: net: let big_tcp test cope with slow env

PATCH Applied Paolo Abeni 4 participants 5 messages Feb 2, 2024 – Feb 5, 2024

Subsystems (3)
lore
Share & tools
lore

Paolo Abeni

author maintainer
#0 lore raw

PATCH 1/1 selftests: net: let big_tcp test cope with slow env

In very slow environments, most big TCP cases including segmentation and reassembly of big TCP packets have a good chance to fail: by default the TCP client uses write size well below 64K. If the host is low enough autocorking is unable to build real big TCP packets.

Address the issue using much larger write operations.

Note that is hard to observe the issue without an extremely slow and/or overloaded environment; reduce the TCP transfer time to allow for much easier/faster reproducibility.

Fixes 6bb382bcf742 ("selftests: add a selftest for big tcp")
---
 tools/testing/selftests/net/big_tcp.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/net/big_tcp.sh +3 -1
index cde9a91c4797..2db9d15cd45f 100755
@@ -122,7 +122,9 @@ do_netperf() {
 	local netns=$1
 
 	[ "$NF" = "6" ] && serip=$SERVER_IP6
-	ip net exec $netns netperf -$NF -t TCP_STREAM -H $serip 2>&1 >/dev/null
+
+	# use large write to be sure to generate big tcp packets
+	ip net exec $netns netperf -$NF -t TCP_STREAM -l 1 -H $serip -- -m 262144 2>&1 >/dev/null
 }
 
 do_test() {
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Paolo Abeni

In very slow environments, most big TCP cases including segmentation and reassembly of big TCP packets have a good chance to fail: by default the TCP client uses write size well below 64K. If the host is low enough autocorking is unable to build real big TCP packets.

Address the issue using much larger write operations.

Note that is hard to observe the issue without an extremely slow and/or overloaded environment; reduce the TCP transfer time to allow for much easier/faster reproducibility.

Fixes 6bb382bcf742 ("selftests: add a selftest for big tcp")
---
 tools/testing/selftests/net/big_tcp.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/net/big_tcp.sh +0 -0
index cde9a91c4797..2db9d15cd45f 100755

tools/testing/selftests/net/big_tcp.sh do_netperf() { · line 128

Quoted 8 lines
tools/testing/selftests/net/big_tcp.sh +3 -1
@@ -122,7 +122,9 @@ do_netperf() {
        local netns=$1
 
        [ "$NF" = "6" ] && serip=$SERVER_IP6
-       ip net exec $netns netperf -$NF -t TCP_STREAM -H $serip 2>&1 >/dev/null
+
+       # use large write to be sure to generate big tcp packets
+       ip net exec $netns netperf -$NF -t TCP_STREAM -l 1 -H $serip -- -m 262144 2>&1 >/dev/null
 }

Interesting.

I think we set tcp_wmem[1] to 262144 in our hosts. I think netperf default depends on tcp_wmem[1]

author maintainer
#2 lore raw
Quoted 36 lines · Eric Dumazet
Quoted 24 lines · Paolo Abeni

In very slow environments, most big TCP cases including segmentation and reassembly of big TCP packets have a good chance to fail: by default the TCP client uses write size well below 64K. If the host is low enough autocorking is unable to build real big TCP packets.

Address the issue using much larger write operations.

Note that is hard to observe the issue without an extremely slow and/or overloaded environment; reduce the TCP transfer time to allow for much easier/faster reproducibility.

Fixes 6bb382bcf742 ("selftests: add a selftest for big tcp")
---
 tools/testing/selftests/net/big_tcp.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/selftests/net/big_tcp.sh +0 -0
index cde9a91c4797..2db9d15cd45f 100755

tools/testing/selftests/net/big_tcp.sh do_netperf() { · line 128

Quoted 8 lines
tools/testing/selftests/net/big_tcp.sh +3 -1
@@ -122,7 +122,9 @@ do_netperf() {
        local netns=$1
 
        [ "$NF" = "6" ] && serip=$SERVER_IP6
-       ip net exec $netns netperf -$NF -t TCP_STREAM -H $serip 2>&1 >/dev/null
+
+       # use large write to be sure to generate big tcp packets
+       ip net exec $netns netperf -$NF -t TCP_STREAM -l 1 -H $serip -- -m 262144 2>&1 >/dev/null
 }

Interesting.

Quoted 2 lines

I think we set tcp_wmem[1] to 262144 in our hosts. I think netperf default depends on tcp_wmem[1]

I haven't dug into the netperf source, but the above would be consistent with what I observe: in my VM I see 16Kb writes and tcp_wmem[1] is 16K.

Quoted 1 line

Thanks!

Paolo

Acked-by on v1 1/1
#3 lore raw
In reply to Paolo Abeni
Quoted 7 lines · Paolo Abeni

In very slow environments, most big TCP cases including segmentation and reassembly of big TCP packets have a good chance to fail: by default the TCP client uses write size well below 64K. If the host is low enough autocorking is unable to build real big TCP packets.

Quoted 8 lines

Address the issue using much larger write operations.

Note that is hard to observe the issue without an extremely slow and/or overloaded environment; reduce the TCP transfer time to allow for much easier/faster reproducibility.

Fixes 6bb382bcf742 ("selftests: add a selftest for big tcp")
#4 lore raw
In reply to Paolo Abeni
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 9 lines · On Fri, 2 Feb 2024 17:06:59 +0100 you wrote:

In very slow environments, most big TCP cases including segmentation and reassembly of big TCP packets have a good chance to fail: by default the TCP client uses write size well below 64K. If the host is low enough autocorking is unable to build real big TCP packets.

Address the issue using much larger write operations.

[...]

Here is the summary with links:
- [net] selftests: net: let big_tcp test cope with slow env

    https://git.kernel.org/netdev/net/c/a19747c3b9bf

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html