public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] Load balance sockets with new SO_REUSEPORT_LB option
Date: Fri, 24 Aug 2018 13:11:00 -0000	[thread overview]
Message-ID: <20180824131125.59075.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5c636abe894466a82146994df467e6a7e8c16942

commit 5c636abe894466a82146994df467e6a7e8c16942
Author: sbruno <sbruno@FreeBSD.org>
Date:   Mon Apr 23 19:51:00 2018 +0000

    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

Diff:
---
 newlib/libc/sys/rtems/include/sys/socket.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/sys/socket.h b/newlib/libc/sys/rtems/include/sys/socket.h
index 345eaa8..19062c5 100644
--- a/newlib/libc/sys/rtems/include/sys/socket.h
+++ b/newlib/libc/sys/rtems/include/sys/socket.h
@@ -147,6 +147,9 @@ typedef	__uintptr_t	uintptr_t;
 #define	SO_NO_OFFLOAD	0x4000		/* socket cannot be offloaded */
 #define	SO_NO_DDP	0x8000		/* disable direct data placement */
 
+// XXX: so_options was only 16 bit, now globally increased to 32 bit
+#define	SO_REUSEPORT_LB	0x00010000 /* reuse with load balancing */
+
 /*
  * Additional options, not kept in so_options.
  */


             reply	other threads:[~2018-08-24 13:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24 13:11 Sebastian Huber [this message]
2018-08-24 13:11 Sebastian Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180824131125.59075.qmail@sourceware.org \
    --to=sh@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).