bpf: Update the struct_ops of a bpf_link.
authorKui-Feng Lee <kuifeng@meta.com>
Thu, 23 Mar 2023 03:24:02 +0000 (20:24 -0700)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 23 Mar 2023 05:53:02 +0000 (22:53 -0700)
commitaef56f2e918bf8fc8de25f0b36e8c2aba44116ec
tree38d252f9d4fa8ef28ccf18e642bb3741d658fb92
parent8d1608d70927747da9c1a8770edf7b6ee68f8ebc
bpf: Update the struct_ops of a bpf_link.

By improving the BPF_LINK_UPDATE command of bpf(), it should allow you
to conveniently switch between different struct_ops on a single
bpf_link. This would enable smoother transitions from one struct_ops
to another.

The struct_ops maps passing along with BPF_LINK_UPDATE should have the
BPF_F_LINK flag.

Signed-off-by: Kui-Feng Lee <kuifeng@meta.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230323032405.3735486-6-kuifeng@meta.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/bpf/bpf_struct_ops.c
kernel/bpf/syscall.c
net/ipv4/bpf_tcp_ca.c
tools/include/uapi/linux/bpf.h