freebsd-dev/sys/netinet6
Robert Watson 7527624efa Several years after initial development, merge prototype support for
linking NIC Receive Side Scaling (RSS) to the network stack's
connection-group implementation.  This prototype (and derived patches)
are in use at Juniper and several other FreeBSD-using companies, so
despite some reservations about its maturity, merge the patch to the
base tree so that it can be iteratively refined in collaboration rather
than maintained as a set of gradually diverging patch sets.

(1) Merge a software implementation of the Toeplitz hash specified in
    RSS implemented by David Malone.  This is used to allow suitable
    pcbgroup placement of connections before the first packet is
    received from the NIC.  Software hashing is generally avoided,
    however, due to high cost of the hash on general-purpose CPUs.

(2) In in_rss.c, maintain authoritative versions of RSS state intended
    to be pushed to each NIC, including keying material, hash
    algorithm/ configuration, and buckets.  Provide software-facing
    interfaces to hash 2- and 4-tuples for IPv4 and IPv6 using both
    the RSS standardised Toeplitz and a 'naive' variation with a hash
    efficient in software but with poor distribution properties.
    Implement rss_m2cpuid()to be used by netisr and other load
    balancing code to look up the CPU on which an mbuf should be
    processed.

(3) In the Ethernet link layer, allow netisr distribution using RSS as
    a source of policy as an alternative to source ordering; continue
    to default to direct dispatch (i.e., don't try and requeue packets
    for processing on the 'right' CPU if they arrive in a directly
    dispatchable context).

(4) Allow RSS to control tuning of connection groups in order to align
    groups with RSS buckets.  If a packet arrives on a protocol using
    connection groups, and contains a suitable hardware-generated
    hash, use that hash value to select the connection group for pcb
    lookup for both IPv4 and IPv6.  If no hardware-generated Toeplitz
    hash is available, we fall back on regular PCB lookup risking
    contention rather than pay the cost of Toeplitz in software --
    this is a less scalable but, at my last measurement, faster
    approach.  As core counts go up, we may want to revise this
    strategy despite CPU overhead.

Where device drivers suitably configure NICs, and connection groups /
RSS are enabled, this should avoid both lock and line contention during
connection lookup for TCP.  This commit does not modify any device
drivers to tune device RSS configuration to the global RSS
configuration; patches are in circulation to do this for at least
Chelsio T3 and Intel 1G/10G drivers.  Currently, the KPI for device
drivers is not particularly robust, nor aware of more advanced features
such as runtime reconfiguration/rebalancing.  This will hopefully prove
a useful starting point for refinement.

No MFC is scheduled as we will first want to nail down a more mature
and maintainable KPI/KBI for device drivers.

Sponsored by:   Juniper Networks (original work)
Sponsored by:   EMC/Isilon (patch update and merge)
2014-03-15 00:57:50 +00:00
..
dest6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
frag6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
icmp6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
icmp6.h
in6_cksum.c MFp4 bz_ipv6_fast: 2012-05-24 18:25:09 +00:00
in6_gif.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
in6_gif.h Remove __P. 2012-10-22 21:49:56 +00:00
in6_ifattach.c Add in6_prepare_ifra() function to ease preparing in-kernel IPv6 2014-01-18 20:32:59 +00:00
in6_ifattach.h Use FF02:0:0:0:0:2:FF00::/104 prefix for IPv6 Node Information Group 2013-05-04 19:16:26 +00:00
in6_mcast.c Remove KASSERT from in6p_lookup_mcast_ifp(). 2014-02-23 01:27:22 +00:00
in6_pcb.c Several years after initial development, merge prototype support for 2014-03-15 00:57:50 +00:00
in6_pcb.h Remove __P. 2012-10-22 21:49:56 +00:00
in6_pcbgroup.c Several years after initial development, merge prototype support for 2014-03-15 00:57:50 +00:00
in6_proto.c o Revamp API between flowtable and netinet, netinet6. 2014-02-07 15:18:23 +00:00
in6_rmx.c - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
in6_src.c Introduce IN6_MASK_ADDR() macro to unify various hand-rolled code 2014-01-08 22:13:32 +00:00
in6_var.h Further rework netinet6 address handling code: 2014-01-19 16:07:27 +00:00
in6.c Further rework netinet6 address handling code: 2014-01-19 16:07:27 +00:00
in6.h Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, 2014-03-12 14:29:08 +00:00
ip6_ecn.h
ip6_forward.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
ip6_id.c Provide includes that are needed in these files, and before were read 2013-10-26 18:18:50 +00:00
ip6_input.c Drop packets to multicast address whose scop field contains the 2014-02-13 14:10:44 +00:00
ip6_ipsec.c - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
ip6_ipsec.h
ip6_mroute.c Only count table lookups when we're actually processing packets. 2014-02-10 14:47:51 +00:00
ip6_mroute.h revert part of r260485 which changes how part of the header gets 2014-01-09 22:41:18 +00:00
ip6_output.c - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
ip6_var.h Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, 2014-03-12 14:29:08 +00:00
ip6.h
ip6protosw.h Remove __P. 2012-10-22 21:49:56 +00:00
mld6_var.h
mld6.c Mechanically replace direct accessing to if_xname to using if_name() macro. 2014-01-10 12:33:28 +00:00
mld6.h
nd6_nbr.c lla_lookup() does modification only when LLE_CREATE is specified. 2014-01-02 08:40:37 +00:00
nd6_rtr.c Use in6_localip() instead of hand-rolled cycle. 2014-01-18 20:54:55 +00:00
nd6.c Further simplify nd6_output_lle. 2014-02-13 19:09:04 +00:00
nd6.h Further rework netinet6 address handling code: 2014-01-19 16:07:27 +00:00
pim6_var.h Remove more constants related to static sysctl nodes. The MAXID constants 2014-02-25 18:44:33 +00:00
pim6.h
raw_ip6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
raw_ip6.h Migrate structs ip6stat, icmp6stat and rip6stat to PCPU counters. 2013-07-09 09:54:54 +00:00
route6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
scope6_var.h - Move definition of V_deembed_scopeid to scope6_var.h. 2012-12-05 19:45:24 +00:00
scope6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
sctp6_usrreq.c Changes from upstream to improve compilation when INET or INET6 2013-11-02 20:12:19 +00:00
sctp6_var.h Add support for SCTP/UDP/IPV6. 2012-11-17 20:04:04 +00:00
send.c Free mbuf in case of error. 2013-12-17 10:53:17 +00:00
send.h Use uint8_t for sockaddr sa_len. 2011-06-05 11:40:30 +00:00
tcp6_var.h Remove __P. 2012-10-22 21:49:56 +00:00
udp6_usrreq.c - For kernel compiled only with KDTRACE_HOOKS and not any lock debugging 2013-11-25 07:38:45 +00:00
udp6_var.h