]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: Add reuseport_migrate_sock() to select a new listener.
authorKuniyuki Iwashima <kuniyu@amazon.co.jp>
Sat, 12 Jun 2021 12:32:17 +0000 (21:32 +0900)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 15 Jun 2021 16:01:05 +0000 (18:01 +0200)
commit0dae6f74638127f88330d64d9741f1bd6d1fe0a0
treea170e49c2fcd683a4d964fcccaf7221328376723
parentda832a21bb9bfc9307437b94a14fbf8d1dcef339
tcp: Add reuseport_migrate_sock() to select a new listener.

reuseport_migrate_sock() does the same check done in
reuseport_listen_stop_sock(). If the reuseport group is capable of
migration, reuseport_migrate_sock() selects a new listener by the child
socket hash and increments the listener's sk_refcnt beforehand. Thus, if we
fail in the migration, we have to decrement it later.

We will support migration by eBPF in the later commits.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/bpf/20210612123224.12525-5-kuniyu@amazon.co.jp
include/net/sock_reuseport.h
net/core/sock_reuseport.c