Skip to content

Instantly share code, notes, and snippets.

@postwait
Created March 26, 2013 18:40
Show Gist options
  • Select an option

  • Save postwait/5247967 to your computer and use it in GitHub Desktop.

Select an option

Save postwait/5247967 to your computer and use it in GitHub Desktop.
diff --git a/usr/src/uts/common/inet/tcp/tcp_opt_data.c b/usr/src/uts/common/inet/tcp/tcp_opt_data.c
index 460ef6d..1a5363b 100644
--- a/usr/src/uts/common/inet/tcp/tcp_opt_data.c
+++ b/usr/src/uts/common/inet/tcp/tcp_opt_data.c
@@ -269,9 +269,6 @@ optdb_obj_t tcp_opt_obj = {
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;
/*
diff --git a/usr/src/uts/common/inet/tcp/tcp_tunables.c b/usr/src/uts/common/inet/tcp/tcp_tunables.c
index a1792f7..556bf6a 100644
--- a/usr/src/uts/common/inet/tcp/tcp_tunables.c
+++ b/usr/src/uts/common/inet/tcp/tcp_tunables.c
@@ -383,7 +383,7 @@ mod_prop_info_t tcp_propinfo_tbl[] = {
{ "_slow_start_initial", MOD_PROTO_TCP,
mod_set_uint32, mod_get_uint32,
- {1, 4, 4}, {4} },
+ {1, 16, 4}, {4} },
{ "sack", MOD_PROTO_TCP,
mod_set_uint32, mod_get_uint32,
diff --git a/usr/src/uts/common/inet/tcp_impl.h b/usr/src/uts/common/inet/tcp_impl.h
index 77f9bb1..39af50c 100644
--- a/usr/src/uts/common/inet/tcp_impl.h
+++ b/usr/src/uts/common/inet/tcp_impl.h
@@ -199,12 +199,29 @@ typedef struct tcp_squeue_priv_s {
* 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.
+ *
+ * ACM SIGCOMM Computer Communications Review, vol. 40 (2010), pp. 27-33
+ * "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 4 which respects
+ * RFC 3390 exactly. However, the initial congestion window should
+ * be increased as the operator demands (via both slow_start tunables)
+ * within reason. We shall arbitrarily define reason as a maximum of 16.
*/
+
+/* 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)))); \
+ MIN(TCP_MAX_INIT_CWND * (mss), \
+ MAX(2 * (mss), 4380 / (mss) * (mss)))); \
} else { \
(tcp)->tcp_cwnd = (tcp)->tcp_init_cwnd * (mss); \
} \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment