tcp: Increase IW to 2 segments, if RFC3390 is not enabled.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 11 Apr 2012 09:57:43 +0000 (17:57 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 11 Apr 2012 10:28:46 +0000 (18:28 +0800)
First of all, RFC2581 allows this.  Additionally, it is intended to
fix sender and receiver deadlock before delayed ACK timer expires.
Add comment about these.

sys/netinet/tcp_subr.c

index 706b82a..c3d2452 100644 (file)
@@ -1962,10 +1962,17 @@ tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq)
 u_long
 tcp_initial_window(const struct tcpcb *tp)
 {
-       if (tcp_do_rfc3390)
+       if (tcp_do_rfc3390) {
                return min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380));
-       else
-               return tp->t_maxseg;
+       } else {
+               /*
+                * Even RFC2581 (back to 1999) allows 2*SMSS IW.
+                *
+                * Mainly to avoid sender and receiver deadlock
+                * until delayed ACK timer expires.
+                */
+               return (2 * tp->t_maxseg);
+       }
 }
 
 #ifdef TCP_SIGNATURE