sbruno d0aeaa5af7 Load balance sockets with new SO_REUSEPORT_LB option.
This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple
programs or threads to bind to the same port and incoming connections will be
load balanced using a hash function.

Most of the code was copied from a similar patch for DragonflyBSD.

However, in DragonflyBSD, load balancing is a global on/off setting and can not
be set per socket. This patch allows for simultaneous use of both the current
SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system.

Required changes to structures:
Globally change so_options from 16 to 32 bit value to allow for more options.
Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets.

Limitations:
As DragonflyBSD, a load balance group is limited to 256 pcbs (256 programs or
threads sharing the same socket).

This is a substantially different contribution as compared to its original
incarnation at svn r332894 and reverted at svn r332967.  Thanks to rwatson@
for the substantive feedback that is included in this commit.

Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Obtained from:	DragonflyBSD
Relnotes:	Yes
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D11003
2018-06-06 15:45:57 +00:00
..
2017-10-31 00:07:04 +00:00
2018-01-24 14:24:17 +00:00
2017-12-27 21:36:37 +00:00
2018-03-29 19:43:29 +00:00
2018-04-27 13:59:24 +00:00
2018-03-21 14:37:04 +00:00
2018-05-18 06:10:16 +00:00
2018-05-20 05:59:42 +00:00
2018-05-23 17:01:28 +00:00
2018-05-28 02:10:35 +00:00
2018-05-01 16:30:48 +00:00
2018-06-02 22:40:16 +00:00
2018-05-23 01:20:31 +00:00
2018-03-18 03:42:57 +00:00