> -----Original Message-----
> From: Alexei Starovoitov <[email protected]> 
> Sent: Wednesday, July 1, 2026 1:21 AM
> To: Chia-Yu Chang (Nokia) <[email protected]>; 
> [email protected]; [email protected]; [email protected]; 
> [email protected]; [email protected]; [email protected]; 
> [email protected]; [email protected]; [email protected]; 
> [email protected]; [email protected]; [email protected]; [email protected]; 
> [email protected]; [email protected]; [email protected]; 
> [email protected]; [email protected]; [email protected]; 
> [email protected]; [email protected]; [email protected]; 
> [email protected]; [email protected]; [email protected]; 
> [email protected]; Koen De Schepper (Nokia) 
> <[email protected]>; [email protected]; 
> [email protected]; [email protected]; 
> [email protected]; [email protected]; [email protected]; 
> [email protected]
> Subject: Re: [PATCH v3 net-next 1/1] tcp: Replace min_tso_segs() with 
> tso_segs() CC callback
> 
> [You don't often get email from [email protected]. Learn why this 
> is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> CAUTION: This is an external email. Please be very careful when clicking 
> links or opening attachments. See the URL nok.it/ext for additional 
> information.
> 
> 
> 
> On Tue Jun 30, 2026 at 5:01 AM PDT, chia-yu.chang wrote:
> > From: Chia-Yu Chang <[email protected]>
> >
> > This patch replaces existing min_tso_segs() with tso_segs() CC callbak 
> > for CC algorithm to provides explicit tso segment number of each data 
> > burst and overrides tcp_tso_autosize().
> >
> > This change provides below impacts on BPF struct_ops users:
> > - The callback is renamed from min_tso_segs to tso_segs
> > - The signature gains an extra u32 mss_now argument
> > - The return value semantics is changed from "floor value passed into
> >   tcp_tso_autosize()" to "final tso_segs value", bypassing autosizing
> >
> > As a result, BPF programs shall be updated, beccause retuning a small 
> > constans will now directly limit tso_segs instead of the minimum.
> >
> > Signed-off-by: Ilpo Järvinen <[email protected]>
> > Signed-off-by: Chia-Yu Chang <[email protected]>
> > ---
> >  include/net/tcp.h                                | 13 +++++++++++--
> >  net/ipv4/bpf_tcp_ca.c                            |  8 +++++---
> >  net/ipv4/tcp_bbr.c                               | 13 ++++++++++---
> >  net/ipv4/tcp_output.c                            | 13 +++++++------
> >  tools/testing/selftests/bpf/progs/tcp_ca_kfunc.c |  8 ++++----
> >  5 files changed, 37 insertions(+), 18 deletions(-)
> >
> > diff --git a/include/net/tcp.h b/include/net/tcp.h index 
> > 6d376ea4d1c0..7fb42a0ce7da 100644
> > --- a/include/net/tcp.h
> > +++ b/include/net/tcp.h
> > @@ -824,6 +824,9 @@ unsigned int tcp_sync_mss(struct sock *sk, u32 
> > pmtu);  unsigned int tcp_current_mss(struct sock *sk);
> >  u32 tcp_clamp_probe0_to_user_timeout(const struct sock *sk, u32 
> > when);
> >
> > +u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now,
> > +                  int min_tso_segs);
> > +
> >  /* Bound MSS / TSO packet size with the half of the window */  static 
> > inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)  { 
> > @@ -1361,8 +1364,14 @@ 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);
> > +     /*
> > +      * Override tcp_tso_autosize (optional)
> > +      *
> > +      * If provided, this callback returns the final TSO segment number
> > +      * and will bypass tcp_tso_autosize() entirely. The implementation
> > +      * must derive an appropriate value and ensure the result is valid.
> > +      */
> > +     u32 (*tso_segs)(struct sock *sk, u32 mss_now);
> 
> I don't like this interface change.
> It introduces churn for no good reason.
> At least I don't see why you cannot live with the existing api.

Hi Alexei,

This patch was part of TCP Prague preparation series: 
https://lore.kernel.org/all/[email protected]/
Our original patch is to add an extra tso_segs, and after discussion it's 
recommended to replace exisiting min_tso_segs.

This is needed because TCP Prague would set the exact TSO size rather than 
using autosizing from TCP.
The TCP Prague itself is planned to be submitted after all preparation commits 
are accepted.
You can find its current stauts: 
https://github.com/L4STeam/linux-net-next/blob/upstream_l4steam/net/ipv4/tcp_prague.c

Thanks.
Chia-Yu

Reply via email to