Files
kernel_arpi/include/uapi/linux
Dave Marchevsky 6fc88c354f bpf: Migrate cgroup_bpf to internal cgroup_bpf_attach_type enum
Add an enum (cgroup_bpf_attach_type) containing only valid cgroup_bpf
attach types and a function to map bpf_attach_type values to the new
enum. Inspired by netns_bpf_attach_type.

Then, migrate cgroup_bpf to use cgroup_bpf_attach_type wherever
possible.  Functionality is unchanged as attach_type_to_prog_type
switches in bpf/syscall.c were preventing non-cgroup programs from
making use of the invalid cgroup_bpf array slots.

As a result struct cgroup_bpf uses 504 fewer bytes relative to when its
arrays were sized using MAX_BPF_ATTACH_TYPE.

bpf_cgroup_storage is notably not migrated as struct
bpf_cgroup_storage_key is part of uapi and contains a bpf_attach_type
member which is not meant to be opaque. Similarly, bpf_cgroup_link
continues to report its bpf_attach_type member to userspace via fdinfo
and bpf_link_info.

To ease disambiguation, bpf_attach_type variables are renamed from
'type' to 'atype' when changed to cgroup_bpf_attach_type.

Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210819092420.1984861-2-davemarchevsky@fb.com
2021-08-23 17:50:24 -07:00
..
2021-01-25 18:44:44 +01:00
2020-12-28 14:21:31 +00:00
2021-02-09 10:58:19 +01:00
2021-06-10 20:59:05 -04:00
2020-10-09 12:47:02 -06:00
2021-03-04 17:58:15 -08:00
2021-06-22 14:11:57 +02:00
2021-06-22 14:11:57 +02:00
2021-02-08 13:01:24 +01:00
2021-06-03 15:31:34 -07:00
2021-08-03 11:50:22 +01:00
2021-02-26 09:41:03 -08:00
2021-05-21 15:03:50 +02:00
2021-03-10 09:34:06 +01:00
2021-07-29 15:06:50 +01:00
2021-06-18 11:40:11 -07:00
2021-07-06 10:37:46 -05:00
2021-01-16 23:19:26 +01:00
2021-03-10 09:34:06 +01:00
2021-06-23 12:56:08 -07:00
2021-01-07 16:17:32 +01:00
2020-10-23 11:55:28 -04:00
2020-10-23 11:55:28 -04:00
2021-06-12 13:16:45 -07:00