From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 01:36:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B736106564A; Thu, 2 Dec 2010 01:36:00 +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 791F48FC08; Thu, 2 Dec 2010 01:36:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB21a0tB065983; Thu, 2 Dec 2010 01:36:00 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB21a0PQ065980; Thu, 2 Dec 2010 01:36:00 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012020136.oB21a0PQ065980@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 2 Dec 2010 01:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216105 - in head/sys/netinet: . cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 01:36:00 -0000 Author: lstewart Date: Thu Dec 2 01:36:00 2010 New Revision: 216105 URL: http://svn.freebsd.org/changeset/base/216105 Log: - Reinstantiate the after_idle hook call in tcp_output(), which got lost somewhere along the way due to mismerging r211464 in our development tree. - Capture the essence of r211464 in NewReno's after_idle() hook. We don't use V_ss_fltsz/V_ss_fltsz_local yet which needs to be revisited. Sponsored by: FreeBSD Foundation Submitted by: David Hayes MFC after: 9 weeks X-MFC with: r215166 Modified: head/sys/netinet/cc/cc_newreno.c head/sys/netinet/tcp_output.c Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Thu Dec 2 01:14:45 2010 (r216104) +++ head/sys/netinet/cc/cc_newreno.c Thu Dec 2 01:36:00 2010 (r216105) @@ -216,15 +216,28 @@ newreno_post_recovery(struct cc_var *ccv void newreno_after_idle(struct cc_var *ccv) { + int rw; + /* - * We have been idle for "a while" and no acks are expected to clock out - * any data we send -- slow start to get ack "clock" running again. + * If we've been idle for more than one retransmit timeout the old + * congestion window is no longer current and we have to reduce it to + * the restart window before we can transmit again. + * + * The restart window is the initial window or the last CWND, whichever + * is smaller. + * + * This is done to prevent us from flooding the path with a full CWND at + * wirespeed, overloading router and switch buffers along the way. + * + * See RFC5681 Section 4.1. "Restarting Idle Connections". */ if (V_tcp_do_rfc3390) - CCV(ccv, snd_cwnd) = min(4 * CCV(ccv, t_maxseg), + rw = min(4 * CCV(ccv, t_maxseg), max(2 * CCV(ccv, t_maxseg), 4380)); else - CCV(ccv, snd_cwnd) = CCV(ccv, t_maxseg) * 2; + rw = CCV(ccv, t_maxseg) * 2; + + CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd)); } Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Dec 2 01:14:45 2010 (r216104) +++ head/sys/netinet/tcp_output.c Thu Dec 2 01:36:00 2010 (r216105) @@ -148,7 +148,7 @@ tcp_output(struct tcpcb *tp) { struct socket *so = tp->t_inpcb->inp_socket; long len, recwin, sendwin; - int off, flags, error, rw; + int off, flags, error; struct mbuf *m; struct ip *ip = NULL; struct ipovly *ipov = NULL; @@ -182,37 +182,8 @@ tcp_output(struct tcpcb *tp) * to send, then transmit; otherwise, investigate further. */ idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una); - if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur) { - /* - * If we've been idle for more than one retransmit - * timeout the old congestion window is no longer - * current and we have to reduce it to the restart - * window before we can transmit again. - * - * The restart window is the initial window or the last - * CWND, whichever is smaller. - * - * This is done to prevent us from flooding the path with - * a full CWND at wirespeed, overloading router and switch - * buffers along the way. - * - * See RFC5681 Section 4.1. "Restarting Idle Connections". - */ - if (V_tcp_do_rfc3390) - rw = min(4 * tp->t_maxseg, - max(2 * tp->t_maxseg, 4380)); -#ifdef INET6 - else if ((isipv6 ? in6_localaddr(&tp->t_inpcb->in6p_faddr) : - in_localaddr(tp->t_inpcb->inp_faddr))) -#else - else if (in_localaddr(tp->t_inpcb->inp_faddr)) -#endif - rw = V_ss_fltsz_local * tp->t_maxseg; - else - rw = V_ss_fltsz * tp->t_maxseg; - - tp->snd_cwnd = min(rw, tp->snd_cwnd); - } + if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur) + cc_after_idle(tp); tp->t_flags &= ~TF_LASTIDLE; if (idle) { if (tp->t_flags & TF_MORETOCOME) {