Article View: linux.kernel.netdev
Article #5353Re: [PATCH net-next v2 3/3] tcp: Add mss_cache_set_by_cca for CC algorithm to set MSS
From: Eric Dumazet
Date: Tue, 20 Oct 2026 08:03
Date: Tue, 20 Oct 2026 08:03
132 lines
15063 bytes
15063 bytes
Le lun. 19 oct. 2026 à 17:53, Neal Cardwell <ncardwell@google.com> a écrit :
>
> On Sun, Oct 18, 2026 at 5:15 PM <chia-yu.chang@nokia-bell-labs.com> wrote:
> >
> > From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> >
> > Make the CC module set the mss_cache smaller than path mtu. This is useful
>
> Since many CC modules will not set the mss_cache value, rather than
> "Make the CC module set" I think it's important to say "Allow the CC
> module to set".
>
> > for a CC module that maintains an internal fractional cwnd less than 2 at
> > very low speed (<100kbps) and very low RTT (<1ms). In this case, the
> > minimum snd_cwnd for the stack remains at 2, but the CC module will limit
> > the pacing rate to ensure that its internal fractional cwnd takes effect.
> > Therefore, the CC algorithm can enable fine-grained control without
> > causing big rate saw-tooth and delay jitter.
> >
> > Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> > ---
> > include/linux/tcp.h | 3 ++-
> > net/ipv4/tcp.c | 1 +
> > net/ipv4/tcp_output.c | 5 +++--
> > 3 files changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/include/linux/tcp.h b/include/linux/tcp.h
> > index e4d1720f49f0..428d63e46206 100644
> > --- a/include/linux/tcp.h
> > +++ b/include/linux/tcp.h
> > @@ -232,7 +232,8 @@ struct tcp_sock {
> > tcp_usec_ts : 1, /* TSval values in usec */
> > is_sack_reneg:1, /* in recovery from loss with SACK reneg? */
> > is_cwnd_limited:1,/* forward progress limited by snd_cwnd? */
> > - recvmsg_inq : 1;/* Indicate # of bytes in queue upon recvmsg */
> > + recvmsg_inq : 1,/* Indicate # of bytes in queue upon recvmsg */
> > + mss_cache_set_by_cca:1;/* mss_cache set by CCA */
> > __cacheline_group_end(tcp_sock_read_txrx);
> >
> > /* RX read-mostly hotpath cache lines */
> > diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> > index f4c9101e5996..708e1830227b 100644
> > --- a/net/ipv4/tcp.c
> > +++ b/net/ipv4/tcp.c
> > @@ -457,6 +457,7 @@ void tcp_init_sock(struct sock *sk)
> > tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
> > tp->snd_cwnd_clamp = ~0;
> > tp->mss_cache = TCP_MSS_DEFAULT;
> > + tp->mss_cache_set_by_cca = false;
> >
> > tp->reordering = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reordering);
> > tcp_assign_congestion_control(sk);
> > diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> > index 3248f3895b15..c53d70718830 100644
> > --- a/net/ipv4/tcp_output.c
> > +++ b/net/ipv4/tcp_output.c
> > @@ -2082,7 +2082,7 @@ unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu)
> > struct inet_connection_sock *icsk = inet_csk(sk);
> > int mss_now;
> >
> > - if (icsk->icsk_mtup.search_high > pmtu)
> > + if (icsk->icsk_mtup.search_high > pmtu && !tp->mss_cache_set_by_cca)
> > icsk->icsk_mtup.search_high = pmtu;
>
> This looks suspicious, or at least I don't understand the motivation
> here. What's the motivation for this?
>
> > mss_now = tcp_mtu_to_mss(sk, pmtu);
> > @@ -2096,6 +2096,7 @@ unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu)
> >
> > return mss_now;
> > }
> > +EXPORT_SYMBOL(tcp_sync_mss);
> >
> > /* Compute the current effective MSS, taking SACKs and IP options,
> > * and even PMTU discovery events into account.
> > @@ -2111,7 +2112,7 @@ unsigned int tcp_current_mss(struct sock *sk)
> >
> > mss_now = tp->mss_cache;
> >
> > - if (dst) {
> > + if (dst && !tp->mss_cache_set_by_cca) {
> > u32 mtu = dst_mtu(dst);
> > if (mtu != inet_csk(sk)->icsk_pmtu_cookie)
> > mss_now = tcp_sync_mss(sk, mtu);
>
> How is this going to work if the path MTU reduces? For example, if the
> sysadmin lowers the MTU to be lower than what's consistent with the
> MSS value the CC module chose? Won't the packets from the connection
> all be bigger than the MTU, causing weird fragmentation or
> black-holing?
>
> AFAICT, to be safe, if the dst_mtu() changes then we still have to
> call tcp_sync_mss(), even if the CC module wants some input into the
> MSS decision.
>
> Wouldn't it be safer to propose that the CC module optionally sets a
> ceiling for the MSS value, rather than giving it direct control over
> the MSS value? Along those lines, perhaps CC modules that want to do
> this could export a new optional CC module callback that we use in
> __tcp_mtu_to_mss(), perhaps something like this?
>
> /* Clamp it (mss_clamp does not include tcp options) */
> if (mss_now > tp->rx_opt.mss_clamp)
> mss_now = tp->rx_opt.mss_clamp;
> + /* Optionally clamp MSS based on CC module: */
> + if (ca_ops->max_mss)
> + mss_now = min(mss_now, ca_ops->max_mss(sk));
>
> Perhaps Eric or Yuchung will have a better idea. :-)
I have not seen the patch in my mailbox.
Chia-Yu Chang I suggest you trim the CC list and make sure to not
forget linux official maintainers.
My email address has changed to edumazet@kernel.org one month ago.
Technical Details
Message-ID:
<CAL4Wiio29vZ1V7FavAH5dXpRQB5U=dpvaHVAjvGPc7K1E=wLEQ@mail.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-349105-linux-kernel-netdev=dewy.ruReferences:
<20261018211514.2817293-1-chia-yu.chang@nokia-bell-labs.com> <20261018211514.2817293-4-chia-yu.chang@nokia-bell-labs.com> <CADVnQyn1sjYzfCRiVKOxvyXbx0j2_3y5t9FsyTr81YG9XjdvxA@mail.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-349105-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 3/3] tcp: Add mss_cache_set_by_cca for CC
algorithm to set MSS
Date: Tue, 20 Oct 2026 10:03:41 +0200
Organization: Usenet Network
Message-ID: <CAL4Wiio29vZ1V7FavAH5dXpRQB5U=dpvaHVAjvGPc7K1E=wLEQ@mail.gmail.com>
References: <20261018211514.2817293-1-chia-yu.chang@nokia-bell-labs.com>
<20261018211514.2817293-4-chia-yu.chang@nokia-bell-labs.com> <CADVnQyn1sjYzfCRiVKOxvyXbx0j2_3y5t9FsyTr81YG9XjdvxA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="3807626"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:XHIU6rGk3/a4n4O6Z5AUMAwGQ/0= sha256:n3/hI4GIrWii6jWEkzkYW7VcZBRcrrzILxT/ylqfHbc=
sha1:cF6R34P5btYCwInzPhvZCtERh4s= sha256:7s1KmVmqmyca/XEqe5cbqCXhb67T5MVorKH5WOnf5GE=
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 01F8B110C40; Tue, 20 Oct 2026 11:04:20 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.729
X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, 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 COMsXjxSvCBJ;
Tue, 20 Oct 2026 11:04:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-349105-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
by mail.dewy.ru (Postfix) with ESMTPS id D33BE110C38; Tue, 20 Oct 2026 11:04:03 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sin.lore.kernel.org (Postfix) with ESMTP id 6FEDE24440; Tue, 20 Oct 2026 08:03:56 +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=1792483435;
b=2iDXepPERUAEEi5G8wRs8NcBvclF7/gTttDGjb/yB/1x8MEg4AbCjzjCWgs6G4NLgZa5
PH2Elv/DBzCAzfgYA6cWUiPDzWWOThJu+qkATGb2VRHNosM8e/Ly4efYMXFo7zH7HMTWw
LL7g9ZdjQjqHVN4i49+OY9FN8tCTLKJ6GOt4S9kOoF+KBNVJn2+stStJX01XStLuD1XX/
qmDy3Gnkvl1o5vRdwu1+UIyc77lNon/uXYEf/CdH4vPP4bjmz6MJsCkTX1Y5blfuMiL2c
SqM7angGp6O0YoHMJgk0hH+gMvTQcCRWsZtB5ks6p9kLwzYYc1BxqNG4KsYhvTeDCsA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792483435;
h=X-Original-To:Received:Received:DKIM-Signature:Received:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:MIME-Version:References:In-Reply-To:From:Date:
X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type:Content-Transfer-Encoding;
bh=W3FYn8+t+xAEUJqETz/VS7X9J4Hf4qfbk8kiNjZx1vA=;
b=U08PpIPYCev1xMrxb8PPwrOjlsCwjhVApwtMDkZOEzqBNHkRciG15MPIRmIV7PuxeJxl
T/siLBDF7S495E2vcd11R3gUC74mYDpI2BeY7kkTwUxMp73QuukFMn4H71rAx5lETi5iM
SiRwWBgmDtaFNjimfbCo/RqbngRL1aJSWdc5cPqgszQeqEWDlPuZ61fhLF5qnj+OXLhSq
ObzBlRj+ZSWMCP953EZ50EM0GAzMU5mtp24Av0RB9taHHCkdMSUSqSHPgQE2V2QLJicZB
Ukv5t3LHHwyXiDklXbrZOv176J405rOIcNVZQwpAXgh6hbgPW0V7yns7YPwdV8c3yoA==
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=fhT4oAni;
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 1E1A7606A327;
Tue, 20 Oct 2026 08:03:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fhT4oAni
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=1792483434;
b=OvEWom4WV+frVihiyePBJXgmnk0R5T0k03dPIO+C69BJEGAZl/tUGLU1I5pgDfGmUwij
FxR0YTRUQ4BPwJkpVGhE8cQKfWvypWA4Lu2gGQI3Y6SEhNHAmUz3u9y77XLXys+cg1jnk
kixvPSP3QiWgStHRuR5lRKCD5FPYzjvA/zS0s38ZcWNmFs+qqm6EYu3yephW5/sPOv/Tl
2UPUrQJg6rU0A1Hgk/9UUq9SyWMqkjc8qq8FQaTGet7V+gSNJwQveWQ8O/e7ASdr6gNO5
P0oMEYkvi3JYmnhli3DlEfbcyckmzcjXw5xZvUHg2nBQzhhj74D5RU4jyu/zyhdZy/w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792483434;
h=Received:DKIM-Signature:Received:X-Forwarded-Encrypted:
X-Gm-Message-State:X-Received:MIME-Version:References:In-Reply-To:
From:Date:X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:
Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
bh=W3FYn8+t+xAEUJqETz/VS7X9J4Hf4qfbk8kiNjZx1vA=;
b=Jt6sDb2Gqb7tm7W6l7NdGaLfmvSaSqVH39ow0n3ZldzNixNs/M4KbzxSrQZ2RR9yVn14
h7DlLvr0C3WasZtPMTPpWVVa9sGupNSrwkgXmGGG1Ei2X3fxVrqniLmM+u+RFe2PTE0vI
HL3LQvTbsnh9eWeRV5lKqQ3LMIFUhjAC/kKqgr+3UT5ykCAmY3Pa7oCchjT5C5U2/785Q
ClUhNq/FilIkRu08/ibUcarVfwG3R0Hq3Ewre7rHxyW1zW7H9G7FI96i662/8STCHYYCr
O+EsqR55gYfSs/Zmb1DoZv436fxpSv5121IKo8iPuEeVQAEgrbZKBXrwtC5hLVQ0Qqg==
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=fhT4oAni;
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 805E3606A31D
for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 08:03:53 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FA291F000C8
for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 08:03:53 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1792483433;
bh=W3FYn8+t+xAEUJqETz/VS7X9J4Hf4qfbk8kiNjZx1vA=;
h=References:In-Reply-To:From:Date:Subject:To:Cc;
b=fhT4oAni4vhn86mJutTgjqLpl0aJZd83TwHzly3cCBGWuma3P6s2sMIzvRfn2wlJ0
PhRnqj8kfVvPuqchmrsJmTUN2K/TEc3OxzXgfjTBUwFU86dzMRmYqsIfGIUVqycM6o
AsI9+Y/hHE6VfyRJOWaWFD9qFleuNnvEDVq6Ec/KWd+/UI8zigltgozH1YkgixoXBJ
+J0YBHKg5k0pp8a6AzJiOQ5icBnY8sDiUvkcqCZ8T3ko+X+ED60mjehHkJUwIywG2F
nmksFVBkp3rgw0j2/qaF+j7nUyc/fWN86FmsJ/df1kVTSePRLAbRNkzq1tdmRI9Vz5
Bsb1JcF8t9KRw==
X-Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-48e9476e26aso904734fac.3
for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 01:03:53 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AKwUvBwGw6masQNRQvRwMMW0kDiqL1PYTmIf3RzuTr/5U6gH6Qm+WstV3m/WdldlKvZNPIHHMLXZC0Q=@vger.kernel.org
X-Gm-Message-State: AFq9FYJU8Mc1cSXY165WTS/i2eAMLxBRHopNlluqIlDxSbKDmxh3owy3
43c4VavTq5KSWb4U3ZQ4y+tbEW+PJW3fpLkz2IHDHyixGn9/QbfmNDsxxmuN9+TpkROwppjQ9UP
6bD8EUTSEerjbLteITbZS5DtH5TPlsM0=
X-Received: by 2002:a05:6871:3407:b0:494:7af4:954b with SMTP id
586e51a60fabf-4a757974186mr7725987fac.19.1792483432412; Tue, 20 Oct 2026
01:03:52 -0700 (PDT)
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: <CADVnQyn1sjYzfCRiVKOxvyXbx0j2_3y5t9FsyTr81YG9XjdvxA@mail.gmail.com>
X-Gmail-Original-Message-ID: <CAL4Wiio29vZ1V7FavAH5dXpRQB5U=dpvaHVAjvGPc7K1E=wLEQ@mail.gmail.com>
X-Gm-Features: AclHuK_ovVSChGzHdfO5X_ok_DHLL08jkCal7WDQ-6ENaDlZb3UvzrU4iI8QpLI
X-Cc: chia-yu.chang@nokia-bell-labs.com, ihor.solodrai@linux.dev,
john.fastabend@gmail.com, jakub@cloudflare.com, jiayuan.chen@linux.dev,
netdev@vger.kernel.org, bpf@vger.kernel.org, ast@kernel.org,
daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com,
martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev,
jolsa@kernel.org, emil@etsalapatis.com, linux-kselftest@vger.kernel.org,
shuah@kernel.org, horms@kernel.org, dsahern@kernel.org, pabeni@redhat.com,
jhs@mojatatu.com, stephen@networkplumber.org, davem@davemloft.net,
andrew+netdev@lunn.ch, donald.hunter@gmail.com, kuniyu@google.com,
ij@kernel.org, koen.de_schepper@nokia-bell-labs.com, g.white@cablelabs.com,
ingemar.s.johansson@ericsson.com, mirja.kuehlewind@ericsson.com,
cheshire@apple.com, rs.ietf@gmx.at, Jason_Livingood@comcast.com,
vidhi_goel@apple.com, Mike_Rudolph@comcast.com, Jeff_Howe@comcast.com,
srichard@netapp.com, Yuchung Cheng <ycheng@google.com>