Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 2008 07:06:38 +0000 (UTC)
From:      Lawrence Stewart <lstewart@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r184152 - projects/tcp_cc_8.x/sys/netinet
Message-ID:  <200810220706.m9M76cnS021741@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lstewart
Date: Wed Oct 22 07:06:38 2008
New Revision: 184152
URL: http://svn.freebsd.org/changeset/base/184152

Log:
  Move a comment from tcp_input() into the modular cc code and fold in the New Reno cwnd
  fix from r182885 that I'd forgotten about.

Modified:
  projects/tcp_cc_8.x/sys/netinet/cc.c
  projects/tcp_cc_8.x/sys/netinet/tcp_input.c

Modified: projects/tcp_cc_8.x/sys/netinet/cc.c
==============================================================================
--- projects/tcp_cc_8.x/sys/netinet/cc.c	Wed Oct 22 02:08:54 2008	(r184151)
+++ projects/tcp_cc_8.x/sys/netinet/cc.c	Wed Oct 22 07:06:38 2008	(r184152)
@@ -333,8 +333,15 @@ newreno_ack_received(struct tcpcb *tp, s
 	u_int cw = tp->snd_cwnd;
 	u_int incr = tp->t_maxseg;
 
+	/*
+	 * If cwnd <= ssthresh, open exponentially (maxseg per packet).
+	 * Otherwise, open linearly (approx. maxseg per RTT
+	 * i.e. maxseg^2 / cwnd per ACK received).
+	 * If cwnd > maxseg^2, fix the cwnd increment at 1 byte
+	 * to avoid capping cwnd (as suggested in RFC2581).
+	 */
 	if (cw > tp->snd_ssthresh)
-		incr = incr * incr / cw;
+		incr = max((incr * incr / cw), 1);
 
 	tp->snd_cwnd = min(cw+incr, TCP_MAXWIN<<tp->snd_scale);
 }

Modified: projects/tcp_cc_8.x/sys/netinet/tcp_input.c
==============================================================================
--- projects/tcp_cc_8.x/sys/netinet/tcp_input.c	Wed Oct 22 02:08:54 2008	(r184151)
+++ projects/tcp_cc_8.x/sys/netinet/tcp_input.c	Wed Oct 22 07:06:38 2008	(r184152)
@@ -2093,12 +2093,8 @@ process_ACK:
 
 		/*
 		 * When new data is acked, open the congestion window.
-		 * If the window gives us less than ssthresh packets
-		 * in flight, open exponentially (maxseg per packet).
-		 * Otherwise open linearly: maxseg per window
-		 * (maxseg^2 / cwnd per packet).
-		 * If cwnd > maxseg^2, fix the cwnd increment at 1 byte
-		 * to avoid capping cwnd (as suggested in RFC2581).
+		 * The specifics of how this is achieved are up to the
+		 * congestion control algorithm in use for this connection.
 		 */
 		if (!IN_FASTRECOVERY(tp)) {
 			if (CC_ALGO(tp)->ack_received)



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