From owner-svn-src-projects@FreeBSD.ORG Wed Oct 22 07:06:39 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C333106567D; Wed, 22 Oct 2008 07:06:39 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B02E8FC0C; Wed, 22 Oct 2008 07:06:39 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9M76cGL021743; Wed, 22 Oct 2008 07:06:38 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9M76cnS021741; Wed, 22 Oct 2008 07:06:38 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <200810220706.m9M76cnS021741@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 22 Oct 2008 07:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184152 - projects/tcp_cc_8.x/sys/netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 07:06:39 -0000 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<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)