Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/cc/cc_newreno.c
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | if (incr > 0) | ||||
CCV(ccv, snd_cwnd) = min(cw + incr, | CCV(ccv, snd_cwnd) = min(cw + incr, | ||||
TCP_MAXWIN << CCV(ccv, snd_scale)); | TCP_MAXWIN << CCV(ccv, snd_scale)); | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
newreno_after_idle(struct cc_var *ccv) | newreno_after_idle(struct cc_var *ccv) | ||||
{ | { | ||||
int rw; | u_long rw; | ||||
/* | /* | ||||
* If we've been idle for more than one retransmit timeout the old | * If we've been idle for more than one retransmit timeout the old | ||||
* congestion window is no longer current and we have to reduce it to | * congestion window is no longer current and we have to reduce it to | ||||
* the restart window before we can transmit again. | * the restart window before we can transmit again. | ||||
* | * | ||||
* The restart window is the initial window or the last CWND, whichever | * The restart window is the initial window or the last CWND, whichever | ||||
* is smaller. | * is smaller. | ||||
* | * | ||||
* This is done to prevent us from flooding the path with a full CWND at | * This is done to prevent us from flooding the path with a full CWND at | ||||
* wirespeed, overloading router and switch buffers along the way. | * wirespeed, overloading router and switch buffers along the way. | ||||
* | * | ||||
* See RFC5681 Section 4.1. "Restarting Idle Connections". | * See RFC5681 Section 4.1. "Restarting Idle Connections". | ||||
*/ | */ | ||||
if (V_tcp_do_rfc3390) | rw = tcp_initcwnd(ccv->ccvc.tcp, CCV(ccv, t_maxseg)); | ||||
rw = min(4 * CCV(ccv, t_maxseg), | |||||
max(2 * CCV(ccv, t_maxseg), 4380)); | |||||
else | |||||
rw = CCV(ccv, t_maxseg) * 2; | |||||
CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd)); | CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd)); | ||||
} | } | ||||
/* | /* | ||||
* Perform any necessary tasks before we enter congestion recovery. | * Perform any necessary tasks before we enter congestion recovery. | ||||
*/ | */ | ||||
static void | static void | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |