]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add BPF_OBJ_GET_INFO_BY_FD
authorMartin KaFai Lau <kafai@fb.com>
Mon, 5 Jun 2017 19:15:52 +0000 (12:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Jun 2017 19:41:24 +0000 (15:41 -0400)
commitc505b02fc23da7540da8ca104e7026786ede311d
tree3735f2cde89f735aa3a5458e67f99df18475749f
parent63c3afd2234d60b691779c611dc6178bf3fc27cb
bpf: Add BPF_OBJ_GET_INFO_BY_FD

A single BPF_OBJ_GET_INFO_BY_FD cmd is used to obtain the info
for both bpf_prog and bpf_map.  The kernel can figure out the
fd is associated with a bpf_prog or bpf_map.

The suggested struct bpf_prog_info and struct bpf_map_info are
not meant to be a complete list and it is not the goal of this patch.
New fields can be added in the future patch.

The focus of this patch is to create the interface,
BPF_OBJ_GET_INFO_BY_FD cmd for exposing the bpf_prog's and
bpf_map's info.

The obj's info, which will be extended (and get bigger) over time, is
separated from the bpf_attr to avoid bloating the bpf_attr.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Alexei Starovoitov <ast@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/filter.h
include/uapi/linux/bpf.h
kernel/bpf/syscall.c