bpf: extend cgroup bpf core to allow multiple cgroup storage types
In order to introduce per-cpu cgroup storage, let's generalize bpf cgroup core to support multiple cgroup storage types. Potentially, per-node cgroup storage can be added later. This commit is mostly a formal change that replaces cgroup_storage pointer with a array of cgroup_storage pointers. It doesn't actually introduce a new storage type, it will be done later. Each bpf program is now able to have one cgroup storage of each type. Signed-off-by:Roman Gushchin <guro@fb.com> Acked-by:
Song Liu <songliubraving@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Alexei Starovoitov <ast@kernel.org> Signed-off-by:
Daniel Borkmann <daniel@iogearbox.net>
Showing
- include/linux/bpf-cgroup.h 28 additions, 10 deletionsinclude/linux/bpf-cgroup.h
- include/linux/bpf.h 9 additions, 2 deletionsinclude/linux/bpf.h
- kernel/bpf/cgroup.c 52 additions, 22 deletionskernel/bpf/cgroup.c
- kernel/bpf/helpers.c 9 additions, 6 deletionskernel/bpf/helpers.c
- kernel/bpf/local_storage.c 11 additions, 7 deletionskernel/bpf/local_storage.c
- kernel/bpf/syscall.c 7 additions, 2 deletionskernel/bpf/syscall.c
- kernel/bpf/verifier.c 6 additions, 2 deletionskernel/bpf/verifier.c
- net/bpf/test_run.c 14 additions, 6 deletionsnet/bpf/test_run.c
Loading
Please register or sign in to comment