summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorMartin KaFai Lau2018-05-04 23:49:52 +0200
committerDaniel Borkmann2018-05-09 17:25:13 +0200
commit62dab84c81a487d946a5fc37c6df541dd95cca38 (patch)
treebcfa804c58e189bf89226ed0c7afa1e23dfeb24c /include/uapi/linux/bpf.h
parentbpf: btf: Introduce BTF ID (diff)
downloadkernel-qcow2-linux-62dab84c81a487d946a5fc37c6df541dd95cca38.tar.gz
kernel-qcow2-linux-62dab84c81a487d946a5fc37c6df541dd95cca38.tar.xz
kernel-qcow2-linux-62dab84c81a487d946a5fc37c6df541dd95cca38.zip
bpf: btf: Add struct bpf_btf_info
During BPF_OBJ_GET_INFO_BY_FD on a btf_fd, the current bpf_attr's info.info is directly filled with the BTF binary data. It is not extensible. In this case, we want to add BTF ID. This patch adds "struct bpf_btf_info" which has the BTF ID as one of its member. The BTF binary data itself is exposed through the "btf" and "btf_size" members. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Alexei Starovoitov <ast@fb.com> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 6106f23a9a8a..d615c777b573 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -2137,6 +2137,12 @@ struct bpf_map_info {
__u32 btf_value_id;
} __attribute__((aligned(8)));
+struct bpf_btf_info {
+ __aligned_u64 btf;
+ __u32 btf_size;
+ __u32 id;
+} __attribute__((aligned(8)));
+
/* User bpf_sock_addr struct to access socket fields and sockaddr struct passed
* by user and intended to be used by socket (e.g. to bind to, depends on
* attach attach type).