]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests: hw-net: tso: set a TCP window clamp to avoid spurious drops
authorJakub Kicinski <kuba@kernel.org>
Mon, 23 Feb 2026 20:40:30 +0000 (12:40 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 26 Feb 2026 02:59:57 +0000 (18:59 -0800)
commit6698d6ce6a6b20d8780ade93b9b689787b5a4945
tree882e491178aa4822dbd8c3e58c65095a8510a9c0
parent8215d7cbfbcf7f40ad409f5217d88c7abce76fe0
selftests: hw-net: tso: set a TCP window clamp to avoid spurious drops

The TSO test wants to make sure that there isn't a lot of retransmits,
because that could indicate that device has a buggy TSO implementation.
On debug kernels, however, we're likely to see significant packet loss
because we simply overwhelm the receiver.

In a QEMU loop with virtio devices we see ~10% false positive rate
with occasional run hitting the threshold of 25% packet loss.

Since we're only sending 4MB of data, set a TCP_WINDOW_CLAMP to 200k.
This seems to make virtio happy while having little impact since we're
primarily interested in testing the sender, and the test doesn't
currently enable BIG TCP.

Running socat over virtio loop for 2 sec on a debug kernel shows:

  TcpOutSegs                      27327              0.0
  TcpRetransSegs                  83                 0.0

  TcpOutSegs                      30012              0.0
  TcpRetransSegs                  80                 0.0

  TcpOutSegs                      28767              0.0
  TcpRetransSegs                  77                 0.0

But with the clamp the 3 attempts show no retransmit:

  TcpOutSegs                      31537              0.0
  TcpRetransSegs                  0                  0.0

  TcpOutSegs                      30323              0.0
  TcpRetransSegs                  0                  0.0

  TcpOutSegs                      28700              0.0
  TcpRetransSegs                  0                  0.0

Since we expect no receiver-related drops now we can significantly
increase test's sensitivity to drops.

All the testing we do in NIPA uses cubic.

Link: https://patch.msgid.link/20260223204030.4142884-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/hw/tso.py