From owner-svn-src-projects@FreeBSD.ORG Mon Jun 29 16:15:27 2009 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 2F6F81065675; Mon, 29 Jun 2009 16:15:27 +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 1DE488FC25; Mon, 29 Jun 2009 16:15:27 +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 n5TGFRO4049097; Mon, 29 Jun 2009 16:15:27 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5TGFQ2S049095; Mon, 29 Jun 2009 16:15:26 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <200906291615.n5TGFQ2S049095@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 29 Jun 2009 16:15:26 +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: r195160 - 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: Mon, 29 Jun 2009 16:15:27 -0000 Author: lstewart Date: Mon Jun 29 16:15:26 2009 New Revision: 195160 URL: http://svn.freebsd.org/changeset/base/195160 Log: Massage the ECN implementation's congestion control related bits to fit in with the framework. ssthresh adjustment is handled in the pre_fr hook and the minor code duplication created by this change is hopefully harmless. Modified: projects/tcp_cc_8.x/sys/netinet/tcp_input.c Modified: projects/tcp_cc_8.x/sys/netinet/tcp_input.c ============================================================================== --- projects/tcp_cc_8.x/sys/netinet/tcp_input.c Mon Jun 29 16:03:18 2009 (r195159) +++ projects/tcp_cc_8.x/sys/netinet/tcp_input.c Mon Jun 29 16:15:26 2009 (r195160) @@ -214,24 +214,6 @@ static void tcp_pulloutofband(struct so struct tcphdr *, struct mbuf *, int); static void tcp_xmit_timer(struct tcpcb *, int); static void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); -static void inline - tcp_congestion_exp(struct tcpcb *); - -static void inline -tcp_congestion_exp(struct tcpcb *tp) -{ - u_int win; - - win = min(tp->snd_wnd, tp->snd_cwnd) / - 2 / tp->t_maxseg; - if (win < 2) - win = 2; - tp->snd_ssthresh = win * tp->t_maxseg; - ENTER_FASTRECOVERY(tp); - tp->snd_recover = tp->snd_max; - if (tp->t_flags & TF_ECN_PERMIT) - tp->t_flags |= TF_ECN_SND_CWR; -} /* Neighbor Discovery, Neighbor Unreachability Detection Upper layer hint. */ #ifdef INET6 @@ -1178,7 +1160,17 @@ tcp_do_segment(struct mbuf *m, struct tc if ((thflags & TH_ECE) && SEQ_LEQ(th->th_ack, tp->snd_recover)) { TCPSTAT_INC(tcps_ecn_rcwnd); - tcp_congestion_exp(tp); + /* + * If the current CC algo has + * defined a hook for tasks to run + * before entering FR, call it. + */ + if (CC_ALGO(tp)->pre_fr != NULL) + CC_ALGO(tp)->pre_fr(tp, th); + ENTER_FASTRECOVERY(tp); + tp->snd_recover = tp->snd_max; + if (tp->t_flags & TF_ECN_PERMIT) + tp->t_flags |= TF_ECN_SND_CWR; } } @@ -2114,16 +2106,16 @@ tcp_do_segment(struct mbuf *m, struct tc } /* - * If the current tcp cc module has + * If the current CC algo has * defined a hook for tasks to run - * before entering FR, call it + * before entering FR, call it. */ if (CC_ALGO(tp)->pre_fr != NULL) CC_ALGO(tp)->pre_fr(tp, th); - ENTER_FASTRECOVERY(tp); tp->snd_recover = tp->snd_max; - tcp_congestion_exp(tp); + if (tp->t_flags & TF_ECN_PERMIT) + tp->t_flags |= TF_ECN_SND_CWR; tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; if (tp->t_flags & TF_SACK_PERMIT) {