Article View: linux.kernel.netdev
Article #20209Re: [PATCH net-next v2 1/2] tcp: document black hole detection for tcp_mtu_probing
From: netdev-bot+sashiko
Date: Sat, 21 Nov 2026 19:35
Date: Sat, 21 Nov 2026 19:35
189 lines
15014 bytes
15014 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 3
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The new tcp_mtu_probing text in Documentation/networking/ip-
sysctl.rst (lines 725-731) says: "From then on, and from the first…
- [Low] The new detection-time text (ip-sysctl.rst lines 716-723) says
the threshold is the time tcp_retries1 retransmissions would take…
- [Low] The new text (ip-sysctl.rst lines 728-729) says search_low is
kept "at most tcp_base_mss and at least tcp_mtu_probe_floor and…
- [Low] The new text (ip-sysctl.rst lines 716-718) says "A black hole is
detected when the retransmission timer fires after the handshake and…
--
tcp: document black hole detection for tcp_mtu_probing
This commit extends the tcp_mtu_probing entry in ip-sysctl.rst. It
describes when an ICMP black hole is detected and how TCP adjusts the MSS
afterwards, based on tcp_write_timeout() and tcp_mtu_probing(). It also
adds the default values of tcp_mtu_probing and tcp_base_mss.
> diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst
> index 0b7bfbd98a923..6ac8b3fb9aae8 100644
> --- a/Documentation/networking/ip-sysctl.rst
> +++ b/Documentation/networking/ip-sysctl.rst
[ ... ]
> @@ -711,6 +713,25 @@ tcp_mtu_probing - INTEGER
> - 1 - Disabled by default, enabled when an ICMP black hole detected
> - 2 - Always enabled, use initial MSS of tcp_base_mss.
>
> + A black hole is detected when the retransmission timer fires after
> + the handshake and retransmissions have stayed unacknowledged for as
[Severity: Low]
Should this also cover the zero window case? In tcp_retransmit_timer(),
if the peer advertises a zero window and the socket is not orphaned, the
timer takes a separate branch and never gets to tcp_write_timeout():
net/ipv4/tcp_timer.c:tcp_retransmit_timer() {
...
if (!tp->snd_wnd && !sock_flag(sk, SOCK_DEAD) &&
!((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV))) {
...
tcp_enter_loss(sk);
tcp_retransmit_skb(sk, skb, 1);
__sk_dst_reset(sk);
goto out_reset_timer;
}
__NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEOUTS);
if (tcp_write_timeout(sk))
goto out;
...
}
While the window stays at zero, no black hole is detected and the MSS is
not lowered, however long the retransmissions stay unacknowledged.
> + long as tcp_retries1 retransmissions would take with an RTO starting
> + at 200 ms and doubling each time, which is 3 seconds with the
[Severity: Low]
Does the RTO keep doubling when tcp_rto_max is not the default?
tcp_model_timeout() stops doubling at tcp_rto_max(sk):
net/ipv4/tcp_timer.c:tcp_model_timeout() {
...
linear_backoff_thresh = ilog2(tcp_rto_max(sk) / rto_base);
if (boundary <= linear_backoff_thresh)
timeout = ((2 << boundary) - 1) * rto_base;
else
timeout = ((2 << linear_backoff_thresh) - 1) * rto_base +
(boundary - linear_backoff_thresh) * tcp_rto_max(sk);
...
}
icsk_rto_max comes from net.ipv4.tcp_rto_max_ms, which can be set as low
as 1000, or from the TCP_RTO_MAX_MS socket option.
Take tcp_rto_max_ms=1000 with the default tcp_retries1=3.
linear_backoff_thresh is then ilog2(5) = 2, so the threshold is
7 * 200 + 1 * 1000 = 2400 ms, not 3 seconds.
The flow's own RTO is also capped at 1 s, so timeouts fire at 0.2, 0.6,
1.4, 2.4 and 3.4 s. Detection then happens about 3.4 s after the original
transmission, not about 6 s.
With the default 120 s rto_max, a tcp_retries1 above 9 also makes the
threshold grow linearly in 120 s steps instead of doubling.
Could the text say that the doubling is capped at tcp_rto_max_ms, and
that the 3 and 6 second figures assume the default?
> + default tcp_retries1. This time is counted from the first
> + retransmission and only checked when the timer fires, so a flow
> + with a 200 ms RTO detects the black hole at the fifth timeout,
> + about 6 seconds after the original transmission.
> +
> + With value 1, the first detection enables MTU probing and lowers
> + the MSS to tcp_base_mss if it is larger. From then on, and from the
> + first detection with value 2, each further retransmission timeout
[Severity: Medium]
Does every further retransmission timeout really lower search_low? In
tcp_write_timeout(), tcp_mtu_probing() is only called while the
tcp_retries1 condition holds:
net/ipv4/tcp_timer.c:tcp_write_timeout() {
...
if (retransmits_timed_out(sk, READ_ONCE(net->ipv4.sysctl_tcp_retries1), 0)) {
/* Black hole detection */
tcp_mtu_probing(icsk, sk);
__dst_negative_advice(sk);
}
...
}
retransmits_timed_out() returns false whenever icsk_retransmits is zero:
net/ipv4/tcp_timer.c:retransmits_timed_out() {
...
if (!inet_csk(sk)->icsk_retransmits)
return false;
...
}
tcp_ack() resets that counter as soon as snd_una advances:
net/ipv4/tcp_input.c:tcp_ack() {
...
if (after(ack, prior_snd_una)) {
flag |= FLAG_SND_UNA_ADVANCED;
WRITE_ONCE(icsk->icsk_retransmits, 0);
...
}
Once the connection recovers, for example after the first halving lets
packets through, a later isolated RTO does not halve search_low again.
Only timeouts during a new stall that lasts past the tcp_retries1
threshold do.
The commit message says the text describes the behaviour "as implemented
in tcp_write_timeout() and tcp_mtu_probing()". Could this sentence be
reworded, for example to "each further timeout at which the black hole
condition still holds"?
> + lowers search_low to half its MSS, keeping it at most tcp_base_mss
> + and at least tcp_mtu_probe_floor and tcp_min_snd_mss, and lowers the
[Severity: Low]
Can search_low end up above tcp_base_mss? tcp_mtu_probing() applies the
cap first and the floors after it, so the floors win:
net/ipv4/tcp_timer.c:tcp_mtu_probing() {
...
mss = tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_low) >> 1;
mss = min(READ_ONCE(net->ipv4.sysctl_tcp_base_mss), mss);
mss = max(mss, READ_ONCE(net->ipv4.sysctl_tcp_mtu_probe_floor));
mss = max(mss, READ_ONCE(net->ipv4.sysctl_tcp_min_snd_mss));
...
}
tcp_base_mss uses plain proc_dointvec with no bounds, while
tcp_mtu_probe_floor accepts 48..65535. Two settings that put search_low
above tcp_base_mss:
tcp_mtu_probe_floor=1200 with tcp_base_mss=1024
tcp_base_mss set below tcp_min_snd_mss
Could the text say that the floors take precedence over the tcp_base_mss
cap?
> + MSS to match if it is larger. Once MTU probing is enabled, the
> + connection also probes for a larger MSS, as with value 2.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118-tcp-mtu-probing-doc-v1-v2-0-e795f20b8cfe%40gmail.com
Technical Details
Message-ID:
<179528971425.3135.11498750682572420334@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368430-linux-kernel-netdev=dewy.ruReferences:
<20261118-tcp-mtu-probing-doc-v1-v2-1-e795f20b8cfe@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368430-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2 1/2] tcp: document black hole detection for tcp_mtu_probing Date: Sat, 21 Nov 2026 19:35:14 +0000 Organization: Usenet Network Message-ID: <179528971425.3135.11498750682572420334@kernel.org> References: <20261118-tcp-mtu-probing-doc-v1-v2-1-e795f20b8cfe@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3476536"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:CT2XHq+T5466HxxvMMOLasBpLdQ= sha256:PDvK8nvL96cvVEN9hjwsA3XqJVtsYeQJ1T9yRRL9+K8= sha1:+oDgjFchLK9LMda1hAeD68xm2tc= sha256:RszQisjzutzATJTKsGxwPRgMG57AXknMpdsVyFKilkg= 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 9E3AD115BD0; Sat, 21 Nov 2026 22:35:31 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 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] 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 lfYLuMe4a92b; Sat, 21 Nov 2026 22:35:27 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368430-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 5AC78115BC9; Sat, 21 Nov 2026 22:35:19 +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 CF60338136; Sat, 21 Nov 2026 19:35:16 +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=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795289716; b=3M4TlG1xP1HSyyg+HEwGTrbsqz7P+k0s8ktioyAEIAa5uskjN/cT7AmPHYBxs6ndhVgr 1XR7Vy5NHI0RfYKAJVDJd1h0sWUJy+TtG8bHMNIpYCm/ta3zVGdEIUudmfrPrZ3As+cE7 EymOcBmSNREo0CLY0dfggQb1DYeiKJeij72D170YTUq6/YJqTu4A+wY1a5rXnAaXNkl0s 6ufXuSSDF9iolTJXkfk2G2BdHzWuID1yZP+3WPynECXplRQkAfA/aKSKckaa32xlIEKNP V8vOmOKWsVHGtpvkA8N/4NzkwITdHF7uPmEYB71hd6yih4kzFkrl2niZSmiBpWDcTXA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795289716; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=JH+iXlWaf0QYvuXeZ5FGygsDHzmcBZZQOeinMNmsuMo=; b=NowyxeVJDr97YVnyFs6rs1CiO5SkjmAzFiYp02qmyNziOd6cGAxZ68+oThleUjwfj+3r uFJ9QgWxYz5CP/wLtA/GqhKVf4yiebAoQh+aaUEgpsMcdGvUE0CWSR0/B8gmKvTM3/R8p tVIiRRf414eQOtZ5NBEimQI7WzA05wWliaHRACPppOxcTVx6nIN3EvVN1yMgplGGGFust lE0bMQXhOzdBtyRCU4ul1wjkfYWiuq2e4BGfcb36F3+r7k4CRAA1RkiasnOX4xcqMBV1I GMuRgHuZxqf8JHCfB2VIItNxY8K4UGEXJRy6Wyf6FgilXl7Ose+qTeqwmdGYvYf7Z5w== 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=f32ag3IC; 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 81006606A337; Sat, 21 Nov 2026 19:35:16 +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=f32ag3IC X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795289715; b=qgYCVUCSyBETEdbM9ddtPkBB/BypOoKMDw9qMXxrwPFGpMwdFYEcVcsIBbDIE/vutNK9 7ydfSWJ/MDHgrYXhuuG15muvJcHb9ea0fkqjrRHhxaLPBQ5z2IEpE8ZdEtzY5Z2RNvuOu dOgynMHWMLbEjbM9zuQvvyElq5yfJtftiv7MWsDSP61WEMpEULiQhH0Rb9dPLmH4pV0WM J4qXtOC8D4pggK+qHli4Kmy7/YRPnw0u/Q2s3x3HW+d//T+vqAZiPEjNGJKQgy7DfaUgR AGi1cYOK0tMUzQfDnKM++WqqNKYOcXMrSSriqeHyAn3DKIpmwvuKDIrqX7iUgN6PgEA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795289715; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=JH+iXlWaf0QYvuXeZ5FGygsDHzmcBZZQOeinMNmsuMo=; b=ugnaMMzhIW6SppZk8o3QZqKpToGaRyVmR0Ri3oT7GXPoMGwKew3z7PMuORY/K0+68Xvk LSISrQo9yshJCLjDOColgu1w7oIHwfCgczFyGVWJMw6RskWBMRnpsUNRFzOYMRuFGXsM3 uSyUFkDCGBBZPwTjgQ8g1tAGDStqgYOBMSXSoNn+5N9oFY2mqj9wGQzMEajSovABTaBus 3WStCRkVlqF/ZVi0wW39zGm6mBBewgcZk20l6d4iQo5kLH+veDoXa0Hhmr3JN8iydL+xM 6l0KEdMis/iDjLA+0uWHdGTmjiEwrAo1/PiFknVEbrOrtFGyhTPU1uGGvcdZ4t3N3Ug== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=f32ag3IC; arc=none 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 9FCDB606A320; Sat, 21 Nov 2026 19:35:15 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA9B71F000C0; Sat, 21 Nov 2026 19:35:14 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795289715; bh=JH+iXlWaf0QYvuXeZ5FGygsDHzmcBZZQOeinMNmsuMo=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=f32ag3IC/vl5IywST6f+vJ0yHzSYwOZFQP0PowGjHdAFvmry7mgIj3EqIOz1DJ7Ah gcS/2i2r+AcuvZW/v8aMtUXyK9G4kqk3eSrh6z/sYdhRpneE6LIOIk2yHSNWzMpk7o 5e4z+mqGJRpazfiRXTz25oABoXbfbzS4n1fa2HbT1oGphZmtYKdwSM9dMwUYmcBZ6Y awzrqOGBNJmI/0Wc4Sgq0yARum1GKhplCFWzj0cwwbcy3FidY/zqf+8intUbAe6Mx5 HY0b11DSRfrcEmJ/5XmmZjSYpHG3bIHt9+BU5nRoKqJR6vVqBgOnEbnnbt0ZF14mxn JAqkogyS0WOEQ== X-Cc: corbet@lwn.net, edumazet@kernel.org, davem@davemloft.net, kuba@kernel.org, shuah@kernel.org, pabeni@redhat.com, rdunlap@infradead.org, linux-doc@vger.kernel.org, horms@kernel.org, ncardwell@google.com, kuniyu@google.com, skhan@linuxfoundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org X-In-Reply-To: <20261118-tcp-mtu-probing-doc-v1-v2-1-e795f20b8cfe@gmail.com> X-sashiko-severity: Medium 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