Skip to content

Commit

Permalink
Prevent cwnd to collapse down to 1 MSS after exiting recovery.
Browse files Browse the repository at this point in the history
This is descrined in RFC 6582, which updates RFC 3782.

Submitted by:		Richard Scheffenegger
Reviewed by:		lstewart@
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D17614
  • Loading branch information
tuexen committed May 9, 2019
1 parent c150a0f commit 274fb26
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion sys/netinet/cc/cc_cubic.c
Expand Up @@ -324,7 +324,12 @@ cubic_post_recovery(struct cc_var *ccv)
pipe = CCV(ccv, snd_max) - ccv->curack;

if (pipe < CCV(ccv, snd_ssthresh))
CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg);
/*
* Ensure that cwnd does not collapse to 1 MSS under
* adverse conditions. Implements RFC6582
*/
CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) +
CCV(ccv, t_maxseg);
else
/* Update cwnd based on beta and adjusted max_cwnd. */
CCV(ccv, snd_cwnd) = max(1, ((CUBIC_BETA *
Expand Down
7 changes: 6 additions & 1 deletion sys/netinet/cc/cc_htcp.c
Expand Up @@ -366,7 +366,12 @@ htcp_post_recovery(struct cc_var *ccv)
pipe = CCV(ccv, snd_max) - ccv->curack;

if (pipe < CCV(ccv, snd_ssthresh))
CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg);
/*
* Ensure that cwnd down not collape to 1 MSS under
* adverse conditions. Implements RFC6582
*/
CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) +
CCV(ccv, t_maxseg);
else
CCV(ccv, snd_cwnd) = max(1, ((htcp_data->beta *
htcp_data->prev_cwnd / CCV(ccv, t_maxseg))
Expand Down
7 changes: 6 additions & 1 deletion sys/netinet/cc/cc_newreno.c
Expand Up @@ -295,7 +295,12 @@ newreno_post_recovery(struct cc_var *ccv)
pipe = CCV(ccv, snd_max) - ccv->curack;

if (pipe < CCV(ccv, snd_ssthresh))
CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg);
/*
* Ensure that cwnd does not collapse to 1 MSS under
* adverse conditons. Implements RFC6582
*/
CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) +
CCV(ccv, t_maxseg);
else
CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
}
Expand Down

0 comments on commit 274fb26

Please sign in to comment.