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-07-25 11:36:29 +02:00
2021-07-26 22:35:22 +01:00
2021-08-04 09:53:34 +01:00
2021-07-05 11:48:14 -07:00
2021-07-06 20:14:42 -04:00
2021-07-21 12:37:49 -07:00
2021-08-13 06:41:22 -07:00
2021-07-05 11:21:51 -07:00
2021-08-13 06:41:22 -07:00
2021-08-02 11:40:45 +02:00
2021-07-05 14:16:22 -07:00
2021-07-01 16:57:14 -07:00
2021-07-10 09:22:44 -07:00
2021-07-07 11:12:01 -07:00
2021-07-10 09:22:44 -07:00
2021-07-05 13:42:16 -07:00
2021-07-09 09:43:57 -07:00
2021-07-27 16:31:31 +02:00
2021-07-07 13:30:01 -07:00
2021-07-01 07:32:14 +05:30
2021-07-01 11:06:04 -07:00
2021-06-30 12:21:16 -07:00
2021-07-07 20:01:45 -07:00
2021-07-09 12:05:33 -07:00
2021-06-30 15:34:13 -06:00
2021-07-24 12:57:06 -07:00
2021-07-08 11:48:20 -07:00
2021-06-30 20:47:25 -07:00
2021-08-17 00:45:07 +02:00
2021-07-31 09:14:46 -07:00
2021-08-23 17:50:24 -07:00
2021-08-17 00:45:07 +02:00
2021-08-20 00:09:49 +02:00
2021-08-15 00:13:32 -07:00
2021-07-15 22:31:10 +02:00
2021-07-08 11:48:22 -07:00
2021-07-02 15:14:36 -07:00
2021-07-08 11:48:21 -07:00
2021-07-23 14:20:24 +01:00
2021-06-30 14:33:25 -07:00
2021-07-02 12:08:10 -07:00
2021-07-01 11:06:06 -07:00
2021-07-01 11:06:06 -07:00
2021-06-30 14:33:25 -07:00
2021-07-05 12:44:23 +02:00
2021-07-08 11:48:20 -07:00
2021-07-08 11:48:22 -07:00
2021-07-08 11:48:20 -07:00
2021-07-05 14:16:22 -07:00
2021-07-23 14:20:25 +01:00
2021-08-17 00:45:07 +02:00
2021-07-21 06:39:20 -10:00
2021-07-05 13:42:16 -07:00
2021-07-30 18:35:47 +02:00
2021-07-27 20:11:45 +01:00
2021-07-27 20:11:44 +01:00
2021-07-23 17:43:28 -07:00
2021-07-08 11:48:21 -07:00
2021-06-30 20:47:30 -07:00
2021-06-30 20:47:25 -07:00
2021-07-08 11:48:21 -07:00
2021-07-05 14:01:53 -07:00
2021-08-04 12:35:07 +01:00
2021-08-05 11:46:42 +01:00
2021-08-13 06:41:22 -07:00
2021-07-15 20:49:09 +02:00
2021-07-21 08:14:33 -07:00
2021-07-21 08:14:33 -07:00
2021-07-21 08:14:33 -07:00
2021-07-21 08:14:33 -07:00
2021-07-08 08:37:31 -04:00
2021-07-08 11:48:22 -07:00
2021-07-15 10:13:49 -07:00
2021-06-30 20:47:28 -07:00
2021-07-02 12:08:10 -07:00
2021-07-02 12:54:34 -07:00
2021-07-01 11:06:05 -07:00
2021-07-08 11:48:21 -07:00
2021-07-08 11:48:20 -07:00
2021-07-11 10:02:33 -07:00
2021-07-23 17:43:28 -07:00
2021-07-01 17:17:24 -07:00
2021-06-30 20:47:25 -07:00
2021-06-30 20:47:29 -07:00
2021-07-01 11:06:02 -07:00
2021-08-05 15:08:47 -07:00
2021-07-12 11:30:56 -07:00
2021-08-09 15:49:00 -07:00
2021-07-12 11:30:56 -07:00
2021-07-08 11:48:21 -07:00
2021-07-01 11:06:03 -07:00
2021-07-08 11:48:22 -07:00
2021-07-01 11:06:05 -07:00
2021-08-13 14:09:19 -07:00
2021-07-08 14:03:26 -04:00
2021-07-08 11:48:20 -07:00
2021-07-05 13:42:16 -07:00
2021-08-08 13:00:20 +01:00
2021-07-02 12:08:10 -07:00
2021-07-01 11:06:04 -07:00
2021-07-01 11:06:04 -07:00
2021-07-06 10:37:46 -05:00
2021-07-06 10:37:46 -05:00
2021-07-06 10:37:46 -05:00
2021-07-06 10:37:46 -05:00
2021-07-08 12:06:20 -07:00
2021-07-08 11:48:21 -07:00
2021-07-08 11:48:20 -07:00
2021-08-17 00:45:07 +02:00
2021-07-21 11:28:09 +01:00
2021-07-20 06:55:20 -07:00
2021-06-30 15:51:09 -07:00
2021-07-01 13:08:18 -07:00
2021-07-15 10:13:49 -07:00
2021-07-08 11:48:20 -07:00
2021-07-16 21:15:28 +02:00
2021-07-13 11:39:42 +01:00
2021-07-13 11:39:48 +01:00
2021-07-08 11:48:21 -07:00
2021-08-10 10:10:10 +02:00
2021-07-01 11:06:05 -07:00
2021-07-21 12:53:26 +02:00
2021-07-08 11:48:20 -07:00
2021-07-02 12:08:10 -07:00
2021-07-08 11:48:21 -07:00
2021-07-01 11:06:06 -07:00
2021-08-09 15:49:00 -07:00
2021-07-27 14:55:30 -07:00
2021-07-29 15:06:49 +01:00
2021-07-05 10:16:17 -07:00
2021-07-01 11:06:05 -07:00
2021-07-01 11:06:05 -07:00
2021-07-01 11:06:03 -07:00
2021-07-01 11:06:03 -07:00
2021-07-08 11:48:21 -07:00
2021-07-21 07:55:50 +02:00
2021-07-01 11:06:04 -07:00
2021-08-17 00:45:07 +02:00
2021-07-07 20:01:45 -07:00
2021-06-30 20:47:27 -07:00
2021-07-08 07:49:01 -04:00
2021-07-08 07:49:01 -04:00
2021-07-08 11:48:21 -07:00