aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorSean Bruno <sbruno@FreeBSD.org>2017-07-25 15:08:52 +0000
committerSean Bruno <sbruno@FreeBSD.org>2017-07-25 15:08:52 +0000
commit43053c125a6389ac7dbcc12c2d9f7c795c05aafa (patch)
tree7ece3c63aca4ada948520b0d78df1087ba7b81ef /sys/netinet/tcp_input.c
parent5d53981a18a684fd4ac3321415e0811939c438c1 (diff)
downloadsrc-43053c125a6389ac7dbcc12c2d9f7c795c05aafa.tar.gz
src-43053c125a6389ac7dbcc12c2d9f7c795c05aafa.zip
Notes
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 016003057192..b1c968e83f97 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -435,15 +435,9 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type)
tp->t_dupacks = 0;
tp->t_bytes_acked = 0;
EXIT_RECOVERY(tp->t_flags);
- if (CC_ALGO(tp)->cong_signal == NULL) {
- /*
- * RFC5681 Section 3.1
- * ssthresh = max (FlightSize / 2, 2*SMSS) eq (4)
- */
- tp->snd_ssthresh =
- max((tp->snd_max - tp->snd_una) / 2, 2 * maxseg);
- tp->snd_cwnd = maxseg;
- }
+ tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 /
+ maxseg) * maxseg;
+ tp->snd_cwnd = maxseg;
break;
case CC_RTO_ERR:
TCPSTAT_INC(tcps_sndrexmitbad);
@@ -2612,15 +2606,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (awnd < tp->snd_ssthresh) {
tp->snd_cwnd += maxseg;
- /*
- * RFC5681 Section 3.2 talks about cwnd
- * inflation on additional dupacks and
- * deflation on recovering from loss.
- *
- * We keep cwnd into check so that
- * we don't have to 'deflate' it when we
- * get out of recovery.
- */
if (tp->snd_cwnd > tp->snd_ssthresh)
tp->snd_cwnd = tp->snd_ssthresh;
}
@@ -2660,22 +2645,19 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
TCPSTAT_INC(
tcps_sack_recovery_episode);
tp->sack_newdata = tp->snd_nxt;
- if (CC_ALGO(tp)->cong_signal == NULL)
- tp->snd_cwnd = maxseg;
+ tp->snd_cwnd = maxseg;
(void) tp->t_fb->tfb_tcp_output(tp);
goto drop;
}
tp->snd_nxt = th->th_ack;
- if (CC_ALGO(tp)->cong_signal == NULL)
- tp->snd_cwnd = maxseg;
+ tp->snd_cwnd = maxseg;
(void) tp->t_fb->tfb_tcp_output(tp);
KASSERT(tp->snd_limited <= 2,
("%s: tp->snd_limited too big",
__func__));
- if (CC_ALGO(tp)->cong_signal == NULL)
- tp->snd_cwnd = tp->snd_ssthresh +
- maxseg *
- (tp->t_dupacks - tp->snd_limited);
+ tp->snd_cwnd = tp->snd_ssthresh +
+ maxseg *
+ (tp->t_dupacks - tp->snd_limited);
if (SEQ_GT(onxt, tp->snd_nxt))
tp->snd_nxt = onxt;
goto drop;