Netdev List
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Paul Moses" <p@1g4.org>, <bpf@vger.kernel.org>
Cc: <netdev@vger.kernel.org>, <daniel@iogearbox.net>,
	<martin.lau@linux.dev>, <edumazet@kernel.org>,
	<ncardwell@google.com>, <kuniyu@google.com>,
	<jiayuan.chen@linux.dev>
Subject: Re: [PATCH bpf v2 0/3] tcp, bpf: fix CA state on open and the TCP_CONGESTION name check
Date: Fri, 04 Dec 2026 21:04:55 +0000	[thread overview]
Message-ID: <DNC9500T7CFW.33DZ9BCBYWA12@gmail.com> (raw)
In-Reply-To: <cover.1796374535.git.p@1g4.org>

On Fri, Dec 04, 2026 at 01:01 AM Paul Moses <p@1g4.org> wrote:
> Patches 1 and 2 fix the cases Alexei reported [1]: stale CA state
> when a route changes the algorithm or a child inherits the listener's
> private state. Patch 3 uses the same name for the CDG check and lookup.

tcp fixes go via net tree.
Patch 1 fixes a tcp bug. bpf is not needed to hit it.
Use setsockopt("vegas") instead of bpf_cc in the sequence from [1].
tcp_vegas_init() sets minRTT and baseRTT to 0x7fffffff.
They are at offsets 16 and 20 of icsk_ca_priv.
cdg keeps ca->gradients there.
tcp_init_transfer() skips tcp_cdg_init(), so tcp_cdg_grad() and
tcp_cdg_release() see ca->gradients == 0x7fffffff7fffffff.

> Patch 2 needs Jiayuan's fix [2] so the clone hook runs after the
> child's CA state is cleared.

It doesn't.
Without [2] the lsm prog can init a cc on the child before
tcp_ca_openreq_child() runs.
The reset drops that state without ->release().
cdg is the only in-tree cc with ->release(), and bpf_setsockopt()
refuses cdg. So there is nothing to free.
A bpf cc gets ->init() twice. That's all.
Patches 1 and 2 don't depend on [2]. The backports don't either.

> I left the callback issue [3] out after reading more historical context.

In [3] you asked whether bpf_setsockopt(TCP_CONGESTION) can be limited
to .init.
No. It doesn't help.
.init of a bpf cc can write icsk_ca_priv after bpf_setsockopt() returns.

Pls resend patches 1 and 2 as [PATCH net].
Pls resend patch 3 alone as [PATCH bpf v3]. It doesn't depend on them.

pw-bot: cr

  parent reply	other threads:[~2026-12-04 21:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  9:01 [PATCH bpf v2 0/3] tcp, bpf: fix CA state on open and the TCP_CONGESTION name check Paul Moses
2026-12-04  9:01 ` [PATCH bpf v2 1/3] tcp: reset congestion-control state when the route selects a new CA Paul Moses
2026-12-04  9:01 ` [PATCH bpf v2 2/3] tcp: clear inherited congestion-control state for a cloned child Paul Moses
2026-12-04  9:01 ` [PATCH bpf v2 3/3] bpf: check and set TCP congestion control from the same name Paul Moses
2026-12-04 21:04 ` Alexei Starovoitov [this message]
2026-12-04 21:26   ` [PATCH bpf v2 0/3] tcp, bpf: fix CA state on open and the TCP_CONGESTION name check Paul Moses

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=DNC9500T7CFW.33DZ9BCBYWA12@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=edumazet@kernel.org \
    --cc=jiayuan.chen@linux.dev \
    --cc=kuniyu@google.com \
    --cc=martin.lau@linux.dev \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=p@1g4.org \
    /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