]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Implement the first stage of multi-bind listen sockets and RSS socket
authorAdrian Chadd <adrian@FreeBSD.org>
Thu, 10 Jul 2014 03:10:56 +0000 (03:10 +0000)
committerAdrian Chadd <adrian@FreeBSD.org>
Thu, 10 Jul 2014 03:10:56 +0000 (03:10 +0000)
commit0a100a6f1ee5bdf9c988458e76d40465b93a02ad
tree21bb8e1a8ebbd895dbff311f16a178664eae162d
parent23f02598b8a7c41d1bef86ef339e25a39658d7e4
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.
sys/netinet/in.h
sys/netinet/in_pcb.c
sys/netinet/in_pcb.h
sys/netinet/in_pcbgroup.c
sys/netinet/ip_output.c