freebsd-dev/sys/net
Matt Macy d7c5a620e2 ifnet: Replace if_addr_lock rwlock with epoch + mutex
Run on LLNW canaries and tested by pho@

gallatin:
Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5
based ConnectX 4-LX NIC, I see an almost 12% improvement in received
packet rate, and a larger improvement in bytes delivered all the way
to userspace.

When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1,
I see, using nstat -I mce0 1 before the patch:

InMpps OMpps  InGbs  OGbs err TCP Est %CPU syscalls csw     irq GBfree
4.98   0.00   4.42   0.00 4235592     33   83.80 4720653 2149771   1235 247.32
4.73   0.00   4.20   0.00 4025260     33   82.99 4724900 2139833   1204 247.32
4.72   0.00   4.20   0.00 4035252     33   82.14 4719162 2132023   1264 247.32
4.71   0.00   4.21   0.00 4073206     33   83.68 4744973 2123317   1347 247.32
4.72   0.00   4.21   0.00 4061118     33   80.82 4713615 2188091   1490 247.32
4.72   0.00   4.21   0.00 4051675     33   85.29 4727399 2109011   1205 247.32
4.73   0.00   4.21   0.00 4039056     33   84.65 4724735 2102603   1053 247.32

After the patch

InMpps OMpps  InGbs  OGbs err TCP Est %CPU syscalls csw     irq GBfree
5.43   0.00   4.20   0.00 3313143     33   84.96 5434214 1900162   2656 245.51
5.43   0.00   4.20   0.00 3308527     33   85.24 5439695 1809382   2521 245.51
5.42   0.00   4.19   0.00 3316778     33   87.54 5416028 1805835   2256 245.51
5.42   0.00   4.19   0.00 3317673     33   90.44 5426044 1763056   2332 245.51
5.42   0.00   4.19   0.00 3314839     33   88.11 5435732 1792218   2499 245.52
5.44   0.00   4.19   0.00 3293228     33   91.84 5426301 1668597   2121 245.52

Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch

