Re: [PATCH net-next v2 4/4] selftests/net: packetdrill: add TCP MTU probing test

From: Neal Cardwell

Date: Sun Nov 08 2026 - 14:31:04 EST


On Sun, Nov 8, 2026 at 9:39 AM Yongjian Wang via B4 Relay
<devnull+echoowall.gmail.com@xxxxxxxxxx> wrote:
>
> From: Yongjian Wang <echoowall@xxxxxxxxx>
>
> Packetization layer path MTU discovery (net.ipv4.tcp_mtu_probing=2) has
> no selftest coverage.
>
> Add a test for an active connection. Check that it starts at
> tcp_base_mss, that it sends the first probe half way between
> tcp_base_mss and the peer's MSS once cwnd allows it, and that an
> acknowledged probe raises the MSS and leads to a larger probe.
>
> Disable TCP timestamps since the MTU search range is computed before the
> timestamp option is negotiated, which would otherwise make the MSS
> depend on the header length at connect time.

AFAICT with patch 1/4 of this v2 applied, that is no longer true:
active connections now call tcp_mtup_init() in
tcp_rcv_synsent_state_process() after the timestamp option has been
negotiated.

So I would suggest removing this paragraph from the commit description.

> Signed-off-by: Yongjian Wang <echoowall@xxxxxxxxx>
> ---
> .../net/packetdrill/tcp_mtu_probing_search.pkt | 43 ++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_search.pkt b/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_search.pkt
> new file mode 100644
> index 000000000..65e466fbf
> --- /dev/null
> +++ b/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_search.pkt
> @@ -0,0 +1,43 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Test packetization layer path MTU discovery with tcp_mtu_probing=2: an
> +// active connection starts at tcp_base_mss and raises its MSS by binary search
> +// as probes are acknowledged.
> +
> +`./defaults.sh
> +sysctl -q net.ipv4.tcp_mtu_probing=2
> +sysctl -q net.ipv4.tcp_base_mss=1024
> +sysctl -q net.ipv4.tcp_timestamps=0`

AFAICT if we drop the tcp_timestamps=0 line here (so our SYN offers
timestamps and the scripted SYN-ACK declines them), the script should
pass unchanged with patch 1/4, and fail without it (2072-byte rather
than 2048-byte TSO packets, i.e. 2 x 1036 bytes). So I'd suggest
dropping that tcp_timestamps=0 line. That way this test also covers
the active-side part of patch 1/4.

neal