This patch adds a test for BPF_SK_REUSEPORT_SELECT_OR_MIGRATE and
removes 'static' from settimeo() in network_helpers.c.
Signed-off-by: Kuniyuki Iwashima
---
tools/testing/selftests/bpf/network_helpers.c | 2 +-
tools/testing/selftests/bpf/network_helpers.h | 1 +
.../bpf/prog_tests
This commit introduces a new section (sk_reuseport/migrate) and sets
expected_attach_type to two each section in BPF_PROG_TYPE_SK_REUSEPORT
program.
Signed-off-by: Kuniyuki Iwashima
---
tools/lib/bpf/libbpf.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/linux/bpf.h| 1 +
include/linux/filter.h | 2 ++
include/uapi/linux/bpf.h | 15 +++
kernel/bpf/syscall.c | 13 +
net/core/filter.c | 13 -
This commit adds a new sysctl option: net.ipv4.tcp_migrate_req. If this
option is enabled or eBPF program is attached, we will be able to migrate
child sockets from a listener to another in the same reuseport group after
close() or shutdown() syscalls.
Signed-off-by: Kuniyuki Iwashima
Reviewed
-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 1 +
net/core/filter.c | 10 ++
tools/include/uapi/linux/bpf.h | 1 +
3 files changed, 12 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 49371eba98ba..ab8584701334 100644
--- a/include
PU 1 loses the race
CPU 3 looks up req2, unhashes it, then CPU 2 loses the race
...
Signed-off-by: Kuniyuki Iwashima
---
net/ipv4/inet_connection_sock.c | 30 +-
net/ipv4/tcp_ipv4.c | 20 ++--
net/ipv6/tcp_ipv6.c | 14 +++
new timer will recover this
situation.
Signed-off-by: Kuniyuki Iwashima
---
net/core/request_sock.c | 1 +
net/ipv4/inet_connection_sock.c | 76 +
2 files changed, 68 insertions(+), 9 deletions(-)
diff --git a/net/core/request_sock.c b/net/core/request_so
tps://lore.kernel.org/netdev/20201209030903.hhow5r53l6fmo...@kafai-mbp.dhcp.thefacebook.com/
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/net/request_sock.h | 2 ++
net/core/request_sock.c | 37 +
net/ipv4/inet_connection_soc
to decrement it later.
We will support migration by eBPF in the later commits.
Signed-off-by: Kuniyuki Iwashima
Signed-off-by: Martin KaFai Lau
---
include/net/sock_reuseport.h | 3 ++
net/core/sock_reuseport.c| 78 +---
2 files changed, 67 insertions
- we cannot attach an eBPF prog to listening sockets via shutdowned
sockets
Note that when the number of sockets gets over U16_MAX, we try to detach a
closed socket randomly to make room for the new listening socket in
reuseport_grow().
Signed-off-by: Kuniyuki Iwashima
Signed-off-by: Martin
_socks.
Signed-off-by: Kuniyuki Iwashima
---
include/net/sock_reuseport.h | 5 ++-
net/core/sock_reuseport.c| 76 +++-
2 files changed, 60 insertions(+), 21 deletions(-)
diff --git a/include/net/sock_reuseport.h b/include/net/sock_reuseport.h
index 505f1e
ges and coverletter
RFC:
https://lore.kernel.org/netdev/20201117094023.3685-1-kun...@amazon.co.jp/
Kuniyuki Iwashima (11):
net: Introduce net.ipv4.tcp_migrate_req.
tcp: Add num_closed_socks to struct sock_reuseport.
tcp: Keep TCP_CLOSE sockets in the reuseport group.
tcp:
ore, this patch adds a compile-time check to take care of the order
of sock_copy() and sk_tx_queue_clear() and removes sk_tx_queue_clear() from
sk_prot_alloc() so that it does the only allocation and its callers
initialize fields.
CC: Tariq Toukan
CC: Boris Pismenny
Signed-off-by: Kuniyuki Iwash
From: Tariq Toukan
Date: Thu, 28 Jan 2021 15:09:51 +0200
> On 1/28/2021 2:42 PM, Kuniyuki Iwashima wrote:
> > The commit 41b14fb8724d ("net: Do not clear the sock TX queue in
> > sk_set_socket()") removes sk_tx_queue_clear() from sk_set_socket() and adds
&
ewed-by: tag
v1: https://lore.kernel.org/netdev/20210127125018.7059-1-kun...@amazon.co.jp/
CC: Tariq Toukan
CC: Boris Pismenny
Signed-off-by: Kuniyuki Iwashima
---
net/core/sock.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/net/core/sock.c b/net/core/so
From: Tariq Toukan
Date: Thu, 28 Jan 2021 13:07:26 +0200
> On 1/28/2021 4:19 AM, Kuniyuki Iwashima wrote:
> > The commit 41b14fb8724d ("net: Do not clear the sock TX queue in
> > sk_set_socket()") removes sk_tx_queue_clear() from sk_set_socket() and adds
&
) from sk_prot_alloc()
instead of sk_alloc() and sk_clone_lock()
v2: https://lore.kernel.org/netdev/20210127132215.10842-1-kun...@amazon.co.jp/
* Remove Reviewed-by: tag
v1: https://lore.kernel.org/netdev/20210127125018.7059-1-kun...@amazon.co.jp/
CC: Tariq Toukan
CC: Boris Pismenny
Signed-off-b
From: Eric Dumazet
Date: Wed, 27 Jan 2021 19:07:51 +0100
> On Wed, Jan 27, 2021 at 6:56 PM Kuniyuki Iwashima wrote:
> >
> > From: Eric Dumazet
> > Date: Wed, 27 Jan 2021 18:34:35 +0100
> > > On Wed, Jan 27, 2021 at 6:32 PM Kuniyuki Iwashima
> > &
From: Eric Dumazet
Date: Wed, 27 Jan 2021 18:34:35 +0100
> On Wed, Jan 27, 2021 at 6:32 PM Kuniyuki Iwashima wrote:
> >
> > From: Eric Dumazet
> > Date: Wed, 27 Jan 2021 18:05:24 +0100
> > > On Wed, Jan 27, 2021 at 5:52 PM Kuniyuki Iwashima
> > &
From: Eric Dumazet
Date: Wed, 27 Jan 2021 18:05:24 +0100
> On Wed, Jan 27, 2021 at 5:52 PM Kuniyuki Iwashima wrote:
> >
> > From: Eric Dumazet
> > Date: Wed, 27 Jan 2021 15:54:32 +0100
> > > On Wed, Jan 27, 2021 at 1:50 PM Kuniyuki Iwashima
> >
From: Eric Dumazet
Date: Wed, 27 Jan 2021 15:54:32 +0100
> On Wed, Jan 27, 2021 at 1:50 PM Kuniyuki Iwashima wrote:
> >
> > The commit 41b14fb8724d ("net: Do not clear the sock TX queue in
> > sk_set_socket()") removes sk_tx_queue_clear() from sk_set_s
From: Kuniyuki Iwashima
Date: Wed, 27 Jan 2021 21:50:18 +0900
> The commit 41b14fb8724d ("net: Do not clear the sock TX queue in
> sk_set_socket()") removes sk_tx_queue_clear() from sk_set_socket() and adds
> it instead in sk_alloc() and sk_clone_lock() to fix
Fixes: 41b14fb8724d ("net: Do not clear the sock TX queue in sk_set_socket()")
CC: Tariq Toukan
CC: Boris Pismenny
Signed-off-by: Kuniyuki Iwashima
---
net/core/sock.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index bbcd4b97eddd..5c665ee1415
Fixes: 41b14fb8724d ("net: Do not clear the sock TX queue in sk_set_socket()")
CC: Tariq Toukan
CC: Boris Pismenny
Signed-off-by: Kuniyuki Iwashima
Reviewed-by: Amit Shah
---
net/core/sock.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index bbc
t in IPv4.
Fixes: 01770a166165 ("tcp: fix race condition when creating child sockets from
syncookies")
CC: Ricardo Dias
Signed-off-by: Kuniyuki Iwashima
Reviewed-by: Benjamin Herrenschmidt
---
net/ipv4/tcp_ipv4.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/
From: Martin KaFai Lau
Date: Mon, 14 Dec 2020 18:58:37 -0800
> On Tue, Dec 15, 2020 at 02:03:13AM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Thu, 10 Dec 2020 10:49:15 -0800
> > > On Thu, Dec 10, 2020 at 02:15:38PM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Thu, 10 Dec 2020 11:33:40 -0800
> On Thu, Dec 10, 2020 at 02:58:10PM +0900, Kuniyuki Iwashima wrote:
>
> [ ... ]
>
> > > > I've implemented one-by-one migration only for the accept queue for now.
> > > > In addition to th
From: Martin KaFai Lau
Date: Thu, 10 Dec 2020 10:49:15 -0800
> On Thu, Dec 10, 2020 at 02:15:38PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Wed, 9 Dec 2020 16:07:07 -0800
> > > On Tue, Dec 01, 2020 at 11:44:12PM +0900,
From: Martin KaFai Lau
Date: Wed, 9 Dec 2020 17:53:19 -0800
> On Thu, Dec 10, 2020 at 01:57:19AM +0900, Kuniyuki Iwashima wrOAote:
> [ ... ]
>
> > > > > I think it is a bit complex to pass the new listener from
> > > > > reusepor
From: Martin KaFai Lau
Date: Wed, 9 Dec 2020 16:07:07 -0800
> On Tue, Dec 01, 2020 at 11:44:12PM +0900, Kuniyuki Iwashima wrote:
> > This patch renames reuseport_select_sock() to __reuseport_select_sock() and
> > adds two wrapper function of it to pass the migrati
From: Kuniyuki Iwashima
Date: Wed, 9 Dec 2020 17:05:09 +0900
> From: Martin KaFai Lau
> Date: Tue, 8 Dec 2020 19:09:03 -0800
> > On Tue, Dec 08, 2020 at 05:17:48PM +0900, Kuniyuki Iwashima wrote:
> > > From: Martin KaFai Lau
> > > Date: Mon, 7 Dec 2020
From: Martin KaFai Lau
Date: Tue, 8 Dec 2020 19:09:03 -0800
> On Tue, Dec 08, 2020 at 05:17:48PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Mon, 7 Dec 2020 23:34:41 -0800
> > > On Tue, Dec 08, 2020 at 03:31:34PM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Tue, 8 Dec 2020 00:13:28 -0800
> On Tue, Dec 08, 2020 at 03:27:14PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Mon, 7 Dec 2020 12:14:38 -0800
> > > On Sun, Dec 06, 2020 at 01:03:07AM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Mon, 7 Dec 2020 23:34:41 -0800
> On Tue, Dec 08, 2020 at 03:31:34PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Mon, 7 Dec 2020 12:33:15 -0800
> > > On Thu, Dec 03, 2020 at 11:14:24PM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Mon, 7 Dec 2020 22:54:18 -0800
> On Tue, Dec 01, 2020 at 11:44:10PM +0900, Kuniyuki Iwashima wrote:
>
> > @@ -242,8 +244,12 @@ void reuseport_detach_sock(struct sock *sk)
> >
> > reuse->num_socks--;
> >
From: Martin KaFai Lau
Date: Mon, 7 Dec 2020 12:33:15 -0800
> On Thu, Dec 03, 2020 at 11:14:24PM +0900, Kuniyuki Iwashima wrote:
> > From: Eric Dumazet
> > Date: Tue, 1 Dec 2020 16:25:51 +0100
> > > On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote:
From: Martin KaFai Lau
Date: Mon, 7 Dec 2020 12:14:38 -0800
> On Sun, Dec 06, 2020 at 01:03:07AM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Fri, 4 Dec 2020 17:42:41 -0800
> > > On Tue, Dec 01, 2020 at 11:44:10PM +0900,
This patch adds a test for BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
.../bpf/prog_tests/select_reuseport_migrate.c | 173 ++
.../bpf/progs/test_select_reuseport_migrate.c | 53 ++
2 files changed, 226
, and the sk_hash of the listener is
always zero. So we pass zero as hash to bpf_run_sk_reuseport().
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
net/core/filter.c | 19 +++
net/core/sock_reuseport.c | 21 +++--
net/ipv4
-off-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 8
net/core/filter.c | 22 ++
tools/include/uapi/linux/bpf.h | 8
3 files changed, 38 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index
is
BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.
Link:
https://lore.kernel.org/netdev/20201123003828.xjpjdtk4ygl6t...@kafai-mbp.dhcp.thefacebook.com/
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/linux/bpf.h| 1 +
include/linux/filter.h | 4 ++--
include
This commit introduces a new section (sk_reuseport/migrate) and sets
expected_attach_type to two each section in BPF_PROG_TYPE_SK_REUSEPORT
program.
Signed-off-by: Kuniyuki Iwashima
---
tools/lib/bpf/libbpf.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf
-mbp.dhcp.thefacebook.com/
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 2 ++
kernel/bpf/syscall.c | 13 +
tools/include/uapi/linux/bpf.h | 2 ++
3 files changed, 17 insertions(+)
diff --git a/include/uapi/linux/bpf.h b
from the reuseport group, we rewrite request_sock.rsk_listener and resume
processing the request.
Link: https://lore.kernel.org/bpf/202012020136.bf0z4guu-...@intel.com/
Reported-by: kernel test robot
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net
m/
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/sock_reuseport.h | 2 +-
net/core/sock_reuseport.c| 16 +---
net/ipv4/inet_hashtables.c | 9 +++--
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/include/net/sock_r
stener to it at accept()
before reqsk_fastopen_remove().
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
net/ipv4/inet_connection_sock.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
->rsk_listener. However, in the third case of
TCP_SYN_RECV sockets, we take special care in the next commit.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/inet_connection_sock.h | 1 +
net/ipv4/inet_connection_sock.c| 68 ++
This reverts commit 607904c357c61adf20b8fd18af765e501d61a385 to use
spin_lock_bh_nested() in the next commit.
Link:
https://lore.kernel.org/netdev/9d290a57-49e1-04cd-2487-262b0d7c5...@gmail.com/
Signed-off-by: Kuniyuki Iwashima
CC: Waiman Long
---
include/linux/spinlock.h | 8
/SYN_RECV sockets in
the accept queue or NEW_SYN_RECV socket during 3WHS.
Signed-off-by: Kuniyuki Iwashima
---
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
rules
so that the socket can listen again if it has the same reuseport group with
other listening sockets.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/sock_reuseport.h| 5 +++--
net/core/sock_reuseport.c | 39
req_to_sk(req)->sk_hash because listener's hash is zero
* Update commit messages and coverletter
RFC:
https://lore.kernel.org/netdev/20201117094023.3685-1-kun...@amazon.co.jp/
Kuniyuki Iwashima (13):
tcp: Allow TCP_CLOSE sockets to hold the reuseport group.
bpf: Define migration ty
I'm sending this mail just for logging because I failed to send mails only
to LKML, netdev, and bpf yesterday.
From: Martin KaFai Lau
Date: Fri, 4 Dec 2020 17:50:00 -0800
> On Tue, Dec 01, 2020 at 11:44:18PM +0900, Kuniyuki Iwashima wrote:
> > This patch ad
I'm sending this mail just for logging because I failed to send mails only
to LKML, netdev, and bpf yesterday.
From: Martin KaFai Lau
Date: Fri, 4 Dec 2020 17:42:41 -0800
> On Tue, Dec 01, 2020 at 11:44:10PM +0900, Kuniyuki Iwashima wrote:
> [ ... ]
> > diff --gi
I'm sending this mail just for logging because I failed to send mails only
to LKML, netdev, and bpf yesterday.
From: Martin KaFai Lau
Date: Fri, 4 Dec 2020 17:31:03 -0800
> On Tue, Dec 01, 2020 at 11:44:08PM +0900, Kuniyuki Iwashima wrote:
> > This patch is a preparation patch t
I'm sending this mail just for logging because I failed to send mails only
to LKML, netdev, and bpf yesterday.
From: Martin KaFai Lau
Date: Fri, 4 Dec 2020 11:58:07 -0800
> On Tue, Dec 01, 2020 at 11:44:16PM +0900, Kuniyuki Iwashima wrote:
> > We will call sock_reuseport.prog f
I'm sending this mail just for logging because I failed to send mails only
to LKML, netdev, and bpf yesterday.
From: Martin KaFai Lau
Date: Thu, 3 Dec 2020 21:56:53 -0800
> On Thu, Dec 03, 2020 at 11:16:08PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> >
From: Eric Dumazet
Date: Thu, 3 Dec 2020 15:31:53 +0100
> On Thu, Dec 3, 2020 at 3:14 PM Kuniyuki Iwashima wrote:
> >
> > From: Eric Dumazet
> > Date: Tue, 1 Dec 2020 16:25:51 +0100
> > > On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote:
> > > > This
From: Martin KaFai Lau
Date: Wed, 2 Dec 2020 20:24:02 -0800
> On Wed, Dec 02, 2020 at 11:19:02AM -0800, Martin KaFai Lau wrote:
> > On Tue, Dec 01, 2020 at 06:04:50PM -0800, Andrii Nakryiko wrote:
> > > On Tue, Dec 1, 2020 at 6:49 AM Kuniyuki Iwas
From: Eric Dumazet
Date: Tue, 1 Dec 2020 16:25:51 +0100
> On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote:
> > This patch lets reuseport_detach_sock() return a pointer of struct sock,
> > which is used only by inet_unhash(). If it is not NULL,
> > inet_csk_reqsk_que
From: Eric Dumazet
Date: Tue, 1 Dec 2020 16:13:39 +0100
> On 12/1/20 3:44 PM, Kuniyuki Iwashima wrote:
> > This patch renames reuseport_select_sock() to __reuseport_select_sock() and
> > adds two wrapper function of it to pass the migration type defined in the
>
, and the sk_hash of the listener is
always zero. Thus, we pass zero as hash to bpf_run_sk_reuseport().
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
net/core/filter.c | 19 +++
net/core/sock_reuseport.c | 19 ++-
net/ipv4
-off-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 8
net/core/filter.c | 12 +++-
tools/include/uapi/linux/bpf.h | 8
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index
This patch adds a test for BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
.../bpf/prog_tests/migrate_reuseport.c| 164 ++
.../bpf/progs/test_migrate_reuseport_kern.c | 54 ++
2 files changed, 218
is
BPF_SK_REUSEPORT_SELECT_OR_MIGRATE.
Link:
https://lore.kernel.org/netdev/20201123003828.xjpjdtk4ygl6t...@kafai-mbp.dhcp.thefacebook.com/
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/linux/bpf.h| 1 +
include/linux/filter.h | 4 ++--
include
This commit introduces a new section (sk_reuseport/migrate) and sets
expected_attach_type to two each section in BPF_PROG_TYPE_SK_REUSEPORT
program.
Signed-off-by: Kuniyuki Iwashima
---
tools/lib/bpf/libbpf.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf
-mbp.dhcp.thefacebook.com/
Suggested-by: Martin KaFai Lau
Signed-off-by: Kuniyuki Iwashima
---
include/uapi/linux/bpf.h | 2 ++
kernel/bpf/syscall.c | 8
tools/include/uapi/linux/bpf.h | 2 ++
3 files changed, 12 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include
from the reuseport group, we rewrite request_sock.rsk_listener and resume
processing the request.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/inet_connection_sock.h | 12 +++
include/net/request_sock.h | 13
include/net
not have the
reuseport group. Therefore, this patch also loosens such validation rules
so that the socket can listen again if it has the same reuseport group with
other listening sockets.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/sock_reuseport.h| 5
stener to it at accept()
before reqsk_fastopen_remove().
Moreover, if TFO request caused RST before 3WHS has completed, it is held
in the listener's TFO queue to prevent DDoS attack. Thus, we also have to
migrate the requests in TFO queue.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iw
use an error.
Therefore, if there are different kinds of sockets, we must attach an eBPF
program described in later commits.
Link:
https://lore.kernel.org/netdev/CAEfhGiyG8Y_amDZ2C8dQoQqjZJMHjTY76b=KBkTKcBtA=dh...@mail.gmail.com/
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iw
/SYN_RECV sockets in
the accept queue or NEW_SYN_RECV socket during 3WHS.
Signed-off-by: Kuniyuki Iwashima
---
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
* Pass req_to_sk(req)->sk_hash because listener's hash is zero
* Update commit messages and coverletter
RFC v0:
https://lore.kernel.org/netdev/20201117094023.3685-1-kun...@amazon.co.jp/
Kuniyuki Iwashima (11):
tcp: Keep TCP_CLOSE sockets in the reuseport group.
bpf: Define migrat
From: Martin KaFai Lau
Date: Sun, 22 Nov 2020 16:40:20 -0800
> On Sat, Nov 21, 2020 at 07:13:22PM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Thu, 19 Nov 2020 17:53:46 -0800
> > > On Fri, Nov 20, 2020 at 07:09:22AM +0900, Kuniyuki Iwas
From: Martin KaFai Lau
Date: Thu, 19 Nov 2020 18:31:57 -0800
> On Fri, Nov 20, 2020 at 07:17:49AM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Wed, 18 Nov 2020 17:49:13 -0800
> > > On Tue, Nov 17, 2020 at 06:40:15PM +0900,
From: Martin KaFai Lau
Date: Thu, 19 Nov 2020 17:53:46 -0800
> On Fri, Nov 20, 2020 at 07:09:22AM +0900, Kuniyuki Iwashima wrote:
> > From: Martin KaFai Lau
> > Date: Wed, 18 Nov 2020 15:50:17 -0800
> > > On Tue, Nov 17, 2020 at 06:40:18PM +0900, Kuniyuki Iwashima w
From: Martin KaFai Lau
Date: Wed, 18 Nov 2020 17:49:13 -0800
> On Tue, Nov 17, 2020 at 06:40:15PM +0900, Kuniyuki Iwashima wrote:
> > The SO_REUSEPORT option allows sockets to listen on the same port and to
> > accept connections evenly. However, there is a defect
From: Martin KaFai Lau
Date: Wed, 18 Nov 2020 17:00:45 -0800
> On Tue, Nov 17, 2020 at 06:40:22PM +0900, Kuniyuki Iwashima wrote:
> > This patch makes it possible to select a new listener for socket migration
> > by eBPF.
> >
> > The noteworthy point is that w
From: Martin KaFai Lau
Date: Wed, 18 Nov 2020 16:11:54 -0800
> On Tue, Nov 17, 2020 at 06:40:21PM +0900, Kuniyuki Iwashima wrote:
> > We will call sock_reuseport.prog for socket migration in the next commit,
> > so the eBPF program has to know which listener is closing in orde
From: Martin KaFai Lau
Date: Wed, 18 Nov 2020 15:50:17 -0800
> On Tue, Nov 17, 2020 at 06:40:18PM +0900, Kuniyuki Iwashima wrote:
> > This patch lets reuseport_detach_sock() return a pointer of struct sock,
> > which is used only by inet_unhash(). If
From: Eric Dumazet
Date: Wed, 18 Nov 2020 17:25:44 +0100
> On 11/17/20 10:40 AM, Kuniyuki Iwashima wrote:
> > The SO_REUSEPORT option allows sockets to listen on the same port and to
> > accept connections evenly. However, there is a defect in the current
> > implementati
From: David Laight
Date: Wed, 18 Nov 2020 09:18:24 +
> From: Kuniyuki Iwashima
> > Sent: 17 November 2020 09:40
> >
> > The SO_REUSEPORT option allows sockets to listen on the same port and to
> > accept connections evenly. However, there is a defect in the
This commit adds a new sysctl option: net.ipv4.tcp_migrate_req. If this
option is enabled, and then we call listen() for SO_REUSEPORT enabled
sockets and close one, we will be able to migrate its child sockets to
another listener.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki
() or
inet_csk_bind_conflict() which expect that such sockets should not have the
reuseport group. Therefore, this patch loosens such validation rules so
that the socket can listen again if it has the same reuseport group with
other listening sockets.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
() for BPF_MAP_TYPE_REUSEPORT_SOCKARRAY map.
This patch exposes the ID to the eBPF program.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 1 +
net/core/filter.c | 8
tools/include/uapi/linux/bpf.h | 1 +
4
accept()
before reqsk_fastopen_remove().
Moreover, if TFO request caused RST before 3WHS has completed, it is held
in the listener's TFO queue to prevent DDoS attack. Thus, we also have to
migrate the requests in TFO queue.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
ne
API level or
when we want to free resources as soon as possible.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
net/core/filter.c | 26 +-
net/core/sock_reuseport.c | 23 ---
net/ipv4/inet_hashtables.c | 2 +-
3
This patch adds a test for net.ipv4.tcp_migrate_req with eBPF.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
.../bpf/prog_tests/migrate_reuseport.c| 175 ++
.../bpf/progs/test_migrate_reuseport_kern.c | 53 ++
2 files changed, 228
later commits.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
Link:
https://lore.kernel.org/netdev/CAEfhGiyG8Y_amDZ2C8dQoQqjZJMHjTY76b=KBkTKcBtA=dh...@mail.gmail.com/
---
include/net/inet_connection_sock.h | 1 +
include/net/sock_reuseport.h | 2 +-
net/core/sock_r
have to use eBPF program to select a
specific listener or to cancel migration.
Kuniyuki Iwashima (8):
net: Introduce net.ipv4.tcp_migrate_req.
tcp: Keep TCP_CLOSE sockets in the reuseport group.
tcp: Migrate TCP_ESTABLISHED/TCP_SYN_RECV sockets in accept queues.
tcp: Migrate TFO requests
migrated sockets
at close() or shutdown() syscalls, so we redistribute the requests evenly.
As regards the second, we will cover in a later commit.
Reviewed-by: Benjamin Herrenschmidt
Signed-off-by: Kuniyuki Iwashima
---
include/net/inet_connection_sock.h | 12
include/net/request_sock.h
From: Jakub Sitnicki
Date: Wed, 22 Jul 2020 14:17:05 +0200
> On Wed, Jul 22, 2020 at 05:21 AM CEST, Stephen Rothwell wrote:
> > Hi all,
> >
> > Today's linux-next merge of the bpf-next tree got conflicts in:
> >
> > net/ipv4/udp.c
> > net/ipv6/udp.c
> >
> > between commit:
> >
> >
91 matches
Mail list logo