Re: [PATCH net-next v3 4/6] selftests/net: packetdrill: add tcp_rcv_wnd_shrink_nomem.pkt
From: Eric Dumazet
Date: Tue Mar 10 2026 - 04:47:26 EST
On Mon, Mar 9, 2026 at 9:03 AM Simon Baatz via B4 Relay
<devnull+gmbnomis.gmail.com@xxxxxxxxxx> wrote:
>
> From: Simon Baatz <gmbnomis@xxxxxxxxx>
>
> This test verifies
> - the sequence number checks using the maximum advertised window
> sequence number and
> - the logic for handling received data in tcp_data_queue()
>
> for the cases:
>
> 1. The window is reduced to zero because of memory
>
> 2. The window grows again but still does not reach the originally
> advertised window
>
> Signed-off-by: Simon Baatz <gmbnomis@xxxxxxxxx>
> ---
Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>
Thanks !
> +// Ooo partial segment, in adv. window -> accept
> + +0 < P. 1040001:1042001(2000) ack 2001 win 257
> + +0 > . 2001:2001(0) ack 1042001 <nop,nop,sack 1040001:1041001>
> +
> +// Ooo segment, in max adv. window, beyond adv. window -> drop (SKB_DROP_REASON_TCP_OVERWINDOW)
> + +0 < P. 1105001:1106001(1000) ack 2001 win 257
> + +0 > . 2001:2001(0) ack 1042001
> +// Ooo segment, beyond max adv. window, beyond adv. window -> drop (SKB_DROP_REASON_TCP_INVALID_SEQUENCE)
> + +0 < P. 2000001:2001001(1000) ack 2001 win 257
> + +0 > . 2001:2001(0) ack 1042001
> +// Check LINUX_MIB_BEYOND_WINDOW has been incremented twice
> + +0 `nstat -s | grep TcpExtBeyondWindow | grep -q " 4 "`
> +
> +// We are allowed to go beyond the window and buffer with one packet
> + +0 < P. 1042001:1062001(20000) ack 2001 win 257
> + * > . 2001:2001(0) ack 1062001
> + +0 < P. 1062001:1082001(20000) ack 2001 win 257
> + * > . 2001:2001(0) ack 1082001 win 0
> +
> +// But not more: In order segment, in max adv. window -> drop (SKB_DROP_REASON_TCP_ZEROWINDOW)
> + +0 < P. 1082001:1083001(1000) ack 2001 win 257
> + * > . 2001:2001(0) ack 1082001
> +// Check LINUX_MIB_TCPZEROWINDOWDROP has been incremented again
> + +0 `nstat -s | grep TcpExtTCPZeroWindowDrop| grep -q " 3 "`
>
> --
> 2.53.0
>
>