aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/in_pcb.h
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2014-07-10 03:10:56 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2014-07-10 03:10:56 +0000
commit0a100a6f1ee5bdf9c988458e76d40465b93a02ad (patch)
tree21bb8e1a8ebbd895dbff311f16a178664eae162d /sys/netinet/in_pcb.h
parent23f02598b8a7c41d1bef86ef339e25a39658d7e4 (diff)
downloadsrc-0a100a6f1ee5bdf9c988458e76d40465b93a02ad.tar.gz
src-0a100a6f1ee5bdf9c988458e76d40465b93a02ad.zip
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.
Notes
Notes: svn path=/head/; revision=268479
Diffstat (limited to 'sys/netinet/in_pcb.h')
-rw-r--r--sys/netinet/in_pcb.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 7cfc72a43778..350b962f90dd 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -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 */
/* Local and foreign ports, local and foreign addr. */
@@ -546,6 +547,8 @@ short inp_so_options(const struct inpcb *inp);
#define INP_REUSEPORT 0x00000008 /* SO_REUSEPORT option is set */
#define INP_FREED 0x00000010 /* inp itself is not valid */
#define INP_REUSEADDR 0x00000020 /* SO_REUSEADDR option is set */
+#define INP_BINDMULTI 0x00000040 /* IP_BINDMULTI option is set */
+#define INP_RSS_BUCKET_SET 0x00000080 /* IP_RSS_LISTEN_BUCKET is set */
/*
* Flags passed to in_pcblookup*() functions.