Reviewed by:	gallatin
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15366
2018-05-18 20:13:34 +00:00
..
altq kernel: Fix several typos and minor errors 2017-12-27 03:23:21 +00:00
bpf_buffer.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
bpf_buffer.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
bpf_filter.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
bpf_jitter.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
bpf_jitter.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
bpf_zerocopy.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
bpf_zerocopy.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
bpf.c Use dead_bpf_if instead of bp_null. 2018-04-24 17:42:25 +00:00
bpf.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
bpfdesc.h Make BPF global lock an SX 2018-04-10 19:42:50 +00:00
bridgestp.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
bridgestp.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
dlt.h MFV r313759: license change for a few headers (4 clause BSD to 3 clause BSD). 2017-02-15 07:22:47 +00:00
ethernet.h Allow to specify PCP on packets not belonging to any VLAN. 2018-03-27 15:29:32 +00:00
firewire.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ieee8023ad_lacp.c Added missing CTLFLAG_VNET to lacp default_strict_mode 2018-01-24 10:13:14 +00:00
ieee8023ad_lacp.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
ieee_oui.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_arp.h Remove support for the Arcnet protocol. 2018-04-13 21:18:04 +00:00
if_bridge.c Allow different bridge types to coexist 2018-05-11 05:00:40 +00:00
if_bridgevar.h Allow different bridge types to coexist 2018-05-11 05:00:40 +00:00
if_clone.c iflib(9): Add support for cloning pseudo interfaces 2018-05-11 20:08:28 +00:00
if_clone.h iflib(9): Add support for cloning pseudo interfaces 2018-05-11 20:08:28 +00:00
if_dead.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_debug.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_disc.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
if_dl.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
if_edsc.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
if_enc.c netpfil: Introduce PFIL_FWD flag 2018-03-23 16:56:44 +00:00
if_enc.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_epair.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_ethersubr.c Allow different bridge types to coexist 2018-05-11 05:00:40 +00:00
if_fwsubr.c Improve copy-and-pasted versions of SIOCGIFADDR. 2018-03-27 20:51:49 +00:00
if_gif.c Use an accessor function to access ifr_data. 2018-03-30 18:50:13 +00:00
if_gif.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
if_gre.c Use an accessor function to access ifr_data. 2018-03-30 18:50:13 +00:00
if_gre.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_ipsec.c Apply the change from r272770 to if_ipsec(4) interface. 2018-05-11 16:50:25 +00:00
if_ipsec.h Merge projects/ipsec into head/. 2017-02-06 08:49:57 +00:00
if_lagg.c ifnet: Replace if_addr_lock rwlock with epoch + mutex 2018-05-18 20:13:34 +00:00
if_lagg.h Replace rmlock with epoch in lagg 2018-05-14 20:06:49 +00:00
if_llatbl.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_llatbl.h Fix outgoing TCP/UDP packet drop on arp/ndp entry expiration. 2018-03-17 17:05:48 +00:00
if_llc.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
if_loop.c Add IFCAP_LINKSTATE support to if_loop(4). 2018-05-09 10:50:51 +00:00
if_me.c Do not adjust interface MTU automatically. Leave this task to the system 2017-04-11 08:56:18 +00:00
if_media.c Finish removing FDDI and tokenring media support. 2018-04-23 21:10:33 +00:00
if_media.h Finish removing FDDI and tokenring media support. 2018-04-23 21:10:33 +00:00
if_mib.c These files were getting sys/malloc.h and vm/uma.h with header pollution 2016-02-01 17:41:21 +00:00
if_mib.h
if_pflog.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_pfsync.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_sppp.h sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
if_spppfr.c
if_spppsubr.c ifnet: Replace if_addr_lock rwlock with epoch + mutex 2018-05-18 20:13:34 +00:00
if_stf.c ifnet: Replace if_addr_lock rwlock with epoch + mutex 2018-05-18 20:13:34 +00:00
if_tap.c ifnet: Replace if_addr_lock rwlock with epoch + mutex 2018-05-18 20:13:34 +00:00
if_tap.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_tapvar.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
if_tun.c ifnet: Replace if_addr_lock rwlock with epoch + mutex 2018-05-18 20:13:34 +00:00
if_tun.h Allow an MTU of 65535 bytes to be set via TUN[SG]IFINFO. This requires 2016-05-24 11:47:14 +00:00
if_types.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
if_var.h ifnet: Replace if_addr_lock rwlock with epoch + mutex 2018-05-18 20:13:34 +00:00
if_vlan_var.h Allow to specify PCP on packets not belonging to any VLAN. 2018-03-27 15:29:32 +00:00
if_vlan.c ifnet: Replace if_addr_lock rwlock with epoch + mutex 2018-05-18 20:13:34 +00:00
if_vxlan.c Add macro for vxlan list mutex lock and unlock 2017-12-30 19:49:40 +00:00
if_vxlan.h Add support for IPv6 scoped addresses to vxlan 2017-12-30 04:03:53 +00:00
if.c ifnet: Replace if_addr_lock rwlock with epoch + mutex 2018-05-18 20:13:34 +00:00
if.h iflib(9): Add support for cloning pseudo interfaces 2018-05-11 20:08:28 +00:00
ifdi_if.m iflib(9): Add support for cloning pseudo interfaces 2018-05-11 20:08:28 +00:00
iflib_clone.c iflib(9): Add support for cloning pseudo interfaces 2018-05-11 20:08:28 +00:00
iflib_private.h Work around lack of TX IRQs in iflib for netmap 2018-05-16 21:03:22 +00:00
iflib.c Fix !netmap build post r333686 2018-05-16 22:25:47 +00:00
iflib.h iflib(9): Add support for cloning pseudo interfaces 2018-05-11 20:08:28 +00:00
ifq.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
mp_ring.c Have ifmp_ring_enqueue() abdicate instead of switch to a consumer 2017-09-23 16:46:30 +00:00
mp_ring.h Import the 'iflib' API library for network drivers. From the author: 2016-05-18 04:35:58 +00:00
mppc.h ng_mppc(4): Bring netgraph(3) MPPC compression support. 2016-06-07 15:07:00 +00:00
mppcc.c ng_mppc(4):: basic readability cleanups. 2016-07-09 02:33:45 +00:00
mppcd.c ng_mppc(4):: basic readability cleanups. 2016-07-09 02:33:45 +00:00
netisr_internal.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
netisr.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
netisr.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
netmap_legacy.h netmap: align codebase to the current upstream (commit id 3fb001303718146) 2018-04-12 07:20:50 +00:00
netmap_user.h netmap: align codebase to the current upstream (commit id 3fb001303718146) 2018-04-12 07:20:50 +00:00
netmap_virt.h netmap: align codebase to the current upstream (commit id 3fb001303718146) 2018-04-12 07:20:50 +00:00
netmap.h netmap: align codebase to the current upstream (commit id 3fb001303718146) 2018-04-12 07:20:50 +00:00
paravirt.h
pfil.c netpfil: Introduce PFIL_FWD flag 2018-03-23 16:56:44 +00:00
pfil.h netpfil: Introduce PFIL_FWD flag 2018-03-23 16:56:44 +00:00
pfkeyv2.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
pfvar.h pf: Improve ioctl validation for DIOCRGETTABLES, DIOCRGETTSTATS, DIOCRCLRTSTATS and DIOCRSETTFLAGS 2018-04-06 15:54:30 +00:00
ppp_defs.h
radix_mpath.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
radix_mpath.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
radix.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
radix.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
raw_cb.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
raw_cb.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
raw_usrreq.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
rndis.h rndis: Add LINK_SPEED_CHANGE status 2017-07-24 03:59:50 +00:00
route_var.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
route.c Use NULL for SYSINIT's last arg, which is a pointer type 2018-05-18 17:58:09 +00:00
route.h Reduce code duplication for inpcb route caching 2018-01-23 03:15:39 +00:00
rss_config.c rss: Remove never defined UDP_IPV4_EX 2017-10-11 06:08:01 +00:00
rss_config.h rss: Remove never defined UDP_IPV4_EX 2017-10-11 06:08:01 +00:00
rtsock.c ifnet: Replace if_addr_lock rwlock with epoch + mutex 2018-05-18 20:13:34 +00:00
sff8436.h Add SFF-8024 Extended Specification Compliance 2015-12-28 09:26:07 +00:00
sff8472.h ifconfig(8): Display extended compliance code string for SFP transceivers 2017-12-05 18:42:07 +00:00
slcompress.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
slcompress.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
toeplitz.c
toeplitz.h
vnet.c Use NULL for SYSINIT's last arg, which is a pointer type 2018-05-18 17:58:09 +00:00
vnet.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00