Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jun 2011 12:55:02 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/conf files options src/sys/netinet in_pcb.c in_pcb.h in_pcbgroup.c ip_divert.c raw_ip.c tcp_subr.c tcp_syncache.c udp_usrreq.c src/sys/netinet/ipfw ip_fw2.c src/sys/netinet6 in6_pcb.c in6_pcb.h in6_pcbgroup.c
Message-ID:  <201106061255.p56Ctbog061413@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

rwatson     2011-06-06 12:55:02 UTC

  FreeBSD src repository

  Modified files:
    sys/conf             files options 
    sys/netinet          in_pcb.c in_pcb.h ip_divert.c raw_ip.c 
                         tcp_subr.c tcp_syncache.c udp_usrreq.c 
    sys/netinet/ipfw     ip_fw2.c 
    sys/netinet6         in6_pcb.c in6_pcb.h 
  Added files:
    sys/netinet          in_pcbgroup.c 
    sys/netinet6         in6_pcbgroup.c 
  Log:
  SVN rev 222748 on 2011-06-06 12:55:02Z by rwatson
  
  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.
  
  Revision  Changes    Path
  1.1605    +2 -0      src/sys/conf/files
  1.731     +1 -0      src/sys/conf/options
  1.281     +225 -4    src/sys/netinet/in_pcb.c
  1.151     +82 -4     src/sys/netinet/in_pcb.h
  1.1       +457 -0    src/sys/netinet/in_pcbgroup.c (new)
  1.171     +2 -1      src/sys/netinet/ip_divert.c
  1.56      +4 -0      src/sys/netinet/ipfw/ip_fw2.c
  1.237     +2 -1      src/sys/netinet/raw_ip.c
  1.380     +2 -1      src/sys/netinet/tcp_subr.c
  1.190     +8 -1      src/sys/netinet/tcp_syncache.c
  1.280     +2 -1      src/sys/netinet/udp_usrreq.c
  1.127     +167 -0    src/sys/netinet6/in6_pcb.c
  1.28      +10 -0     src/sys/netinet6/in6_pcb.h
  1.1       +103 -0    src/sys/netinet6/in6_pcbgroup.c (new)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106061255.p56Ctbog061413>