freebsd-skq/sys/netinet6
Robert Watson 52cd27cb58 Implement a CPU-affine TCP and UDP connection lookup data structure,
struct inpcbgroup.  pcbgroups, or "connection groups", supplement the
existing inpcbinfo connection hash table, which when pcbgroups are
enabled, might now be thought of more usefully as a per-protocol
4-tuple reservation table.

Connections are assigned to connection groups base on a hash of their
4-tuple; wildcard sockets require special handling, and are members
of all connection groups.  During a connection lookup, a
per-connection group lock is employed rather than the global pcbinfo
lock.  By aligning connection groups with input path processing,
connection groups take on an effective CPU affinity, especially when
aligned with RSS work placement (see a forthcoming commit for
details).  This eliminates cache line migration associated with
global, protocol-layer data structures in steady state TCP and UDP
processing (with the exception of protocol-layer statistics; further
commit to follow).

Elements of this approach were inspired by Willman, Rixner, and Cox's
2006 USENIX paper, "An Evaluation of Network Stack Parallelization
Strategies in Modern Operating Systems".  However, there are also
significant differences: we maintain the inpcb lock, rather than using
the connection group lock for per-connection state.

Likewise, the focus of this implementation is alignment with NIC
packet distribution strategies such as RSS, rather than pure software
strategies.  Despite that focus, software distribution is supported
through the parallel netisr implementation, and works well in
configurations where the number of hardware threads is greater than
the number of NIC input queues, such as in the RMI XLR threaded MIPS
architecture.

Another important difference is the continued maintenance of existing
hash tables as "reservation tables" -- these are useful both to
distinguish the resource allocation aspect of protocol name management
and the more common-case lookup aspect.  In configurations where
connection tables are aligned with hardware hashes, it is desirable to
use the traditional lookup tables for loopback or encapsulated traffic
rather than take the expense of hardware hashes that are hard to
implement efficiently in software (such as RSS Toeplitz).

Connection group support is enabled by compiling "options PCBGROUP"
into your kernel configuration; for the time being, this is an
experimental feature, and hence is not enabled by default.

Subject to the limited MFCability of change dependencies in inpcb,
and its change to the inpcbinfo init function signature, this change
in principle could be merged to FreeBSD 8.x.

Reviewed by:    bz
Sponsored by:   Juniper Networks, Inc.
2011-06-06 12:55:02 +00:00
..
dest6.c Merge the remainder of kern_vimage.c and vimage.h into vnet.c and 2009-08-01 19:26:27 +00:00
frag6.c After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
icmp6.c After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
icmp6.h
in6_cksum.c Fix more continuous/contiguous typos (cf. r215955) 2010-11-27 21:51:39 +00:00
in6_gif.c MFP4: @176978-176982, 176984, 176990-176994, 177441 2010-04-29 11:52:42 +00:00
in6_gif.h
in6_ifattach.c Add IFT_L2VLAN to the list that is capable of supplying the ingredients 2010-12-22 11:58:31 +00:00
in6_ifattach.h
in6_mcast.c Adapt r197136 to IPv6 stack: 2009-11-19 13:39:07 +00:00
in6_pcb.c Implement a CPU-affine TCP and UDP connection lookup data structure, 2011-06-06 12:55:02 +00:00
in6_pcb.h Implement a CPU-affine TCP and UDP connection lookup data structure, 2011-06-06 12:55:02 +00:00
in6_pcbgroup.c Implement a CPU-affine TCP and UDP connection lookup data structure, 2011-06-06 12:55:02 +00:00
in6_proto.c - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
in6_rmx.c After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
in6_src.c Decompose the current single inpcbinfo lock into two locks: 2011-05-30 09:43:55 +00:00
in6_var.h MFP4: @176978-176982, 176984, 176990-176994, 177441 2010-04-29 11:52:42 +00:00
in6.c - Make the code more proactively clear an ND6_IFF_IFDISABLED flag when 2011-06-06 02:37:38 +00:00
in6.h - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
ip6_ecn.h
ip6_forward.c Virtualize the pfil hooks so that different jails may chose different 2009-10-11 05:59:43 +00:00
ip6_id.c
ip6_input.c Fix more continuous/contiguous typos (cf. r215955) 2010-11-27 21:51:39 +00:00
ip6_ipsec.c Make IPsec compile without INET adding appropriate #ifdef checks. 2011-04-27 19:28:42 +00:00
ip6_ipsec.h
ip6_mroute.c After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
ip6_mroute.h Switch cmd argument to u_long. This matches what if_ethersubr.c does and 2009-06-21 10:29:31 +00:00
ip6_output.c Fix more continuous/contiguous typos (cf. r215955) 2010-11-27 21:51:39 +00:00
ip6_var.h - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
ip6.h
ip6protosw.h Introduce an infrastructure for dismantling vnet instances. 2009-06-08 17:15:40 +00:00
mld6_var.h Use ALLOW_NEW_SOURCES and BLOCK_OLD_SOURCES to signal a join or leave 2009-12-22 20:40:22 +00:00
mld6.c After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
mld6.h Add MLDv2 protocol header, but do not connect it to the build. 2009-04-29 11:31:23 +00:00
nd6_nbr.c - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
nd6_rtr.c - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
nd6.c Do not activate automatic LL addr configuration when 0/1->1 transition of 2011-06-06 04:12:57 +00:00
nd6.h - Accept Router Advertisement messages even when net.inet6.ip6.forwarding=1. 2011-06-06 02:14:23 +00:00
pim6_var.h
pim6.h
raw_ip6.c optp may be NULL. 2010-08-20 17:52:49 +00:00
raw_ip6.h Remove unused VNET_SET() and related macros; only VNET_GET() is 2009-07-16 21:13:04 +00:00
route6.c Merge the remainder of kern_vimage.c and vimage.h into vnet.c and 2009-08-01 19:26:27 +00:00
scope6_var.h
scope6.c After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
sctp6_usrreq.c Remove code with any effect. 2011-05-03 20:34:02 +00:00
sctp6_var.h 1) Typo correction in comments and one spacing change. 2011-02-05 12:12:51 +00:00
send.c After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
send.h Use uint8_t for sockaddr sa_len. 2011-06-05 11:40:30 +00:00
tcp6_var.h Remove unused VNET_SET() and related macros; only VNET_GET() is 2009-07-16 21:13:04 +00:00
udp6_usrreq.c Add _mbuf() variants of various inpcb-related interfaces, including lookup, 2011-06-04 16:33:06 +00:00
udp6_var.h