Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/cc/cc_newreno.c
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static void | static void | ||||
newreno_ack_received(struct cc_var *ccv, uint16_t type) | newreno_ack_received(struct cc_var *ccv, uint16_t type) | ||||
{ | { | ||||
if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && | if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && | ||||
(ccv->flags & CCF_CWND_LIMITED)) { | (ccv->flags & CCF_CWND_LIMITED)) { | ||||
u_int cw = CCV(ccv, snd_cwnd); | u_int cw = CCV(ccv, snd_cwnd); | ||||
u_int incr = CCV(ccv, t_maxseg); | u_int incr = 0; | ||||
/* | /* | ||||
* Regular in-order ACK, open the congestion window. | * Regular in-order ACK, open the congestion window. | ||||
* Method depends on which congestion control state we're | * Method depends on which congestion control state we're | ||||
* in (slow start or cong avoid) and if ABC (RFC 3465) is | * in (slow start or cong avoid) and if ABC (RFC 3465) is | ||||
* enabled. | * enabled. | ||||
* | * | ||||
* slow start: cwnd <= ssthresh | * slow start: cwnd <= ssthresh | ||||
Show All 18 Lines | if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && | ||||
* avoid capping cwnd. | * avoid capping cwnd. | ||||
*/ | */ | ||||
if (cw > CCV(ccv, snd_ssthresh)) { | if (cw > CCV(ccv, snd_ssthresh)) { | ||||
if (V_tcp_do_rfc3465) { | if (V_tcp_do_rfc3465) { | ||||
if (ccv->flags & CCF_ABC_SENTAWND) | if (ccv->flags & CCF_ABC_SENTAWND) | ||||
ccv->flags &= ~CCF_ABC_SENTAWND; | ccv->flags &= ~CCF_ABC_SENTAWND; | ||||
else | else | ||||
incr = 0; | incr = 0; | ||||
} else | } else if (ccv->bytes_this_ack > 0) | ||||
incr = max((incr * incr / cw), 1); | incr = max((incr * incr / cw), 1); | ||||
} else if (V_tcp_do_rfc3465) { | } else if (V_tcp_do_rfc3465) { | ||||
/* | /* | ||||
* In slow-start with ABC enabled and no RTO in sight? | * In slow-start with ABC enabled and no RTO in sight? | ||||
* (Must not use abc_l_var > 1 if slow starting after | * (Must not use abc_l_var > 1 if slow starting after | ||||
* an RTO. On RTO, snd_nxt = snd_una, so the | * an RTO. On RTO, snd_nxt = snd_una, so the | ||||
* snd_nxt == snd_max check is sufficient to | * snd_nxt == snd_max check is sufficient to | ||||
* handle this). | * handle this). | ||||
* | * | ||||
* XXXLAS: Find a way to signal SS after RTO that | * XXXLAS: Find a way to signal SS after RTO that | ||||
* doesn't rely on tcpcb vars. | * doesn't rely on tcpcb vars. | ||||
*/ | */ | ||||
if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) | if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) | ||||
incr = min(ccv->bytes_this_ack, | incr = min(ccv->bytes_this_ack, | ||||
ccv->nsegs * V_tcp_abc_l_var * | ccv->nsegs * V_tcp_abc_l_var * | ||||
CCV(ccv, t_maxseg)); | CCV(ccv, t_maxseg)); | ||||
else | else | ||||
incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg)); | incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg)); | ||||
} | } else if (ccv->bytes_this_ack > 0) | ||||
incr = CCV(ccv, t_maxseg); | |||||
/* ABC is on by default, so incr equals 0 frequently. */ | /* ABC is on by default, so incr equals 0 frequently. */ | ||||
if (incr > 0) | 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 | ||||
▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines |