Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/cc/cc_cubic.c
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | cubic_ack_received(struct cc_var *ccv, uint16_t type) | ||||
unsigned long w_tf, w_cubic_next; | unsigned long w_tf, w_cubic_next; | ||||
int ticks_since_cong; | int ticks_since_cong; | ||||
cubic_data = ccv->cc_data; | cubic_data = ccv->cc_data; | ||||
cubic_record_rtt(ccv); | cubic_record_rtt(ccv); | ||||
/* | /* | ||||
* Regular ACK and we're not in cong/fast recovery and we're cwnd | * Regular ACK and we're not in cong/fast recovery and we're cwnd | ||||
* limited and we're either not doing ABC or are slow starting or are | * limited and we're either not doing ABC or are just coming out | ||||
* doing ABC and we've sent a cwnd's worth of bytes. | * from slow-start or were application limited or are slow starting | ||||
* or are doing ABC and we've sent a cwnd's worth of bytes. | |||||
*/ | */ | ||||
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) && (!V_tcp_do_rfc3465 || | (ccv->flags & CCF_CWND_LIMITED) && (!V_tcp_do_rfc3465 || | ||||
(cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | CUBICFLAG_IN_APPLIMIT)) || | |||||
CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || | CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || | ||||
(V_tcp_do_rfc3465 && ccv->flags & CCF_ABC_SENTAWND))) { | (V_tcp_do_rfc3465 && (ccv->flags & CCF_ABC_SENTAWND)))) { | ||||
/* Use the logic in NewReno ack_received() for slow start. */ | /* Use the logic in NewReno ack_received() for slow start. */ | ||||
if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || | if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || | ||||
cubic_data->min_rtt_ticks == TCPTV_SRTTBASE) { | cubic_data->min_rtt_ticks == TCPTV_SRTTBASE) { | ||||
cubic_data->flags |= CUBICFLAG_IN_SLOWSTART; | cubic_data->flags |= CUBICFLAG_IN_SLOWSTART; | ||||
newreno_cc_algo.ack_received(ccv, type); | newreno_cc_algo.ack_received(ccv, type); | ||||
} else { | } else { | ||||
if (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | | |||||
CUBICFLAG_IN_APPLIMIT)) { | |||||
cubic_data->flags &= ~(CUBICFLAG_IN_SLOWSTART | | |||||
CUBICFLAG_IN_APPLIMIT); | |||||
cubic_data->t_last_cong = ticks; | |||||
cubic_data->K = cubic_k(cubic_data->max_cwnd / | |||||
CCV(ccv, t_maxseg)); | |||||
} | |||||
if ((ticks_since_cong = | if ((ticks_since_cong = | ||||
ticks - cubic_data->t_last_cong) < 0) { | ticks - cubic_data->t_last_cong) < 0) { | ||||
/* | /* | ||||
* dragging t_last_cong along | * dragging t_last_cong along | ||||
*/ | */ | ||||
ticks_since_cong = INT_MAX; | ticks_since_cong = INT_MAX; | ||||
cubic_data->t_last_cong = ticks - INT_MAX; | cubic_data->t_last_cong = ticks - INT_MAX; | ||||
} | |||||
if (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | | |||||
CUBICFLAG_IN_APPLIMIT)) { | |||||
cubic_data->flags &= ~(CUBICFLAG_IN_SLOWSTART | | |||||
CUBICFLAG_IN_APPLIMIT); | |||||
cubic_data->t_last_cong = ticks; | |||||
cubic_data->K = 0; | |||||
} | } | ||||
/* | /* | ||||
* The mean RTT is used to best reflect the equations in | * The mean RTT is used to best reflect the equations in | ||||
* the I-D. Using min_rtt in the tf_cwnd calculation | * the I-D. Using min_rtt in the tf_cwnd calculation | ||||
* causes w_tf to grow much faster than it should if the | * causes w_tf to grow much faster than it should if the | ||||
* RTT is dominated by network buffering rather than | * RTT is dominated by network buffering rather than | ||||
* propagation delay. | * propagation delay. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 305 Lines • Show Last 20 Lines |