svn commit: r195160 - projects/tcp_cc_8.x/sys/netinet
Lawrence Stewart
lstewart at FreeBSD.org
Mon Jun 29 16:15:27 UTC 2009
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) {
More information about the svn-src-projects
mailing list