Netdev List
 help / color / mirror / Atom feed
From: Fred Li <dracodingfly@gmail.com>
To: netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: Fred Li <dracodingfly@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: bpf: tcp_cubic/bbr/dctcp: congestion control not registered when BTF kfunc registration fails
Date: Fri,  4 Dec 2026 14:36:55 +0800	[thread overview]
Message-ID: <20261204063707.52702-1-dracodingfly@gmail.com> (raw)

On a 6.6 kernel (x86_64), the built-in CUBIC, BBR and DCTCP congestion
control algorithms are silently not registered when
register_btf_kfunc_id_set() fails, leaving only reno available, even with
CONFIG_TCP_CONG_CUBIC=y and CONFIG_DEFAULT_TCP_CONG="cubic".

The registration path in cubictcp_register() is:


ret = register_btf_kfunc_id_set(BPF_PROG_TYPE_STRUCT_OPS,
				&tcp_cubic_kfunc_set);
if (ret < 0)
	return ret;
return tcp_register_congestion_control(&cubictcp);

In practice, the failure was register_btf_kfunc_id_set() returning
-EINVAL because the static __bpf_kfunc functions were missing from the
vmlinux BTF generated by pahole v1.17.

Before b202d8442222 ("bpf: Remove check_kfunc_call callback and old kfunc
BTF ID API", v5.17), the congestion control was registered first and the
kfunc set afterwards; that commit reversed the order and made a kfunc
registration failure fatal to the congestion control registration.

Should register_btf_kfunc_id_set() failure really be fatal here? 
Would it make sense to just warn and continue, so the congestion
control still registers? Any guidance would be appreciated.

Fred Li

                 reply	other threads:[~2026-12-04  6:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261204063707.52702-1-dracodingfly@gmail.com \
    --to=dracodingfly@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.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