History

tools: sync bpf.h

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.

Matt Mullins committed 7 years ago

Commit 4635b0a1 parent 2abd2de3 files · +11 −1Browse files

Showing the changes to tools/include/uapi/linux (1 of 3 files). Show all

Unified · Split

tools/include/uapi/linux/bpf.h+9−1
@@ -168,6 +168,7 @@ enum bpf_prog_type { · 167 unmodified lines
168 BPF_PROG_TYPE_SK_REUSEPORT,168 BPF_PROG_TYPE_SK_REUSEPORT,
169 BPF_PROG_TYPE_FLOW_DISSECTOR,169 BPF_PROG_TYPE_FLOW_DISSECTOR,
170 BPF_PROG_TYPE_CGROUP_SYSCTL,170 BPF_PROG_TYPE_CGROUP_SYSCTL,
171 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
171};172};
172 173
173enum bpf_attach_type {174enum bpf_attach_type {
@@ -1737,12 +1738,19 @@ union bpf_attr { · 1563 unmodified lines
1737 * error if an eBPF program tries to set a callback that is not1738 * error if an eBPF program tries to set a callback that is not
1738 * supported in the current kernel.1739 * supported in the current kernel.
1739 *1740 *
1740 * The supported callback values that *argval* can combine are:1741 * *argval* is a flag array which can combine these flags:
1741 *1742 *
1742 * * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out)1743 * * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out)
1743 * * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission)1744 * * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission)
1744 * * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change)1745 * * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change)
1745 *1746 *
1747 * Therefore, this function can be used to clear a callback flag by
1748 * setting the appropriate bit to zero. e.g. to disable the RTO
1749 * callback:
1750 *
1751 * **bpf_sock_ops_cb_flags_set(bpf_sock,**
1752 * **bpf_sock->bpf_sock_ops_cb_flags & ~BPF_SOCK_OPS_RTO_CB_FLAG)**
1753 *
1746 * Here are some examples of where one could call such eBPF1754 * Here are some examples of where one could call such eBPF
1747 * program:1755 * program:
1748 *1756 *