🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12778

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

#12778
From: Yongjian Wang via B4 Relay
Date: Sun, 08 Nov 2026 14:39
66 lines
12667 bytes
From: Yongjian Wang <echoowall@gmail.com>

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@gmail.com>
---
 .../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 000000000..f10dbb36d
--- /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`
+
+    0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+   +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
+   +0 bind(3, ..., ...) = 0
+   +0 listen(3, 1) = 0
+
+   +0 < S 0:0(0) win 65535 <mss 1460,nop,nop,sackOK>
+   +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK>
+  +.1 < . 1:1(0) ack 1 win 65535
+   +0 accept(3, ..., ...) = 4
+
+   +0 write(4, ..., 1460) = 1460
+   +0 > P. 1:1461(1460) ack 1
+
+// The first retransmission keeps the full size.
+  +.3 > P. 1:1461(1460) ack 1
+
+// Once tcp_retries1 is exceeded the MSS drops to tcp_base_mss.
+  +.6 > . 1:1025(1024) ack 1
+  +.1 < . 1:1(0) ack 1025 win 65535
+   +0 > P. 1025:1461(436) ack 1
+  +.1 < . 1:1(0) ack 1461 win 65535
+
+// New data keeps using the smaller MSS.
+   +0 write(4, ..., 1460) = 1460
+   +0 > . 1461:2485(1024) ack 1
+   +0 > P. 2485:2921(436) ack 1
+  +.1 < . 1:1(0) ack 2921 win 65535

-- 
Git-157)
Technical Details
Message-ID: <20261108-mtu-probing-series-v2-3-355d6490c3db@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358781-linux-kernel-netdev=dewy.ru
References: <20261108-mtu-probing-series-v2-0-355d6490c3db@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358781-linux-kernel-netdev=dewy.ru
From: devnull+echoowall.gmail.com@kernel.org (Yongjian Wang via B4 Relay)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v2 3/4] selftests/net: packetdrill: add TCP black
 hole detection test
Date: Sun, 08 Nov 2026 22:39:53 +0800
Organization: Usenet Network
Message-ID: <20261108-mtu-probing-series-v2-3-355d6490c3db@gmail.com>
References: <20261108-mtu-probing-series-v2-0-355d6490c3db@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="143454"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:80gy8BgGiPANN0svf1Gt0/ntgI8= sha256:+eSAbRuuCNLVAVVrCsHxAbfirclmktjdT4St02PE6WA=
	sha1:RVMd3pFyKuLsNWdrOOWuKChmkxQ= sha256:Fzkw6Evb+hR0l7uXBTqovhE9TWuhfCmuoCma/a/0pFc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id D9C241135AB; Sun,  8 Nov 2026 17:41:19 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id hOQpU7HDAdbz;
	Sun,  8 Nov 2026 17:41:16 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-358781-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 929421135A4; Sun,  8 Nov 2026 17:41:08 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 076C3291B9; Sun,  8 Nov 2026 14:39:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794148797;
	b=tDNtvwk2IvvQjU6zlto6yYZDrPoq1MlYEw983q+DU4c8aGyX2EuOz3G5/x2eX9Yh0I9G
	 K+IQo/ueRPv+v9hebaPkPwCinH7tenXIzGF2KjwmF4czluB1M4BnGpODflewODn0htaqZ
	 ul66HAatdAds4wdbr/GYR/9DmwlgXGFXRlF7tRWOqU9/z01qJBSPpYEP9mxRMtVioAX90
	 +u2t/esNyHpeaCxU+9sPTAUQCdW9vXORj+Js0kHTL2rIDwbcbohqhMX0hKasCDIwQIp5P
	 MMhuVZLcTGO372JN4izH9rx7fUifOyiNzjk8UV14Pg8FWKXgS9tgaV5TG+fV0JyRFqA==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794148797;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date:
	 Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=CeOxTxKArDbG7RBezkcPwmjmZobpCK7vzK4n/jgzMSk=;
	b=Y3KjMjynnApkJjFqWT3WXZGAYhnqIuWdkT9jdO6J+7sXAsyo6/l/AlMIrV/rZmy9skcK
	 jxWyfE2TY2BPC5qMsdIiSG/sW2q3W0+lAYKILa7yoHvkTwCI0HdL91B9y/gz60usMEda6
	 Jmn8KpCucWwI68prVqLyVNy9V2OVrKva+oTHQY/bOTPidyhavIzhfu/g6C04J1GmCLBJ3
	 DHNXp9+CWYaQOkgR5g+0T/KpPCZ6aPuFUS9G/4AP6gROm7iwn90ojrfRKmKMyC8k5B0X1
	 iVTLMFnQ9u8Rv7JoonfTBF0UEimca5sFayzkc4oE2hhkOgjG/k6MZqYmtxBEdFvdKjQ==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TfNHglHj;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 138AF606A339;
	Sun,  8 Nov 2026 14:39:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TfNHglHj
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794148796;
	b=R7RvMdYkcmNQLwhchnHPimXrLNP99ph//rjOjicazoSXOFYW3b5yp8sqzCcqLWoLiu2Z
	 gHYxbS02wSJPCCWzaK5REqS06MCot4TVjjpsbNKfOZ40Vnnsymb+bxV8vmbuxowVSTDs0
	 i0FoDkXjszC+erxlYFq5EWRBDl+A+VDCpT1JLte8JEpImHnOikAbzd3IV8eOzVN2uBL+V
	 AUmZV+j9argGCctblRKrcxKJVIDPKBTCMRwAdE8AbBKaQjtMpbkqGVi4WkULmDFAP3RxB
	 dl6TNRdDTCf2NBreOdIsw1C8aUM7b4l1ydvK3WTco6dVdRF4M2i8jKD58IHT6p29jZg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794148796;
	h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version:
	 Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=CeOxTxKArDbG7RBezkcPwmjmZobpCK7vzK4n/jgzMSk=;
	b=asWtHcK61d56Wl5OHLA1f3bgVw/mE1iveXoIk2qOoRRtOtfjLcGexXQa+czg+LjV7F5N
	 MjLBYuCND745TbJHfgikpwEcVlylKdKXSh/zrTon632JaiqZz8r40dWWRCHdnxaCEoVa8
	 uAKI/KglC3bo6UZOPWo2rjw7935TDdlCAobEsEnnUI9VYWOS0BO5GBIAZsEtm5CvBaQSI
	 qlnJ9DZek0ADP/dqUI4+rRzJHZX2V6TbVVa8pqZ7l7kWbZ1qu9E3S2d5DRUVQmPDYOzsn
	 pwLe/oh3ni8ZXSW6O7G3Uul6hJ/BsTWw7KG+eOIHQw68TW5UtszH8zeXt+hYv/l5QxQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TfNHglHj;
	arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAEBB606A33C;
	Sun,  8 Nov 2026 14:39:55 +0000 (UTC)
X-Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77
X-ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none;
	t=1794148795;
	b=EpnNumtdYx+jJyyIYYiI9FIeQy4hTwex3UxdALTZtHaAoGuG/R7sdwczeePIsslZKvLl
	 5hD/C/DXpx38WFsn+DO0r+HYCJM40wkoQjAEfhjt+PStHbXg+Qag0b9RuUPwD1vadvbOA
	 zRf6YPwdu8mhVtgYbWM2z75uuQ1yJwsEn/5fJmUdIZiycctJ+T/V8xz6FJwtG8Z1W1nse
	 xEoVa0XlYey2ZD37EaGCzbMTKxzJok1GIpPYdyXJ4sVsaZpj94w6MqLMYEi2WhL2Oyq8L
	 hOur/VuT+RTCYLfghfEXVOtBSyv1UOC7IWwBBBmtukCSv4/Ll6j1AMCcForvva5ZW7A==
X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256;
	c=relaxed/relaxed; t=1794148795;
	h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type:
	 Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=CeOxTxKArDbG7RBezkcPwmjmZobpCK7vzK4n/jgzMSk=;
	b=0e2HEpuMcNs2sYOTnc6bhr8Dz2qoIMqqPnZH/6WwbdnTElIxyMJ9lUY/Dupto67tv6Us
	 24m/0SZzuXXz4imXJv0QV5zqhUKEfcTtXbk8JleksbG+QKRe5Xj4vqfA33EPPH5h5RnSH
	 2oQn453ebndxcRhmotbC68iknj7E6SBv4CLHsSKnfg5gPJ+kI1FU8BTIc0Pd9V3TaNG8V
	 6Kztl99TQb7yuzQ6Qb5BNfOJOyVb4Nta/rzQpKIhwz+FLiDZQbBPupMRDP6aOIoCufXXS
	 HA9tRbw6ETWAbIvvMPUA/+IN8V3PMo8VQb7zanc1GkbMZbrQhTJddPsmkWB1FSRA8hg==
X-ARC-Authentication-Results: i=1; smtp.kernel.org; 
	arc=none smtp.remote-ip=100.80.115.77
X-Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.kernel.org (Postfix) with ESMTPS id 198251F008A4;
	Sun,  8 Nov 2026 14:39:55 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794148795;
	bh=CeOxTxKArDbG7RBezkcPwmjmZobpCK7vzK4n/jgzMSk=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To;
	b=TfNHglHj9zWG8V2barZa+njevWyohUVz0Fm5qLoXyZ5sg4yO/ofH+IlOpMoDfUiMk
	 Nk4PDFlEayKjdN6/XUy1ShhdBKlfAAjsnPOfk92BJ/kA9/YCEOUi7jv3ZQHavW04ra
	 V8zGMd+4yi/g3GW7owR52lgZtxLtG/cVDnS1jO2vtohWOliQzNs1Ool4ZKoIeiOD5Z
	 y6J9sddrDU6weukBGoMI5R2/m9SOixwjGUKEUJewok17gN1/yYu4xuPXZFdev2zD6L
	 D8N27JStEBI0JfzJLny2WMuj7zIfZrX50a20GTFItL0dEkITZc4zqh6bOCbn7xt39k
	 PBVtQGf8lkqkw==
X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1])
	by lkml.kernel.org (Postfix) with ESMTP id 9695D47FBF;
	Sun,  8 Nov 2026 14:39:53 +0000 (UTC)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261108-mtu-probing-series-v2-0-355d6490c3db@gmail.com>
X-Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, 
 panweiping3@gmail.com, netdev@vger.kernel.org, 
 Yongjian Wang <echoowall@gmail.com>
X-Mailer: b4 0.16.0
X-Developer-Signature: v=1; a=ed25519-sha256; t=1794148792; l=2271;
 i=echoowall@gmail.com; s=20261026; h=from:subject:message-id;
 bh=2gf+VU4SH9z04KrX//6g8/b2rrK3/ddnLXUqOlblf40=;
 b=7q3nY3jteMK81g4oaXBQFD2D+TuCHTmZis9MFpehVkdgguW1+hKijcRKCymxd7pgl64FxeJXC
 OFCT/ym3LQwDyBd/572PLUNxQnCBSYNVH79F3Jx/QSFWZt2kSNmMDfk
X-Developer-Key: i=echoowall@gmail.com; a=ed25519;
 pk=9XP6JhqjjPsHCF6UZZZTeqTRnXIa4+ufggnxXtTJ+no=
X-Endpoint-Received: by B4 Relay for echoowall@gmail.com/20261026 with
 auth_id=1323
X-Original-From: Yongjian Wang <echoowall@gmail.com>
X-Reply-To: echoowall@gmail.com