Commit 20f1fda7 authored by 4ast's avatar 4ast Committed by GitHub

Merge pull request #1514 from iovisor/yhs_dev

sync bpf compat headers with latest net-next
parents 484e5253 d8271550
...@@ -196,8 +196,14 @@ enum bpf_attach_type { ...@@ -196,8 +196,14 @@ enum bpf_attach_type {
*/ */
#define BPF_F_STRICT_ALIGNMENT (1U << 0) #define BPF_F_STRICT_ALIGNMENT (1U << 0)
/* when bpf_ldimm64->src_reg == BPF_PSEUDO_MAP_FD, bpf_ldimm64->imm == fd */
#define BPF_PSEUDO_MAP_FD 1 #define BPF_PSEUDO_MAP_FD 1
/* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative
* offset to another bpf function
*/
#define BPF_PSEUDO_CALL 1
/* flags for BPF_MAP_UPDATE_ELEM command */ /* flags for BPF_MAP_UPDATE_ELEM command */
#define BPF_ANY 0 /* create new element or update existing */ #define BPF_ANY 0 /* create new element or update existing */
#define BPF_NOEXIST 1 /* create new element if it didn't exist */ #define BPF_NOEXIST 1 /* create new element if it didn't exist */
...@@ -677,6 +683,10 @@ union bpf_attr { ...@@ -677,6 +683,10 @@ union bpf_attr {
* @buf: buf to fill * @buf: buf to fill
* @buf_size: size of the buf * @buf_size: size of the buf
* Return : 0 on success or negative error code * Return : 0 on success or negative error code
*
* int bpf_override_return(pt_regs, rc)
* @pt_regs: pointer to struct pt_regs
* @rc: the return value to set
*/ */
#define __BPF_FUNC_MAPPER(FN) \ #define __BPF_FUNC_MAPPER(FN) \
FN(unspec), \ FN(unspec), \
...@@ -736,7 +746,8 @@ union bpf_attr { ...@@ -736,7 +746,8 @@ union bpf_attr {
FN(xdp_adjust_meta), \ FN(xdp_adjust_meta), \
FN(perf_event_read_value), \ FN(perf_event_read_value), \
FN(perf_prog_read_value), \ FN(perf_prog_read_value), \
FN(getsockopt), FN(getsockopt), \
FN(override_return),
/* integer value in 'imm' field of BPF_CALL instruction selects which helper /* integer value in 'imm' field of BPF_CALL instruction selects which helper
* function eBPF program intends to call * function eBPF program intends to call
...@@ -941,6 +952,12 @@ struct bpf_sock_ops { ...@@ -941,6 +952,12 @@ struct bpf_sock_ops {
__u32 local_ip6[4]; /* Stored in network byte order */ __u32 local_ip6[4]; /* Stored in network byte order */
__u32 remote_port; /* Stored in network byte order */ __u32 remote_port; /* Stored in network byte order */
__u32 local_port; /* stored in host byte order */ __u32 local_port; /* stored in host byte order */
__u32 is_fullsock; /* Some TCP fields are only valid if
* there is a full socket. If not, the
* fields read as zero.
*/
__u32 snd_cwnd;
__u32 srtt_us; /* Averaged RTT << 3 in usecs */
}; };
/* List of known BPF sock_ops operators. /* List of known BPF sock_ops operators.
...@@ -995,7 +1012,8 @@ struct bpf_perf_event_value { ...@@ -995,7 +1012,8 @@ struct bpf_perf_event_value {
#define BPF_DEVCG_DEV_CHAR (1ULL << 1) #define BPF_DEVCG_DEV_CHAR (1ULL << 1)
struct bpf_cgroup_dev_ctx { struct bpf_cgroup_dev_ctx {
__u32 access_type; /* (access << 16) | type */ /* access_type encoded as (BPF_DEVCG_ACC_* << 16) | BPF_DEVCG_DEV_* */
__u32 access_type;
__u32 major; __u32 major;
__u32 minor; __u32 minor;
}; };
......
...@@ -197,8 +197,14 @@ enum bpf_attach_type { ...@@ -197,8 +197,14 @@ enum bpf_attach_type {
*/ */
#define BPF_F_STRICT_ALIGNMENT (1U << 0) #define BPF_F_STRICT_ALIGNMENT (1U << 0)
/* when bpf_ldimm64->src_reg == BPF_PSEUDO_MAP_FD, bpf_ldimm64->imm == fd */
#define BPF_PSEUDO_MAP_FD 1 #define BPF_PSEUDO_MAP_FD 1
/* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative
* offset to another bpf function
*/
#define BPF_PSEUDO_CALL 1
/* flags for BPF_MAP_UPDATE_ELEM command */ /* flags for BPF_MAP_UPDATE_ELEM command */
#define BPF_ANY 0 /* create new element or update existing */ #define BPF_ANY 0 /* create new element or update existing */
#define BPF_NOEXIST 1 /* create new element if it didn't exist */ #define BPF_NOEXIST 1 /* create new element if it didn't exist */
...@@ -676,6 +682,10 @@ union bpf_attr { ...@@ -676,6 +682,10 @@ union bpf_attr {
* @buf: buf to fill * @buf: buf to fill
* @buf_size: size of the buf * @buf_size: size of the buf
* Return : 0 on success or negative error code * Return : 0 on success or negative error code
*
* int bpf_override_return(pt_regs, rc)
* @pt_regs: pointer to struct pt_regs
* @rc: the return value to set
*/ */
#define __BPF_FUNC_MAPPER(FN) \ #define __BPF_FUNC_MAPPER(FN) \
FN(unspec), \ FN(unspec), \
...@@ -735,7 +745,8 @@ union bpf_attr { ...@@ -735,7 +745,8 @@ union bpf_attr {
FN(xdp_adjust_meta), \ FN(xdp_adjust_meta), \
FN(perf_event_read_value), \ FN(perf_event_read_value), \
FN(perf_prog_read_value), \ FN(perf_prog_read_value), \
FN(getsockopt), FN(getsockopt), \
FN(override_return),
/* integer value in 'imm' field of BPF_CALL instruction selects which helper /* integer value in 'imm' field of BPF_CALL instruction selects which helper
* function eBPF program intends to call * function eBPF program intends to call
...@@ -940,6 +951,12 @@ struct bpf_sock_ops { ...@@ -940,6 +951,12 @@ struct bpf_sock_ops {
__u32 local_ip6[4]; /* Stored in network byte order */ __u32 local_ip6[4]; /* Stored in network byte order */
__u32 remote_port; /* Stored in network byte order */ __u32 remote_port; /* Stored in network byte order */
__u32 local_port; /* stored in host byte order */ __u32 local_port; /* stored in host byte order */
__u32 is_fullsock; /* Some TCP fields are only valid if
* there is a full socket. If not, the
* fields read as zero.
*/
__u32 snd_cwnd;
__u32 srtt_us; /* Averaged RTT << 3 in usecs */
}; };
/* List of known BPF sock_ops operators. /* List of known BPF sock_ops operators.
...@@ -994,7 +1011,8 @@ struct bpf_perf_event_value { ...@@ -994,7 +1011,8 @@ struct bpf_perf_event_value {
#define BPF_DEVCG_DEV_CHAR (1ULL << 1) #define BPF_DEVCG_DEV_CHAR (1ULL << 1)
struct bpf_cgroup_dev_ctx { struct bpf_cgroup_dev_ctx {
__u32 access_type; /* (access << 16) | type */ /* access_type encoded as (BPF_DEVCG_ACC_* << 16) | BPF_DEVCG_DEV_* */
__u32 access_type;
__u32 major; __u32 major;
__u32 minor; __u32 minor;
}; };
......
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