From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: <chia-yu.chang@nokia-bell-labs.com>, <jolsa@kernel.org>,
<yonghong.song@linux.dev>, <song@kernel.org>,
<linux-kselftest@vger.kernel.org>, <memxor@gmail.com>,
<shuah@kernel.org>, <martin.lau@linux.dev>, <ast@kernel.org>,
<daniel@iogearbox.net>, <andrii@kernel.org>, <eddyz87@gmail.com>,
<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-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>
Subject: Re: [PATCH v3 net-next 1/1] tcp: Replace min_tso_segs() with tso_segs() CC callback
Date: Tue, 30 Jun 2026 16:20:50 -0700 [thread overview]
Message-ID: <DJMRPJEUTY5G.30HYOMPLBGZOJ@gmail.com> (raw)
In-Reply-To: <20260630120145.286497-1-chia-yu.chang@nokia-bell-labs.com>
On Tue Jun 30, 2026 at 5:01 AM PDT, chia-yu.chang wrote:
> From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
>
> 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 <ij@kernel.org>
> Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> ---
> 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.
next prev parent reply other threads:[~2026-06-30 23:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 12:01 [PATCH v3 net-next 1/1] tcp: Replace min_tso_segs() with tso_segs() CC callback chia-yu.chang
2026-06-30 23:20 ` Alexei Starovoitov [this message]
2026-07-01 5:46 ` Chia-Yu Chang (Nokia)
2026-07-01 5:56 ` Alexei Starovoitov
2026-07-01 16:16 ` Koen De Schepper (Nokia)
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=DJMRPJEUTY5G.30HYOMPLBGZOJ@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=Jason_Livingood@comcast.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=cheshire@apple.com \
--cc=chia-yu.chang@nokia-bell-labs.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=eddyz87@gmail.com \
--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=jolsa@kernel.org \
--cc=koen.de_schepper@nokia-bell-labs.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.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=shuah@kernel.org \
--cc=song@kernel.org \
--cc=stephen@networkplumber.org \
--cc=vidhi_goel@apple.com \
--cc=yonghong.song@linux.dev \
/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