]> 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)
commit0f1dae6949e65d39f37254b9ce2c1a90fdcb9faf
treea170e49c2fcd683a4d964fcccaf7221328376723
parent32c791dbe0aee280c6a992c8a9dccb6d48f0a804
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