On Fri, Dec 04, 2026 at 01:01 AM Paul Moses <…@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