Re: [PATCH bpf-next v8] bpf: tcp: add ecn_init callback to bpf_tcp_ops for per-connection ECN

From: bot+bpf-ci

Date: Mon Nov 16 2026 - 09:28:53 EST


> bpf: tcp: add ecn_init callback to bpf_tcp_ops for per-connection ECN

TL;DR: Nit only: a comment in bpf_tcp_ops_get_retval() still lists
timeout_init/rwnd_init as the only bpf_get_retval() users, but ecn_init now
uses it too; the code is fine.

> diff --git a/net/ipv4/bpf_tcp_ops.c b/net/ipv4/bpf_tcp_ops.c
> --- a/net/ipv4/bpf_tcp_ops.c
> +++ b/net/ipv4/bpf_tcp_ops.c

[ ... ]

> @@ -258,7 +267,8 @@ get_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
> return NULL;
> case BPF_FUNC_get_retval:
> if (moff == offsetof(struct bpf_tcp_ops, timeout_init) ||
> - moff == offsetof(struct bpf_tcp_ops, rwnd_init))
> + moff == offsetof(struct bpf_tcp_ops, rwnd_init) ||
> + moff == offsetof(struct bpf_tcp_ops, ecn_init))
> return &bpf_tcp_ops_get_retval_proto;
> return NULL;

This isn't a bug, but bpf_get_retval() is now also exposed to ecn_init,
while the comment in bpf_tcp_ops_get_retval() still reads:

/* bpf_get_retval() is only exposed to timeout_init/rwnd_init, which
* always run via bpf_tcp_ops_call_int(). ...
*/
if (WARN_ON_ONCE(!ctx->saved_run_ctx))

The invariant still holds, since ecn_init is only invoked through
tcp_ecn_init_bpf() -> bpf_tcp_ops_call_int(), but the comment now lists
an incomplete set of members.

Could it name ecn_init as well, or say "the int-returning *_init
members"?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/43881864185