Netdev List
 help / color / mirror / Atom feed
From: "Emil Tsalapatis" <emil@etsalapatis.com>
To: "Chia-Yu Chang (Nokia)" <chia-yu.chang@nokia-bell-labs.com>,
	"horms@kernel.org" <horms@kernel.org>,
	"dsahern@kernel.org" <dsahern@kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"jhs@mojatatu.com" <jhs@mojatatu.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"donald.hunter@gmail.com" <donald.hunter@gmail.com>,
	"kuniyu@google.com" <kuniyu@google.com>,
	"ij@kernel.org" <ij@kernel.org>,
	"ncardwell@google.com" <ncardwell@google.com>,
	"Koen De Schepper (Nokia)" <koen.de_schepper@nokia-bell-labs.com>,
	"g.white@cablelabs.com" <g.white@cablelabs.com>,
	"ingemar.s.johansson@ericsson.com"
	<ingemar.s.johansson@ericsson.com>,
	"mirja.kuehlewind@ericsson.com" <mirja.kuehlewind@ericsson.com>,
	"cheshire@apple.com" <cheshire@apple.com>,
	"rs.ietf@gmx.at" <rs.ietf@gmx.at>,
	"Jason_Livingood@comcast.com" <Jason_Livingood@comcast.com>,
	"vidhi_goel@apple.com" <vidhi_goel@apple.com>
Subject: Re: [PATCH v4 net-next 1/1] tcp: allow congestion controls to override TSO autosizing
Date: Mon, 27 Jul 2026 19:19:51 -0400	[thread overview]
Message-ID: <DK9QLHKY1WSN.24XILC0RTLJZM@etsalapatis.com> (raw)
In-Reply-To: <PAXPR07MB79842FC5D44F3964BFEDA505A3CC2@PAXPR07MB7984.eurprd07.prod.outlook.com>

On Mon Jul 27, 2026 at 4:02 AM EDT, Chia-Yu Chang (Nokia) wrote:
>> -----Original Message-----
>> From: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com> 
>> Sent: Sunday, July 26, 2026 9:38 PM
>> To: 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) <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
>> Cc: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>
>> Subject: [PATCH v4 net-next 1/1] tcp: allow congestion controls to override TSO autosizing
>> 
>> From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
>> 

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 used by tcp_tso_autosize(). However, Prague congestion control requires finer control and needs to determine the final TSO segment count directly rather than only providing a minimum bound.
>>  
>> This patch introduces TCP_CONG_EXACT_TSO_SEGS flag and extends tcp_congestion_ops with an alternative tso_segs() callback. When the flag is set, the congestion control algorithm supplies the final TSO segment count directly and bypasses tcp_tso_autosize(). Otherwise, the existing min_tso_segs() callback continues to provide the minimum segment count used by tcp_tso_autosize().
>> 
>> This preserves the existing behavior of current congestion control algorithms without introducing additional callbacks while enabling future algorithms to implement custom TSO sizing policies.
>> 
>> Signed-off-by: Ilpo Järvinen <ij@kernel.org>
>> Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
>> ---
>>  include/net/tcp.h     | 16 +++++++++++++---
>>  net/ipv4/tcp_output.c | 17 +++++++++++++----
>>  2 files changed, 26 insertions(+), 7 deletions(-)
>> 
>> diff --git a/include/net/tcp.h b/include/net/tcp.h index 2c5b889530b5..82cd82a19ff9 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)
>>  
>>  union tcp_cc_info;
>>  
>> @@ -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);
>>  
>> -	/* 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);
>> +	};
>>  
>>  	/* 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 d7c1444b5e30..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, unsigned int mss_now)
>>  	const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;
>>  	u32 min_tso, tso_segs;
>>  
>> -	min_tso = ca_ops->min_tso_segs ?
>> -			ca_ops->min_tso_segs(sk) :
>> -			READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs);
>> +	min_tso = 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 = tcp_tso_autosize(sk, mss_now, min_tso);
>> +		else
>> +			tso_segs = ca_ops->tso_segs(sk, mss_now);
>> +	} else {
>> +		if (ca_ops->min_tso_segs)
>> +			min_tso = ca_ops->min_tso_segs(sk);
>> +
>> +		tso_segs = tcp_tso_autosize(sk, mss_now, min_tso);
>> +	}
>>  
>> -	tso_segs = 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 any request yet.
>
> Could anyone let me know which specific request it is?
>
> This commit updated our previously submitted v3 https://lore.kernel.org/all/20260630120145.286497-1-chia-yu.chang@nokia-bell-labs.com/ to have no impact on BPF.

>
> Thanks!
> Chia-Yu


      parent reply	other threads:[~2026-07-27 23:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-26 19:38 [PATCH v4 net-next 1/1] tcp: allow congestion controls to override TSO autosizing chia-yu.chang
2026-07-27  8:02 ` Chia-Yu Chang (Nokia)
2026-07-27 23:08   ` Jakub Kicinski
2026-07-27 23:19   ` Emil Tsalapatis [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=DK9QLHKY1WSN.24XILC0RTLJZM@etsalapatis.com \
    --to=emil@etsalapatis.com \
    --cc=Jason_Livingood@comcast.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bpf@vger.kernel.org \
    --cc=cheshire@apple.com \
    --cc=chia-yu.chang@nokia-bell-labs.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=g.white@cablelabs.com \
    --cc=horms@kernel.org \
    --cc=ij@kernel.org \
    --cc=ingemar.s.johansson@ericsson.com \
    --cc=jhs@mojatatu.com \
    --cc=koen.de_schepper@nokia-bell-labs.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=mirja.kuehlewind@ericsson.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rs.ietf@gmx.at \
    --cc=stephen@networkplumber.org \
    --cc=vidhi_goel@apple.com \
    /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