changeset 13993:6d652ac77401

3660 tcp_slow_start_* tunables should allow increasing the initial congestion window Reviewed by: Dan McDonald <danmcd@nexenta.com> Reviewed by: Sebastien Roy <sebastien.roy@delphix.com> Reviewed by: Brendan Gregg <brendan.gregg@joyent.com> Approved by: Dan McDonald <danmcd@nexenta.com>
author Theo Schlossnagle <jesus@omniti.com>
date Thu, 28 Mar 2013 12:20:55 -0400
parents 313c3db67359
children 29315ace9c5b
files usr/src/uts/common/inet/tcp/tcp_opt_data.c usr/src/uts/common/inet/tcp/tcp_tunables.c usr/src/uts/common/inet/tcp_impl.h
diffstat 3 files changed, 32 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/inet/tcp/tcp_opt_data.c	Sun Mar 24 15:59:22 2013 -0800
+++ b/usr/src/uts/common/inet/tcp/tcp_opt_data.c	Thu Mar 28 12:20:55 2013 -0400
@@ -269,9 +269,6 @@
 	tcp_valid_levels_arr	/* TCP valid level array */
 };
 
-/* Maximum TCP initial cwin (start/restart). */
-#define	TCP_MAX_INIT_CWND	16
-
 static int tcp_max_init_cwnd = TCP_MAX_INIT_CWND;
 
 /*
--- a/usr/src/uts/common/inet/tcp/tcp_tunables.c	Sun Mar 24 15:59:22 2013 -0800
+++ b/usr/src/uts/common/inet/tcp/tcp_tunables.c	Thu Mar 28 12:20:55 2013 -0400
@@ -379,11 +379,11 @@
 
 	{ "_slow_start_after_idle", MOD_PROTO_TCP,
 	    mod_set_uint32, mod_get_uint32,
-	    {1, 16384, 4}, {4} },
+	    {0, 16384, 0}, {0} },
 
 	{ "_slow_start_initial", MOD_PROTO_TCP,
 	    mod_set_uint32, mod_get_uint32,
-	    {1, 4, 4}, {4} },
+	    {0, 16, 0}, {0} },
 
 	{ "sack", MOD_PROTO_TCP,
 	    mod_set_uint32, mod_get_uint32,
--- a/usr/src/uts/common/inet/tcp_impl.h	Sun Mar 24 15:59:22 2013 -0800
+++ b/usr/src/uts/common/inet/tcp_impl.h	Thu Mar 28 12:20:55 2013 -0400
@@ -21,6 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011, Joyent Inc. All rights reserved.
+ * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
  */
 
 #ifndef	_INET_TCP_IMPL_H
@@ -199,12 +200,39 @@
  * should be 0 and we use the formula in RFC 3390 to set tcp_cwnd.
  * If the upper layer has changed set the tcp_init_cwnd, just use
  * it to calculate the tcp_cwnd.
+ *
+ * "An Argument for Increasing TCP's Initial Congestion Window"
+ * ACM SIGCOMM Computer Communications Review, vol. 40 (2010), pp. 27-33
+ *  -- Nandita Dukkipati, Tiziana Refice, Yuchung Cheng,
+ *     Hsiao-keng Jerry Chu, Tom Herbert, Amit Agarwal,
+ *     Arvind Jain, Natalia Sutin
+ *
+ *   "Based on the results from our experiments, we believe the
+ *    initial congestion window should be at least ten segments
+ *    and the same be investigated for standardization by the IETF."
+ *
+ * As such, the def_max_init_cwnd argument with which this macro is
+ * invoked is either the tcps_slow_start_initial or
+ * tcps_slow_start_after_idle which both default to 0 and will respect
+ * RFC 3390 exactly.  If the tunables are explicitly set by the operator,
+ * then the initial congestion window should be set as the operator
+ * demands, within reason. We shall arbitrarily define reason as a
+ * maximum of 16 (same as used by the TCP_INIT_CWND setsockopt).
  */
+
+/* Maximum TCP initial cwin (start/restart). */
+#define	TCP_MAX_INIT_CWND	16
+
 #define	TCP_SET_INIT_CWND(tcp, mss, def_max_init_cwnd)			\
 {									\
 	if ((tcp)->tcp_init_cwnd == 0) {				\
-		(tcp)->tcp_cwnd = MIN(def_max_init_cwnd * (mss),	\
-		    MIN(4 * (mss), MAX(2 * (mss), 4380 / (mss) * (mss)))); \
+		if (def_max_init_cwnd == 0) {				\
+			(tcp)->tcp_cwnd = MIN(4 * (mss),		\
+			    MAX(2 * (mss), 4380 / (mss) * (mss)));	\
+		} else {						\
+			(tcp)->tcp_cwnd = MIN(TCP_MAX_INIT_CWND * (mss),\
+			    def_max_init_cwnd * (mss));			\
+		}							\
 	} else {							\
 		(tcp)->tcp_cwnd = (tcp)->tcp_init_cwnd * (mss);		\
 	}								\