]> git.baikalelectronics.ru Git - kernel.git/commit
soreuseport: define reuseport groups
authorCraig Gallek <kraig@google.com>
Mon, 4 Jan 2016 22:41:45 +0000 (17:41 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jan 2016 03:49:58 +0000 (22:49 -0500)
commitb06a0483480546f30c0c4030f227a9ec3b0814c1
treecadc1049482ed0c976bb436c854fec15be5053c2
parent89a01220ae9085ac799c5a5751654297d6ea0ae1
soreuseport: define reuseport groups

struct sock_reuseport is an optional shared structure referenced by each
socket belonging to a reuseport group.  When a socket is bound to an
address/port not yet in use and the reuseport flag has been set, the
structure will be allocated and attached to the newly bound socket.
When subsequent calls to bind are made for the same address/port, the
shared structure will be updated to include the new socket and the
newly bound socket will reference the group structure.

Usually, when an incoming packet was destined for a reuseport group,
all sockets in the same group needed to be considered before a
dispatching decision was made.  With this structure, an appropriate
socket can be found after looking up just one socket in the group.

This shared structure will also allow for more complicated decisions to
be made when selecting a socket (eg a BPF filter).

This work is based off a similar implementation written by
Ying Cai <ycai@google.com> for implementing policy-based reuseport
selection.

Signed-off-by: Craig Gallek <kraig@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
include/net/sock_reuseport.h [new file with mode: 0644]
net/core/Makefile
net/core/sock_reuseport.c [new file with mode: 0644]