From: Yongjian Wang via B4 Relay <devnull+echoowall.gmail.com@kernel.org>
To: davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com,
shuah@kernel.org, kuniyu@google.com, horms@kernel.org,
ncardwell@google.com, kuba@kernel.org
Cc: netdev@vger.kernel.org, panweiping3@gmail.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
Yongjian Wang <echoowall@gmail.com>
Subject: [PATCH net-next v3 4/4] selftests/net: packetdrill: add TCP MTU probing test
Date: Tue, 10 Nov 2026 00:44:38 +0800 [thread overview]
Message-ID: <20261110-mtu-probing-series-v3-4-dedfab25d641@gmail.com> (raw)
In-Reply-To: <20261110-mtu-probing-series-v3-0-dedfab25d641@gmail.com>
From: Yongjian Wang <echoowall@gmail.com>
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.
The SYN offers timestamps and the scripted SYN-ACK declines them.
This also checks that MTU probing uses the negotiated header length
for the initial send MSS.
Signed-off-by: Yongjian Wang <echoowall@gmail.com>
---
.../net/packetdrill/tcp_mtu_probing_search.pkt | 42 ++++++++++++++++++++++
1 file changed, 42 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 000000000000..a48acff8685e
--- /dev/null
+++ b/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_search.pkt
@@ -0,0 +1,42 @@
+// 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`
+
+ 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+ +0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+ +0 connect(3, ..., ...) = -1 EINPROGRESS (Operation is now in progress)
+ +0 > S 0:0(0) <...>
+ +.1 < S. 0:0(0) ack 1 win 65535 <mss 1460,nop,nop,sackOK>
+ +0 > . 1:1(0) ack 1
+ +0 fcntl(3, F_SETFL, O_RDWR) = 0
+
+// The initial window is sent with tcp_base_mss. No probe yet, cwnd is below 11.
+ +0 write(3, ..., 40000) = 40000
+ +0 > P. 1:2049(2048) ack 1
+ +0 > P. 2049:4097(2048) ack 1
+ +0 > P. 4097:6145(2048) ack 1
+ +0 > P. 6145:8193(2048) ack 1
+ +0 > P. 8193:10241(2048) ack 1
+
+// The first probe is half way between tcp_base_mss and the peer's MSS.
+ +.1 < . 1:1(0) ack 10241 win 65535
+ +0 > . 10241:11483(1242) ack 1
+ +0 > P. 11483:13531(2048) ack 1
+ +0 > P. 13531:15579(2048) ack 1
+ +0 > P. 15579:17627(2048) ack 1
+ +0 > P. 17627:19675(2048) ack 1
+ +0 > P. 19675:21723(2048) ack 1
+ +0 > P. 21723:23771(2048) ack 1
+ +0 > P. 23771:25819(2048) ack 1
+ +0 > P. 25819:27867(2048) ack 1
+ +0 > P. 27867:29915(2048) ack 1
+
+// Acknowledging the probe raises the MSS, and the next probe is larger.
+ +.1 < . 1:1(0) ack 29915 win 65535
+ +0 > . 29915:31266(1351) ack 1
+ +0 > P. 31266:33750(2484) ack 1
--
Git-157)
prev parent reply other threads:[~2026-11-09 16:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 16:44 [PATCH net-next v3 0/4] tcp: fix tcp_base_mss on passive connections and test MTU probing Yongjian Wang via B4 Relay
2026-11-09 16:44 ` [PATCH net-next v3 1/4] tcp: initialize MTU probing before syncing MSS at connection setup Yongjian Wang via B4 Relay
2026-11-09 16:44 ` [PATCH net-next v3 2/4] selftests/net: packetdrill: test tcp_base_mss on passive connections Yongjian Wang via B4 Relay
2026-11-09 16:44 ` [PATCH net-next v3 3/4] selftests/net: packetdrill: add TCP black hole detection test Yongjian Wang via B4 Relay
2026-11-09 18:12 ` Neal Cardwell
2026-11-09 16:44 ` Yongjian Wang via B4 Relay [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110-mtu-probing-series-v3-4-dedfab25d641@gmail.com \
--to=devnull+echoowall.gmail.com@kernel.org \
--cc=davem@davemloft.net \
--cc=echoowall@gmail.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=panweiping3@gmail.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®