Commit 9819f5e8 authored by yonghong-song's avatar yonghong-song Committed by GitHub

sync compat headers with latest bpf-next (#2053)

Sync compat/linux/{bpf.h, bpf_common.h, virtual_bpf.h}
with latest bpf-next. The change in bpf_common.h are comments only.
Signed-off-by: default avatarYonghong Song <yhs@fb.com>
parent 7813f8e9
...@@ -257,9 +257,6 @@ enum bpf_attach_type { ...@@ -257,9 +257,6 @@ enum bpf_attach_type {
/* Specify numa node during map creation */ /* Specify numa node during map creation */
#define BPF_F_NUMA_NODE (1U << 2) #define BPF_F_NUMA_NODE (1U << 2)
/* flags for BPF_PROG_QUERY */
#define BPF_F_QUERY_EFFECTIVE (1U << 0)
#define BPF_OBJ_NAME_LEN 16U #define BPF_OBJ_NAME_LEN 16U
/* Flags for accessing BPF object */ /* Flags for accessing BPF object */
...@@ -269,6 +266,12 @@ enum bpf_attach_type { ...@@ -269,6 +266,12 @@ enum bpf_attach_type {
/* Flag for stack_map, store build_id+offset instead of pointer */ /* Flag for stack_map, store build_id+offset instead of pointer */
#define BPF_F_STACK_BUILD_ID (1U << 5) #define BPF_F_STACK_BUILD_ID (1U << 5)
/* Zero-initialize hash function seed. This should only be used for testing. */
#define BPF_F_ZERO_SEED (1U << 6)
/* flags for BPF_PROG_QUERY */
#define BPF_F_QUERY_EFFECTIVE (1U << 0)
enum bpf_stack_build_id_status { enum bpf_stack_build_id_status {
/* user space need an empty entry to identify end of a trace */ /* user space need an empty entry to identify end of a trace */
BPF_STACK_BUILD_ID_EMPTY = 0, BPF_STACK_BUILD_ID_EMPTY = 0,
...@@ -335,6 +338,10 @@ union bpf_attr { ...@@ -335,6 +338,10 @@ union bpf_attr {
* (context accesses, allowed helpers, etc). * (context accesses, allowed helpers, etc).
*/ */
__u32 expected_attach_type; __u32 expected_attach_type;
__u32 prog_btf_fd; /* fd pointing to BTF type data */
__u32 func_info_rec_size; /* userspace bpf_func_info size */
__aligned_u64 func_info; /* func info */
__u32 func_info_cnt; /* number of bpf_func_info records */
}; };
struct { /* anonymous struct used by BPF_OBJ_* commands */ struct { /* anonymous struct used by BPF_OBJ_* commands */
...@@ -2201,6 +2208,8 @@ union bpf_attr { ...@@ -2201,6 +2208,8 @@ union bpf_attr {
* **CONFIG_NET** configuration option. * **CONFIG_NET** configuration option.
* Return * Return
* Pointer to *struct bpf_sock*, or NULL in case of failure. * Pointer to *struct bpf_sock*, or NULL in case of failure.
* For sockets with reuseport option, *struct bpf_sock*
* return is from reuse->socks[] using hash of the packet.
* *
* struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags) * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags)
* Description * Description
...@@ -2233,6 +2242,8 @@ union bpf_attr { ...@@ -2233,6 +2242,8 @@ union bpf_attr {
* **CONFIG_NET** configuration option. * **CONFIG_NET** configuration option.
* Return * Return
* Pointer to *struct bpf_sock*, or NULL in case of failure. * Pointer to *struct bpf_sock*, or NULL in case of failure.
* For sockets with reuseport option, *struct bpf_sock*
* return is from reuse->socks[] using hash of the packet.
* *
* int bpf_sk_release(struct bpf_sock *sk) * int bpf_sk_release(struct bpf_sock *sk)
* Description * Description
...@@ -2631,6 +2642,10 @@ struct bpf_prog_info { ...@@ -2631,6 +2642,10 @@ struct bpf_prog_info {
__u32 nr_jited_func_lens; __u32 nr_jited_func_lens;
__aligned_u64 jited_ksyms; __aligned_u64 jited_ksyms;
__aligned_u64 jited_func_lens; __aligned_u64 jited_func_lens;
__u32 btf_id;
__u32 func_info_rec_size;
__aligned_u64 func_info;
__u32 func_info_cnt;
} __attribute__((aligned(8))); } __attribute__((aligned(8)));
struct bpf_map_info { struct bpf_map_info {
...@@ -2942,4 +2957,9 @@ struct bpf_flow_keys { ...@@ -2942,4 +2957,9 @@ struct bpf_flow_keys {
}; };
}; };
struct bpf_func_info {
__u32 insn_offset;
__u32 type_id;
};
#endif /* _UAPI__LINUX_BPF_H__ */ #endif /* _UAPI__LINUX_BPF_H__ */
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI__LINUX_BPF_COMMON_H__ #ifndef _UAPI__LINUX_BPF_COMMON_H__
#define _UAPI__LINUX_BPF_COMMON_H__ #define _UAPI__LINUX_BPF_COMMON_H__
...@@ -14,9 +15,10 @@ ...@@ -14,9 +15,10 @@
/* ld/ldx fields */ /* ld/ldx fields */
#define BPF_SIZE(code) ((code) & 0x18) #define BPF_SIZE(code) ((code) & 0x18)
#define BPF_W 0x00 #define BPF_W 0x00 /* 32-bit */
#define BPF_H 0x08 #define BPF_H 0x08 /* 16-bit */
#define BPF_B 0x10 #define BPF_B 0x10 /* 8-bit */
/* eBPF BPF_DW 0x18 64-bit */
#define BPF_MODE(code) ((code) & 0xe0) #define BPF_MODE(code) ((code) & 0xe0)
#define BPF_IMM 0x00 #define BPF_IMM 0x00
#define BPF_ABS 0x20 #define BPF_ABS 0x20
......
...@@ -258,9 +258,6 @@ enum bpf_attach_type { ...@@ -258,9 +258,6 @@ enum bpf_attach_type {
/* Specify numa node during map creation */ /* Specify numa node during map creation */
#define BPF_F_NUMA_NODE (1U << 2) #define BPF_F_NUMA_NODE (1U << 2)
/* flags for BPF_PROG_QUERY */
#define BPF_F_QUERY_EFFECTIVE (1U << 0)
#define BPF_OBJ_NAME_LEN 16U #define BPF_OBJ_NAME_LEN 16U
/* Flags for accessing BPF object */ /* Flags for accessing BPF object */
...@@ -270,6 +267,12 @@ enum bpf_attach_type { ...@@ -270,6 +267,12 @@ enum bpf_attach_type {
/* Flag for stack_map, store build_id+offset instead of pointer */ /* Flag for stack_map, store build_id+offset instead of pointer */
#define BPF_F_STACK_BUILD_ID (1U << 5) #define BPF_F_STACK_BUILD_ID (1U << 5)
/* Zero-initialize hash function seed. This should only be used for testing. */
#define BPF_F_ZERO_SEED (1U << 6)
/* flags for BPF_PROG_QUERY */
#define BPF_F_QUERY_EFFECTIVE (1U << 0)
enum bpf_stack_build_id_status { enum bpf_stack_build_id_status {
/* user space need an empty entry to identify end of a trace */ /* user space need an empty entry to identify end of a trace */
BPF_STACK_BUILD_ID_EMPTY = 0, BPF_STACK_BUILD_ID_EMPTY = 0,
...@@ -336,6 +339,10 @@ union bpf_attr { ...@@ -336,6 +339,10 @@ union bpf_attr {
* (context accesses, allowed helpers, etc). * (context accesses, allowed helpers, etc).
*/ */
__u32 expected_attach_type; __u32 expected_attach_type;
__u32 prog_btf_fd; /* fd pointing to BTF type data */
__u32 func_info_rec_size; /* userspace bpf_func_info size */
__aligned_u64 func_info; /* func info */
__u32 func_info_cnt; /* number of bpf_func_info records */
}; };
struct { /* anonymous struct used by BPF_OBJ_* commands */ struct { /* anonymous struct used by BPF_OBJ_* commands */
...@@ -2202,6 +2209,8 @@ union bpf_attr { ...@@ -2202,6 +2209,8 @@ union bpf_attr {
* **CONFIG_NET** configuration option. * **CONFIG_NET** configuration option.
* Return * Return
* Pointer to *struct bpf_sock*, or NULL in case of failure. * Pointer to *struct bpf_sock*, or NULL in case of failure.
* For sockets with reuseport option, *struct bpf_sock*
* return is from reuse->socks[] using hash of the packet.
* *
* struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags) * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags)
* Description * Description
...@@ -2234,6 +2243,8 @@ union bpf_attr { ...@@ -2234,6 +2243,8 @@ union bpf_attr {
* **CONFIG_NET** configuration option. * **CONFIG_NET** configuration option.
* Return * Return
* Pointer to *struct bpf_sock*, or NULL in case of failure. * Pointer to *struct bpf_sock*, or NULL in case of failure.
* For sockets with reuseport option, *struct bpf_sock*
* return is from reuse->socks[] using hash of the packet.
* *
* int bpf_sk_release(struct bpf_sock *sk) * int bpf_sk_release(struct bpf_sock *sk)
* Description * Description
...@@ -2632,6 +2643,10 @@ struct bpf_prog_info { ...@@ -2632,6 +2643,10 @@ struct bpf_prog_info {
__u32 nr_jited_func_lens; __u32 nr_jited_func_lens;
__aligned_u64 jited_ksyms; __aligned_u64 jited_ksyms;
__aligned_u64 jited_func_lens; __aligned_u64 jited_func_lens;
__u32 btf_id;
__u32 func_info_rec_size;
__aligned_u64 func_info;
__u32 func_info_cnt;
} __attribute__((aligned(8))); } __attribute__((aligned(8)));
struct bpf_map_info { struct bpf_map_info {
...@@ -2943,5 +2958,10 @@ struct bpf_flow_keys { ...@@ -2943,5 +2958,10 @@ struct bpf_flow_keys {
}; };
}; };
struct bpf_func_info {
__u32 insn_offset;
__u32 type_id;
};
#endif /* _UAPI__LINUX_BPF_H__ */ #endif /* _UAPI__LINUX_BPF_H__ */
)********" )********"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment