Re: [PATCH net-next v3 3/4] selftests/net: packetdrill: add TCP black hole detection test

From: Neal Cardwell

Date: Mon Nov 09 2026 - 13:13:33 EST


On Mon, Nov 9, 2026 at 11:44 AM Yongjian Wang via B4 Relay
<devnull+echoowall.gmail.com@xxxxxxxxxx> wrote:
>
> From: Yongjian Wang <echoowall@xxxxxxxxx>
>
> Black hole detection (net.ipv4.tcp_mtu_probing=1) has no selftest
> coverage.
>
> Add a test where a full-sized segment keeps timing out without any ICMP
> feedback. Check that the MSS drops to tcp_base_mss once tcp_retries1 is
> exceeded, and that the smaller MSS is also used for new data after the
> retransmission is acknowledged.
>
> Set tcp_retries1 to 1 to keep the test short, and disable TLP so that
> every retransmission comes from the RTO timer, which is what
> tcp_write_timeout() counts.
>
> Signed-off-by: Yongjian Wang <echoowall@xxxxxxxxx>
> ---
> .../net/packetdrill/tcp_mtu_probing_blackhole.pkt | 37 ++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> diff --git a/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_blackhole.pkt b/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_blackhole.pkt
> new file mode 100644
> index 000000000000..f10dbb36dd2d
> --- /dev/null
> +++ b/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_blackhole.pkt
> @@ -0,0 +1,37 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Test black hole detection with tcp_mtu_probing=1: when full-sized segments
> +// keep timing out and no ICMP arrives, TCP falls back to tcp_base_mss.
> +
> +`./defaults.sh
> +sysctl -q net.ipv4.tcp_mtu_probing=1
> +sysctl -q net.ipv4.tcp_base_mss=1024
> +sysctl -q net.ipv4.tcp_retries1=1
> +sysctl -q net.ipv4.tcp_early_retrans=0`

Thanks for the test! Though because of all these sysctl settings, this
is testing a fairly non-standard configuration. That's better than no
test at all, but IMHO it's more important to test the default
configurations users will be using.

So I'd suggest renaming this case to be something like
tcp_mtu_probing_blackhole_no_tlp_retries1_is_1.pkt.

Then I'd suggest creating a test like this, but with only the following setting:

`./defaults.sh
sysctl -q net.ipv4.tcp_mtu_probing=1`

That way we get test coverage for the most important scenarios and
code paths, and can understand the behavior that users will see if
they just set net.ipv4.tcp_mtu_probing=1 and do nothing else.

Thanks!
neal