diff options
author | Alexei Starovoitov <ast@fb.com> | 2017-10-03 01:50:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-04 19:05:05 -0400 |
commit | 468e2f64d220fe2dc11caa2bcb9b3a1e50fc7321 (patch) | |
tree | da21e580b4a534f6feab72ba479b6d3e0ad951f1 /include/uapi/linux/bpf.h | |
parent | 324bda9e6c5add86ba2e1066476481c48132aca0 (diff) |
bpf: introduce BPF_PROG_QUERY command
introduce BPF_PROG_QUERY command to retrieve a set of either
attached programs to given cgroup or a set of effective programs
that will execute for events within a cgroup
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
for cgroup bits
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r-- | include/uapi/linux/bpf.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 762f74bc6c47..cb2b9f95160a 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h | |||
@@ -92,6 +92,7 @@ enum bpf_cmd { | |||
92 | BPF_PROG_GET_FD_BY_ID, | 92 | BPF_PROG_GET_FD_BY_ID, |
93 | BPF_MAP_GET_FD_BY_ID, | 93 | BPF_MAP_GET_FD_BY_ID, |
94 | BPF_OBJ_GET_INFO_BY_FD, | 94 | BPF_OBJ_GET_INFO_BY_FD, |
95 | BPF_PROG_QUERY, | ||
95 | }; | 96 | }; |
96 | 97 | ||
97 | enum bpf_map_type { | 98 | enum bpf_map_type { |
@@ -211,6 +212,9 @@ enum bpf_attach_type { | |||
211 | /* Specify numa node during map creation */ | 212 | /* Specify numa node during map creation */ |
212 | #define BPF_F_NUMA_NODE (1U << 2) | 213 | #define BPF_F_NUMA_NODE (1U << 2) |
213 | 214 | ||
215 | /* flags for BPF_PROG_QUERY */ | ||
216 | #define BPF_F_QUERY_EFFECTIVE (1U << 0) | ||
217 | |||
214 | #define BPF_OBJ_NAME_LEN 16U | 218 | #define BPF_OBJ_NAME_LEN 16U |
215 | 219 | ||
216 | union bpf_attr { | 220 | union bpf_attr { |
@@ -289,6 +293,15 @@ union bpf_attr { | |||
289 | __u32 info_len; | 293 | __u32 info_len; |
290 | __aligned_u64 info; | 294 | __aligned_u64 info; |
291 | } info; | 295 | } info; |
296 | |||
297 | struct { /* anonymous struct used by BPF_PROG_QUERY command */ | ||
298 | __u32 target_fd; /* container object to query */ | ||
299 | __u32 attach_type; | ||
300 | __u32 query_flags; | ||
301 | __u32 attach_flags; | ||
302 | __aligned_u64 prog_ids; | ||
303 | __u32 prog_cnt; | ||
304 | } query; | ||
292 | } __attribute__((aligned(8))); | 305 | } __attribute__((aligned(8))); |
293 | 306 | ||
294 | /* BPF helper function descriptions: | 307 | /* BPF helper function descriptions: |