Date: Tue, 24 Apr 2018 15:18:28 -0400 From: Mark Johnston <markj@FreeBSD.org> To: Sean Bruno <sbruno@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332894 - in head: cddl/lib/libdtrace sys/kern sys/netinet sys/netinet6 sys/sys Message-ID: <20180424191828.GA8078@raichu> In-Reply-To: <201804231951.w3NJp0Se084895@repo.freebsd.org> References: <201804231951.w3NJp0Se084895@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 23, 2018 at 07:51:00PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Mon Apr 23 19:51:00 2018 > New Revision: 332894 > URL: https://svnweb.freebsd.org/changeset/base/332894 > > Log: > 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 > > Modified: > head/cddl/lib/libdtrace/tcp.d > head/sys/kern/uipc_debug.c > head/sys/kern/uipc_socket.c > head/sys/netinet/in_pcb.c > head/sys/netinet/in_pcb.h > head/sys/netinet/ip_output.c > head/sys/netinet/tcp_subr.c > head/sys/netinet/udp_usrreq.c > head/sys/netinet6/in6_pcb.c > head/sys/netinet6/in6_src.c > head/sys/netinet6/ip6_output.c > head/sys/netinet6/udp6_usrreq.c > head/sys/sys/socket.h > head/sys/sys/socketvar.h > > Modified: head/cddl/lib/libdtrace/tcp.d > ============================================================================== > --- head/cddl/lib/libdtrace/tcp.d Mon Apr 23 18:33:26 2018 (r332893) > +++ head/cddl/lib/libdtrace/tcp.d Mon Apr 23 19:51:00 2018 (r332894) > @@ -192,12 +192,12 @@ translator tcpsinfo_t < struct tcpcb *p > { > tcps_rport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_fport); > tcps_laddr = p == NULL ? 0 : > p->t_inpcb->inp_vflag == INP_IPV4 ? > - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.ie46_local.ia46_addr4.s_addr) : > - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.ie6_local); > + inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : > + inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id6_addr); > tcps_raddr = p == NULL ? 0 : > p->t_inpcb->inp_vflag == INP_IPV4 ? > - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie46_foreign.ia46_addr4.s_addr) : > - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie6_foreign); > + inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : > + inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id6_addr); > tcps_state = p == NULL ? -1 : p->t_state; > tcps_iss = p == NULL ? 0 : p->iss; > tcps_irs = p == NULL ? 0 : p->irs; A similar change is needed in udp.d. Without it, libdtrace fails to compile its libraries when initializing a consumer, so dtrace(1) is currently unusable on head without "-x nolibs".
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180424191828.GA8078>