From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D67D3F1ADC for ; Mon, 27 Jul 2026 23:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785194395; cv=none; b=Ix4tLtf5KsaDumMzGxaKPMLc6s9lIcSGfKifhr7yjcGMkAazVHZYPfotMfnyYzcmibRijZnVuZ1l61gMsMzSBjuv3LcyttDcHvKGWXtHpbENIATkFow3Tqej22cWOrdFmSZ1yJttvmSqKir31IqYHv3182e+HCFEEwMwKgeTF6w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785194395; c=relaxed/simple; bh=vqZsukyfPFlCsGIHPmji0dINVoYYCORoyRlFMHwEkfE=; h=Mime-Version:Content-Type:Date:Message-Id:To:Subject:From: References:In-Reply-To; b=NotM9wYLSSru158TNr8iSny7Jeng/GgtYrOdjk2ay8GCTiogmEckCu8Stzt/pFDIgHFgLLDzeSltLjw4d3cHAjG6VFmaS6SVKM+klGfLDJ6ei8uXXddvDV16yZ8F5ruLAljtUS6DW3UL+LyjnRW8PWDyorglbxDAPTG8YiBqOxw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=etsalapatis.com; spf=pass smtp.mailfrom=etsalapatis.com; dkim=pass (2048-bit key) header.d=etsalapatis-com.20251104.gappssmtp.com header.i=@etsalapatis-com.20251104.gappssmtp.com header.b=waTGuKp2; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=etsalapatis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=etsalapatis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=etsalapatis-com.20251104.gappssmtp.com header.i=@etsalapatis-com.20251104.gappssmtp.com header.b="waTGuKp2" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-84874b52eabso4382353b3a.0 for ; Mon, 27 Jul 2026 16:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=etsalapatis-com.20251104.gappssmtp.com; s=20251104; t=1785194393; x=1785799193; darn=vger.kernel.org; h=in-reply-to:references:from:subject:to:message-id:date:content-type :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to:content-type; bh=04eYvslAHHNmbnCC9MM68slhst/lYwvmeA8ooU3iD0A=; b=waTGuKp2qSyX0xD4xnH8jQXPaqKUi//bj25Ym5gjuXrgpaFcNMb3wv2iFJZ+crmdnW TS0y6b5hgeVugUqzIbXbH7hvUPKq+QGwP9oaSm4YYTqVikgueBDzf5G+yB95+Xi1BKyS mAFV1Q4x4mxF5u9OHoKtyBv+8xpOqfJNjA+cWOzzmvl+1gz7jv+hYopXH4QrcS3ef7vb 4CVshnt3Jo3xLLV0NJj+4UchBNToj/Cy1305sjKa+OwzEdNIEC0F/x8r2rwJDzOp8ehd MMoA/N7E/mCJCHsZlgOORcdhIW9+6MBPvQy4NExI4G3golvkyFqbwrpaCU/EpKpifG7k CNxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785194393; x=1785799193; h=in-reply-to:references:from:subject:to:message-id:date:content-type :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to:content-type; bh=04eYvslAHHNmbnCC9MM68slhst/lYwvmeA8ooU3iD0A=; b=KNrsB14oX8Tu0Aq+2M8QDSH4ev5YqBJjzAR5q7Jx+UHyPQM7eO0I82jL5VSraGrjbW YmBDt+aSFzc2uJzKtAOUnB1GLe8l7ybCzDmK8kpwYPWSa9++3DDs31qkxp1EH3J3WGpf VsCqx9A+zhhSNvX2MIXN5alzZr1gmW/AcjwEObC6/1oYx6ip7LyB43UGyN/aV1mi6omz 8TcNlzzTuLVEYgI2SZTjlLgeFSkdIQc+Vc7bNKmBdwsFpMvIARzfj87jy/CB+l/Gi31V /4+AAdTt0jjV0aN4uCAfl/iVEr1KhOcqEsN0h4IM2LWp3xdz6asos7ZSMD8H7ODdQ65u CLBA== X-Forwarded-Encrypted: i=1; AHgh+RrDCjpx8ziXF49Oy+HKVDJNRuxPKO6TY9fHR+8S0o2hM6RlHQzbVpVycz03dCDGrNKIqWDzayc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx33sP74zCMQtANPsV5tlFl4i/61U7/Br/pmPW4mJ6ajVy6AOan UudSUBsaoOWOvDkLvjirE2Q20J7k5hLa9fKgHgDklKt7fOy7/LBN+xyU7wZweZK8HgA= X-Gm-Gg: AR+sD103GpZGuml1vqk+F/YFNo3VJ5VQi1NJeCh0xZQMClj/syyGlbcBPsUOSMm9FFv vYBzyrdGqpm5NfZQM2qOQ6ODMmqWMYCWNXiXsVXveMwOWmlt6Ktt+bU98sfjmeBoK4zfq0TFA+L Ri7NskEQD7f5dgmWK9NSxTo/1bzdQwWfYZPV7iJlFItwimw+LUHWTi4rHFWSV0eqVTH9EypSU0p 0pHxWCPJw/Ip30wDszZ5o+7S87y88Oz5toPIGGgx9yJ9eb6Ky5WHu4p/kvTcw6sz1uBoBBNyopf gN84AGWLr9QI8y/vrIKhk77ngKjkYN9U0oryU+gmgUMBfhOQ3eLzP4hYeViZvAV4bBXBa1dSGuK PzverikgpAxld192R/ZoR/O/co72yk2jWlU8VFgsYPH5dTpS1QwzSysYlgMr9KcGGdmViiBS3FP gpIRYeJetpfwthVeUjhiwLM8UFlpT8uSA= X-Received: by 2002:a05:6a00:1941:b0:845:4d71:8d15 with SMTP id d2e1a72fcca58-84e59568c44mr8650243b3a.37.1785194393420; Mon, 27 Jul 2026 16:19:53 -0700 (PDT) Received: from localhost (107-190-31-17.cpe.teksavvy.com. [107.190.31.17]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbbb66b282asm3910533a12.18.2026.07.27.16.19.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jul 2026 16:19:52 -0700 (PDT) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 27 Jul 2026 19:19:51 -0400 Message-Id: To: "Chia-Yu Chang (Nokia)" , "horms@kernel.org" , "dsahern@kernel.org" , "bpf@vger.kernel.org" , "netdev@vger.kernel.org" , "pabeni@redhat.com" , "jhs@mojatatu.com" , "kuba@kernel.org" , "stephen@networkplumber.org" , "davem@davemloft.net" , "edumazet@google.com" , "andrew+netdev@lunn.ch" , "donald.hunter@gmail.com" , "kuniyu@google.com" , "ij@kernel.org" , "ncardwell@google.com" , "Koen De Schepper (Nokia)" , "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" Subject: Re: [PATCH v4 net-next 1/1] tcp: allow congestion controls to override TSO autosizing From: "Emil Tsalapatis" X-Mailer: aerc 0.21.0-0-g5549850facc2 References: <20260726193802.397321-1-chia-yu.chang@nokia-bell-labs.com> In-Reply-To: On Mon Jul 27, 2026 at 4:02 AM EDT, Chia-Yu Chang (Nokia) wrote: >> -----Original Message----- >> From: Chia-Yu Chang (Nokia) =20 >> Sent: Sunday, July 26, 2026 9:38 PM >> To: horms@kernel.org; dsahern@kernel.org; bpf@vger.kernel.org; netdev@vg= er.kernel.org; pabeni@redhat.com; jhs@mojatatu.com; kuba@kernel.org; stephe= n@networkplumber.org; davem@davemloft.net; edumazet@google.com; andrew+netd= ev@lunn.ch; donald.hunter@gmail.com; kuniyu@google.com; ij@kernel.org; ncar= dwell@google.com; Koen De Schepper (Nokia) ; g.white@cablelabs.com; ingemar.s.johansson@ericsson.com; mirja.kueh= lewind@ericsson.com; cheshire@apple.com; rs.ietf@gmx.at; Jason_Livingood@co= mcast.com; vidhi_goel@apple.com >> Cc: Chia-Yu Chang (Nokia) >> Subject: [PATCH v4 net-next 1/1] tcp: allow congestion controls to overr= ide TSO autosizing >>=20 >> From: Chia-Yu Chang >>=20 Hi Chia-Yu, Sorry for the late reply. From the BPF side we had a discussion and concluded that going ahead with the original change to the struct_ops without adding a union is fine. AFAIU this is the main delta between v3 and v4, in which case we can go ahead with v3. >> Today, congestion control algorithms influence TSO sizing through the >> min_tso_segs() callback, which provides the minimum number of segments u= sed by tcp_tso_autosize(). However, Prague congestion control requires fine= r control and needs to determine the final TSO segment count directly rathe= r than only providing a minimum bound. >> =20 >> This patch introduces TCP_CONG_EXACT_TSO_SEGS flag and extends tcp_conge= stion_ops with an alternative tso_segs() callback. When the flag is set, th= e congestion control algorithm supplies the final TSO segment count directl= y and bypasses tcp_tso_autosize(). Otherwise, the existing min_tso_segs() c= allback continues to provide the minimum segment count used by tcp_tso_auto= size(). >>=20 >> This preserves the existing behavior of current congestion control algor= ithms without introducing additional callbacks while enabling future algori= thms to implement custom TSO sizing policies. >>=20 >> Signed-off-by: Ilpo J=C3=A4rvinen >> Signed-off-by: Chia-Yu Chang >> --- >> include/net/tcp.h | 16 +++++++++++++--- >> net/ipv4/tcp_output.c | 17 +++++++++++++---- >> 2 files changed, 26 insertions(+), 7 deletions(-) >>=20 >> diff --git a/include/net/tcp.h b/include/net/tcp.h index 2c5b889530b5..8= 2cd82a19ff9 100644 >> --- a/include/net/tcp.h >> +++ b/include/net/tcp.h >> @@ -1283,9 +1283,11 @@ enum tcp_ca_ack_event_flags { >> #define TCP_CONG_ECT_1_NEGOTIATION BIT(3) >> /* Cannot fallback to RFC3168 during AccECN negotiation */ >> #define TCP_CONG_NO_FALLBACK_RFC3168 BIT(4) >> +/* Congestion cotnrol provides the exact TSO segment numbers */ >> +#define TCP_CONG_EXACT_TSO_SEGS BIT(5) >> #define TCP_CONG_MASK (TCP_CONG_NON_RESTRICTED | TCP_CONG_NEEDS_ECN | = \ >> TCP_CONG_NEEDS_ACCECN | TCP_CONG_ECT_1_NEGOTIATION | \ >> - TCP_CONG_NO_FALLBACK_RFC3168) >> + TCP_CONG_NO_FALLBACK_RFC3168 | TCP_CONG_EXACT_TSO_SEGS) >> =20 >> union tcp_cc_info; >> =20 >> @@ -1361,8 +1363,16 @@ struct tcp_congestion_ops { >> /* hook for packet ack accounting (optional) */ >> void (*pkts_acked)(struct sock *sk, const struct ack_sample *sample); >> =20 >> - /* override sysctl_tcp_min_tso_segs (optional) */ >> - u32 (*min_tso_segs)(struct sock *sk); >> + union { >> + /* Used when TCP_CONG_EXACT_TSO_SEGS is not set, >> + * override sysctl_tcp_min_tso_segs (optional) >> + */ >> + u32 (*min_tso_segs)(struct sock *sk); >> + /* Used when TCP_CONG_EXACT_TSO_SEGS is set, >> + * override tcp_tso_autosize (optional) >> + */ >> + u32 (*tso_segs)(struct sock *sk, u32 mss_now); >> + }; >> =20 >> /* new value of cwnd after loss (required) */ >> u32 (*undo_cwnd)(struct sock *sk); >> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index d7c1444= b5e30..0de27a87c39e 100644 >> --- a/net/ipv4/tcp_output.c >> +++ b/net/ipv4/tcp_output.c >> @@ -2278,11 +2278,20 @@ static u32 tcp_tso_segs(struct sock *sk, unsigne= d int mss_now) >> const struct tcp_congestion_ops *ca_ops =3D inet_csk(sk)->icsk_ca_ops; >> u32 min_tso, tso_segs; >> =20 >> - min_tso =3D ca_ops->min_tso_segs ? >> - ca_ops->min_tso_segs(sk) : >> - READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs); >> + min_tso =3D READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs); >> + >> + if (ca_ops->flags & TCP_CONG_EXACT_TSO_SEGS) { >> + if (WARN_ON_ONCE(!ca_ops->tso_segs)) >> + tso_segs =3D tcp_tso_autosize(sk, mss_now, min_tso); >> + else >> + tso_segs =3D ca_ops->tso_segs(sk, mss_now); >> + } else { >> + if (ca_ops->min_tso_segs) >> + min_tso =3D ca_ops->min_tso_segs(sk); >> + >> + tso_segs =3D tcp_tso_autosize(sk, mss_now, min_tso); >> + } >> =20 >> - tso_segs =3D tcp_tso_autosize(sk, mss_now, min_tso); >> return min_t(u32, tso_segs, sk->sk_gso_max_segs); } > > Hello, > > I see this commit is marked as Changes Requested; however, I do not see a= ny request yet. > > Could anyone let me know which specific request it is? > > This commit updated our previously submitted v3 https://lore.kernel.org/a= ll/20260630120145.286497-1-chia-yu.chang@nokia-bell-labs.com/ to have no im= pact on BPF. > > Thanks! > Chia-Yu