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
bpf: tcp_cubic/bbr/dctcp: congestion control not registered when BTF kfunc registration fails
- From
- drac…@gmail.com (Fred Li)
- Organization
- Usenet Network
- Message-ID
- <2026…@gmail.com>
- Date
- Newsgroups
- linux.kernel.netdev