]> sourceware.org Git - newlib-cygwin.git/commit
Load balance sockets with new SO_REUSEPORT_LB option
authorsbruno <sbruno@FreeBSD.org>
Mon, 23 Apr 2018 19:51:00 +0000 (19:51 +0000)
committerSebastian Huber <sebastian.huber@embedded-brains.de>
Fri, 24 Aug 2018 13:00:04 +0000 (15:00 +0200)
commit5c636abe894466a82146994df467e6a7e8c16942
tree2a2eb4eaf61216dc07e10bbff79d4f1005143820
parent341e131f7fec9f5c1f17745bfe3c324029034348
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).

Submitted by: Johannes Lundberg <johanlun0@gmail.com>
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11003
newlib/libc/sys/rtems/include/sys/socket.h
This page took 0.029182 seconds and 5 git commands to generate.