svn commit: r268479 - head/sys/netinet
Bjoern A. Zeeb
bz at FreeBSD.org
Thu Jul 10 10:11:16 UTC 2014
On 10 Jul 2014, at 03:10 , Adrian Chadd <adrian at freebsd.org> wrote:
> Author: adrian
> Date: Thu Jul 10 03:10:56 2014
> New Revision: 268479
> URL: http://svnweb.freebsd.org/changeset/base/268479
>
> Log:
> Implement the first stage of multi-bind listen sockets and RSS socket
> awareness.
>
> * Introduce IP_BINDMULTI - indicating that it's okay to bind multiple
> sockets on the same bind details.
>
> Although the PCB code has been taught about this (see below) this patch
> doesn't introduce the rest of the PCB changes necessary to distribute
> lookups among multiple PCB entries in the global wildcard table.
>
> * Introduce IP_RSS_LISTEN_BUCKET - placing an listen socket into the
> given RSS bucket (and thus a single PCBGROUP hash.)
>
> * Modify the PCB add path to be aware of IP_BINDMULTI:
> + Only allow further PCB entries to be added if the owner credentials
> and IP_BINDMULTI has been specified. Ie, only allow further
> IP_BINDMULTI sockets to appear if the first bind() was IP_BINDMULTI.
>
> * Teach the PCBGROUP code about IP_RSS_LISTE_BUCKET marked PCB entries.
> Instead of using the wildcard logic and hashing, these sockets are
> simply placed into the PCBGROUP and _not_ in the wildcard hash.
>
> * When doing a PCBGROUP lookup, also do a wildcard match as well.
> This allows for an RSS bucket PCB entry to appear in a PCBGROUP
> rather than having to exist in the wildcard list.
>
> Tested:
>
> * TCP IPv4 server testing with igb(4)
> * TCP IPv4 server testing with ix(4)
>
> TODO:
>
> * The pcbgroup lookup code duplicated the wildcard and wildcard-PCB
> logic. This could be refactored into a single function.
>
> * This doesn't yet work for IPv6 (The PCBGROUP code in netinet6/ doesn't
> yet know about this); nor does it yet fully work for UDP.
Is there any intention to bring the feature parity in the close future? I am tired of fixing this kind of stuff 6 years later; been there, had to do that too often.
> Modified: head/sys/netinet/in_pcb.h
> ==============================================================================
> --- head/sys/netinet/in_pcb.h Thu Jul 10 02:15:16 2014 (r268478)
> +++ head/sys/netinet/in_pcb.h Thu Jul 10 03:10:56 2014 (r268479)
> @@ -181,7 +181,8 @@ struct inpcb {
> u_int inp_refcount; /* (i) refcount */
> void *inp_pspare[5]; /* (x) route caching / general use */
> uint32_t inp_flowtype; /* (x) M_HASHTYPE value */
> - u_int inp_ispare[5]; /* (x) route caching / user cookie /
> + uint32_t inp_rss_listen_bucket; /* (x) overridden RSS listen bucket */
> + u_int inp_ispare[4]; /* (x) route caching / user cookie /
> * general use */
Please do not use spares that were not reserved for you.
—
Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983
More information about the svn-src-head
mailing list