summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorLawrence Brakmo2018-01-26 01:14:11 +0100
committerAlexei Starovoitov2018-01-26 01:41:14 +0100
commitf89013f66d0f1a0dad44c513318efb706399a36b (patch)
tree7589bf9c59c29c7fef4bfb2a7f7d98f679715a42 /include/uapi/linux/bpf.h
parentbpf: Adds field bpf_sock_ops_cb_flags to tcp_sock (diff)
downloadkernel-qcow2-linux-f89013f66d0f1a0dad44c513318efb706399a36b.tar.gz
kernel-qcow2-linux-f89013f66d0f1a0dad44c513318efb706399a36b.tar.xz
kernel-qcow2-linux-f89013f66d0f1a0dad44c513318efb706399a36b.zip
bpf: Add sock_ops RTO callback
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo <brakmo@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index aa128407c44d..c8cecf9cf5bd 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -982,7 +982,8 @@ struct bpf_sock_ops {
};
/* Definitions for bpf_sock_ops_cb_flags */
-#define BPF_SOCK_OPS_ALL_CB_FLAGS 0 /* Mask of all currently
+#define BPF_SOCK_OPS_RTO_CB_FLAG (1<<0)
+#define BPF_SOCK_OPS_ALL_CB_FLAGS 0x1 /* Mask of all currently
* supported cb flags
*/
@@ -1019,6 +1020,11 @@ enum {
* a congestion threshold. RTTs above
* this indicate congestion
*/
+ BPF_SOCK_OPS_RTO_CB, /* Called when an RTO has triggered.
+ * Arg1: value of icsk_retransmits
+ * Arg2: value of icsk_rto
+ * Arg3: whether RTO has expired
+ */
};
#define TCP_BPF_IW 1001 /* Set TCP initial congestion window */