summaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.co.jp>2021-06-12 15:32:15 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2021-06-15 19:01:05 +0300
commit5c040eaf5d1753aafe12989ca712175df0b9c436 (patch)
treea030c6dce408213b2fcb578dd2ff5c345075d52e /net/ipv4
parentf9ac779f881c2ec3d1cdcd7fa9d4f9442bf60e80 (diff)
downloadlinux-5c040eaf5d1753aafe12989ca712175df0b9c436.tar.xz
tcp: Add num_closed_socks to struct sock_reuseport.
As noted in the following commit, a closed listener has to hold the reference to the reuseport group for socket migration. This patch adds a field (num_closed_socks) to struct sock_reuseport to manage closed sockets within the same reuseport group. Moreover, this and the following commits introduce some helper functions to split socks[] into two sections and keep TCP_LISTEN and TCP_CLOSE sockets in each section. Like a double-ended queue, we will place TCP_LISTEN sockets from the front and TCP_CLOSE sockets from the end. TCP_LISTEN----------> <-------TCP_CLOSE +---+---+ --- +---+ --- +---+ --- +---+ | 0 | 1 | ... | i | ... | j | ... | k | +---+---+ --- +---+ --- +---+ --- +---+ i = num_socks - 1 j = max_socks - num_closed_socks k = max_socks - 1 This patch also extends reuseport_add_sock() and reuseport_grow() to support num_closed_socks. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Eric Dumazet <edumazet@google.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20210612123224.12525-3-kuniyu@amazon.co.jp
Diffstat (limited to 'net/ipv4')
0 files changed, 0 insertions, 0 deletions