Date: Mon, 29 Jun 2009 16:15:26 +0000 (UTC) From: Lawrence Stewart <lstewart@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r195160 - projects/tcp_cc_8.x/sys/netinet Message-ID: <200906291615.n5TGFQ2S049095@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906291615.n5TGFQ2S049095>