Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Mar 2016 06:31:39 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r297180 - head/sys/dev/hyperv/netvsc
Message-ID:  <201603220631.u2M6Vd2G096744@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Tue Mar 22 06:31:39 2016
New Revision: 297180
URL: https://svnweb.freebsd.org/changeset/base/297180

Log:
  hyperv/hn: Reduce TCP segment aggregation limit for multiple RX rings
  
  This mainly used to improve ACK timeliness when multiple RX rings
  are enabled.
  
  This value gives the best performance in both Azure and Hyper-V
  environment, w/ both 10Ge and 40Ge using non-{INVARIANTS,WITNESS}
  kernel.
  
  MFC after:	1 week
  Sponsored by:	Microsoft OSTC
  Differential Revision:	https://reviews.freebsd.org/D5691

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Tue Mar 22 06:24:52 2016	(r297179)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Tue Mar 22 06:31:39 2016	(r297180)
@@ -181,6 +181,7 @@ struct hn_txdesc {
 #define HN_CSUM_ASSIST_WIN8	(CSUM_IP | CSUM_TCP)
 #define HN_CSUM_ASSIST		(CSUM_IP | CSUM_UDP | CSUM_TCP)
 
+#define HN_LRO_LENLIM_MULTIRX_DEF	(12 * ETHERMTU)
 #define HN_LRO_LENLIM_DEF		(25 * ETHERMTU)
 /* YYY 2*MTU is a bit rough, but should be good enough. */
 #define HN_LRO_LENLIM_MIN(ifp)		(2 * (ifp)->if_mtu)
@@ -530,6 +531,21 @@ netvsc_attach(device_t dev)
 	device_printf(dev, "%d TX ring, %d RX ring\n",
 	    sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse);
 
+#if __FreeBSD_version >= 1100099
+	if (sc->hn_rx_ring_inuse > 1) {
+		int i;
+
+		/*
+		 * Reduce TCP segment aggregation limit for multiple
+		 * RX rings to increase ACK timeliness.
+		 */
+		for (i = 0; i < sc->hn_rx_ring_inuse; ++i) {
+			sc->hn_rx_ring[i].hn_lro.lro_length_lim =
+			    HN_LRO_LENLIM_MULTIRX_DEF;
+		}
+	}
+#endif
+
 	if (device_info.link_state == 0) {
 		sc->hn_carrier = 1;
 	}



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