bpf, net: switch to dynamic registration
authorKui-Feng Lee <thinker.li@gmail.com>
Fri, 19 Jan 2024 22:50:02 +0000 (14:50 -0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Wed, 24 Jan 2024 01:12:46 +0000 (17:12 -0800)
commitf6be98d19985411ca1f3d53413d94d5b7f41c200
tree42992e3ac7a76fbb27a46dabeb2bf93ca7dc6f61
parent612d087d4ba54cef47946e22e5dabad762dd7ed5
bpf, net: switch to dynamic registration

Replace the static list of struct_ops types with per-btf struct_ops_tab to
enable dynamic registration.

Both bpf_dummy_ops and bpf_tcp_ca now utilize the registration function
instead of being listed in bpf_struct_ops_types.h.

Cc: netdev@vger.kernel.org
Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Link: https://lore.kernel.org/r/20240119225005.668602-12-thinker.li@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
include/linux/bpf.h
include/linux/btf.h
kernel/bpf/bpf_struct_ops.c
kernel/bpf/bpf_struct_ops_types.h [deleted file]
kernel/bpf/btf.c
net/bpf/bpf_dummy_struct_ops.c
net/ipv4/bpf_tcp_ca.c