提交 f555417a 编写于 作者: M Matt Mullins 提交者: Cheng Jian

tools: sync bpf.h

mainline inclusion
from mainline-v5.2-rc1
commit 4635b0ae
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I3U9MR
CVE: NA

-------------------------------------------------------------------------

This adds BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, and fixes up the

	error: enumeration value ‘BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE’ not handled in switch [-Werror=switch-enum]

build errors it would otherwise cause in libbpf.
Signed-off-by: NMatt Mullins <mmullins@fb.com>
Acked-by: NYonghong Song <yhs@fb.com>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Conflict:
	tools/include/uapi/linux/bpf.h
	tools/lib/bpf/libbpf.c
Signed-off-by: NYufen Yu <yuyufen@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 e4f7e25d
...@@ -153,6 +153,9 @@ enum bpf_prog_type { ...@@ -153,6 +153,9 @@ enum bpf_prog_type {
BPF_PROG_TYPE_LWT_SEG6LOCAL, BPF_PROG_TYPE_LWT_SEG6LOCAL,
BPF_PROG_TYPE_LIRC_MODE2, BPF_PROG_TYPE_LIRC_MODE2,
BPF_PROG_TYPE_SK_REUSEPORT, BPF_PROG_TYPE_SK_REUSEPORT,
BPF_PROG_TYPE_FLOW_DISSECTOR,
BPF_PROG_TYPE_CGROUP_SYSCTL,
BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
}; };
enum bpf_attach_type { enum bpf_attach_type {
...@@ -1652,12 +1655,19 @@ union bpf_attr { ...@@ -1652,12 +1655,19 @@ union bpf_attr {
* error if an eBPF program tries to set a callback that is not * error if an eBPF program tries to set a callback that is not
* supported in the current kernel. * supported in the current kernel.
* *
* The supported callback values that *argval* can combine are: * *argval* is a flag array which can combine these flags:
* *
* * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out) * * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out)
* * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission) * * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission)
* * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change) * * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change)
* *
* Therefore, this function can be used to clear a callback flag by
* setting the appropriate bit to zero. e.g. to disable the RTO
* callback:
*
* **bpf_sock_ops_cb_flags_set(bpf_sock,**
* **bpf_sock->bpf_sock_ops_cb_flags & ~BPF_SOCK_OPS_RTO_CB_FLAG)**
*
* Here are some examples of where one could call such eBPF * Here are some examples of where one could call such eBPF
* program: * program:
* *
......
...@@ -1516,6 +1516,7 @@ static bool bpf_prog_type__needs_kver(enum bpf_prog_type type) ...@@ -1516,6 +1516,7 @@ static bool bpf_prog_type__needs_kver(enum bpf_prog_type type)
case BPF_PROG_TYPE_TRACEPOINT: case BPF_PROG_TYPE_TRACEPOINT:
case BPF_PROG_TYPE_PERF_EVENT: case BPF_PROG_TYPE_PERF_EVENT:
case BPF_PROG_TYPE_RAW_TRACEPOINT: case BPF_PROG_TYPE_RAW_TRACEPOINT:
case BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE:
default: default:
return true; return true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册