RE: [PATCH net-next v6] tcp: add BPF kfuncs to set per-socket ECN mode and AccECN option

From: Irlanki Sandeep

Date: Wed Oct 14 2026 - 03:59:55 EST


On Wed, 7 Oct 2026 17:00:28 -0700, Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
> On Thu, 1 Oct 2026 18:57:59 +0530 Irlanki Sandeep wrote:
> > Suggested-by: Jakub Kicinski <kuba@xxxxxxxxxx>
>
> This needs an ACK from TCP maintainers. If you respin please make sure
> to drop this tag, this tag is for cases where someone suggested sending
> the patch as a whole. Not for changes requested during normal course of
> review.

Understood, thanks for clarifying the tag semantics. I will drop the
Suggested-by tag in v7 if a respin is needed.

> There was a false positive from sparse regarding the use of kfunc,
> I kicked off the AI review manually, please check the results here
> in an hour or so:
>
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261001132759.1076145-1
-irlanki.s@xxxxxxxxxxx

Thanks for triggering the manual AI review. The results show 0 Critical,
0 High, 1 Medium, and 1 Low:

1. [Medium] SYN arrival race before LISTEN_CB completes:
The review identifies that inet_csk_listen_start() hashes the socket
before tcp_call_bpf(BPF_SOCK_OPS_TCP_LISTEN_CB) runs. A SYN arriving on
another CPU in this window will see ecn_mode as UNSPEC and fall back to
the sysctl. This is a preexisting limitation affecting any
BPF_SOCK_OPS_TCP_LISTEN_CB program that configures listener behavior,
not specific to this patch. I will document this fallback behavior in
the kernel-doc and commit message for v7.

2. [Low] Selftest scope (API validation vs. packet inspection):
The selftest validates the kfunc API layer: argument validation, return
codes, verifier safety (sk_is_tcp() guard), and struct field
mutation/inheritance. It does not include packet-level inspection. This
is comparable in scope to progs/setget_sockopt.c, which similarly tests
bpf_setsockopt/bpf_getsockopt round-trips without packet-level wire
verification.

Awaiting feedback from Eric and the TCP maintainers.

Thanks,
Sandeep