lkml.org 
[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 bpf-next 02/11] bpf: Define migration types for SO_REUSEPORT.
Date
As noted in the preceding commit, there are two migration types. In
addition to that, the kernel will run the same eBPF program to select a
listener for SYN packets.

This patch defines three types to signal the kernel and the eBPF program if
it is receiving a new request or migrating ESTABLISHED/SYN_RECV sockets in
the accept queue or NEW_SYN_RECV socket during 3WHS.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
---
include/uapi/linux/bpf.h | 14 ++++++++++++++
tools/include/uapi/linux/bpf.h | 14 ++++++++++++++
2 files changed, 28 insertions(+)

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 162999b12790..85278deff439 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -4380,6 +4380,20 @@ struct sk_msg_md {
__bpf_md_ptr(struct bpf_sock *, sk); /* current socket */
};

+/* Migration type for SO_REUSEPORT enabled TCP sockets.
+ *
+ * BPF_SK_REUSEPORT_MIGRATE_NO : Select a listener for SYN packets.
+ * BPF_SK_REUSEPORT_MIGRATE_QUEUE : Migrate ESTABLISHED and SYN_RECV sockets in
+ * the accept queue at close() or shutdown().
+ * BPF_SK_REUSEPORT_MIGRATE_REQUEST : Migrate NEW_SYN_RECV socket at receiving the
+ * final ACK of 3WHS or retransmitting SYN+ACKs.
+ */
+enum {
+ BPF_SK_REUSEPORT_MIGRATE_NO,
+ BPF_SK_REUSEPORT_MIGRATE_QUEUE,
+ BPF_SK_REUSEPORT_MIGRATE_REQUEST,
+};
+
struct sk_reuseport_md {
/*
* Start of directly accessible data. It begins from
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 162999b12790..85278deff439 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -4380,6 +4380,20 @@ struct sk_msg_md {
__bpf_md_ptr(struct bpf_sock *, sk); /* current socket */
};

+/* Migration type for SO_REUSEPORT enabled TCP sockets.
+ *
+ * BPF_SK_REUSEPORT_MIGRATE_NO : Select a listener for SYN packets.
+ * BPF_SK_REUSEPORT_MIGRATE_QUEUE : Migrate ESTABLISHED and SYN_RECV sockets in
+ * the accept queue at close() or shutdown().
+ * BPF_SK_REUSEPORT_MIGRATE_REQUEST : Migrate NEW_SYN_RECV socket at receiving the
+ * final ACK of 3WHS or retransmitting SYN+ACKs.
+ */
+enum {
+ BPF_SK_REUSEPORT_MIGRATE_NO,
+ BPF_SK_REUSEPORT_MIGRATE_QUEUE,
+ BPF_SK_REUSEPORT_MIGRATE_REQUEST,
+};
+
struct sk_reuseport_md {
/*
* Start of directly accessible data. It begins from
--
2.17.2 (Apple Git-113)
\
 
 \ /
  Last update: 2020-12-01 15:48    [W:0.812 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site