Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/net: packetdrill: improve tcp_rcv_neg_window.pkt

The test depends on accepting a packet that is larger than the
advertised window and that does not trigger an immediate ACK.

Previously, the test might still pass even if kernel behavior changed
unexpectedly. Add assertions verifying that the large packet was
accepted and no ACK was sent.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Link: https://patch.msgid.link/20260316-improve_tcp_neg_usable_wnd_test-v1-1-f16d5e365107@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Simon Baatz and committed by
Paolo Abeni
96a584db a7fb05cb

+11 -3
+11 -3
tools/testing/selftests/net/packetdrill/tcp_rcv_neg_window.pkt
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 + // Test maximum advertised window limit when rcv_nxt advances past 3 + // rcv_mwnd_seq. The "usable window" must be properly clamped to zero 4 + // rather than becoming negative. 2 5 3 6 --mss=1000 4 7 ··· 20 17 21 18 +0 accept(3, ..., ...) = 4 22 19 23 - // A too big packet is accepted if the receive queue is empty 20 + // A too big packet is accepted if the receive queue is empty. It 21 + // does not trigger an immediate ACK. 24 22 +0 < P. 1:20001(20000) ack 1 win 257 23 + +0 %{ assert tcpi_bytes_received == 20000, tcpi_bytes_received; }% 24 + 25 25 // Send a RST immediately so that there is no rcv_wup/rcv_mwnd_seq update yet 26 26 +0 < R. 20001:20001(0) ack 1 win 257 27 27 28 - +.1 %{ assert tcpi_state == TCP_CLOSE, tcpi_state }% 29 - 28 + // Verify that the RST was accepted. Indirectly this also verifies that no 29 + // immediate ACK was sent for the data packet above. 30 + +0 < . 20001:20001(0) ack 1 win 257 31 + +0 > R 1:1(0)