Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/cc/cc_cdg.c
Show First 20 Lines • Show All 425 Lines • ▼ Show 20 Lines | cdg_window_increase(struct cc_var *ccv, int new_measurement) | ||||
CCV(ccv, snd_cwnd) = ulmin(CCV(ccv, snd_cwnd) + incr, | CCV(ccv, snd_cwnd) = ulmin(CCV(ccv, snd_cwnd) + incr, | ||||
TCP_MAXWIN << CCV(ccv, snd_scale)); | TCP_MAXWIN << CCV(ccv, snd_scale)); | ||||
} | } | ||||
static void | static void | ||||
cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type) | cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type) | ||||
{ | { | ||||
struct cdg *cdg_data = ccv->cc_data; | struct cdg *cdg_data = ccv->cc_data; | ||||
uint32_t cwin; | |||||
u_int mss; | |||||
cwin = CCV(ccv, snd_cwnd); | |||||
mss = CCV(ccv, t_maxseg); | |||||
switch(signal_type) { | switch(signal_type) { | ||||
case CC_CDG_DELAY: | case CC_CDG_DELAY: | ||||
CCV(ccv, snd_ssthresh) = cdg_window_decrease(ccv, | CCV(ccv, snd_ssthresh) = cdg_window_decrease(ccv, | ||||
CCV(ccv, snd_cwnd), V_cdg_beta_delay); | CCV(ccv, snd_cwnd), V_cdg_beta_delay); | ||||
CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); | CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); | ||||
CCV(ccv, snd_recover) = CCV(ccv, snd_max); | CCV(ccv, snd_recover) = CCV(ccv, snd_max); | ||||
cdg_data->window_incr = cdg_data->rtt_count = 0; | cdg_data->window_incr = cdg_data->rtt_count = 0; | ||||
ENTER_CONGRECOVERY(CCV(ccv, t_flags)); | ENTER_CONGRECOVERY(CCV(ccv, t_flags)); | ||||
break; | break; | ||||
case CC_NDUPACK: | case CC_NDUPACK: | ||||
/* | /* | ||||
* If already responding to congestion OR we have guessed no | * If already responding to congestion OR we have guessed no | ||||
* queue in the path is full. | * queue in the path is full. | ||||
*/ | */ | ||||
if (IN_CONGRECOVERY(CCV(ccv, t_flags)) || | if (IN_CONGRECOVERY(CCV(ccv, t_flags)) || | ||||
cdg_data->queue_state < CDG_Q_FULL) { | cdg_data->queue_state < CDG_Q_FULL) { | ||||
CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd); | CCV(ccv, snd_ssthresh) = cwin; | ||||
CCV(ccv, snd_recover) = CCV(ccv, snd_max); | CCV(ccv, snd_recover) = CCV(ccv, snd_max); | ||||
} else { | } else { | ||||
/* | /* | ||||
* Loss is likely to be congestion related. We have | * Loss is likely to be congestion related. We have | ||||
* inferred a queue full state, so have shadow window | * inferred a queue full state, so have shadow window | ||||
* react to loss as NewReno would. | * react to loss as NewReno would. | ||||
*/ | */ | ||||
if (cdg_data->shadow_w > 0) | if (cdg_data->shadow_w > 0) | ||||
cdg_data->shadow_w = cdg_window_decrease(ccv, | cdg_data->shadow_w = cdg_window_decrease(ccv, | ||||
cdg_data->shadow_w, RENO_BETA); | cdg_data->shadow_w, RENO_BETA); | ||||
CCV(ccv, snd_ssthresh) = max(cdg_data->shadow_w, | CCV(ccv, snd_ssthresh) = max(cdg_data->shadow_w, | ||||
cdg_window_decrease(ccv, CCV(ccv, snd_cwnd), | cdg_window_decrease(ccv, cwin, V_cdg_beta_loss)); | ||||
V_cdg_beta_loss)); | CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); | ||||
cdg_data->window_incr = cdg_data->rtt_count = 0; | cdg_data->window_incr = cdg_data->rtt_count = 0; | ||||
} | } | ||||
ENTER_RECOVERY(CCV(ccv, t_flags)); | ENTER_RECOVERY(CCV(ccv, t_flags)); | ||||
break; | |||||
case CC_RTO: | |||||
CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2); | |||||
CCV(ccv, snd_cwnd) = mss; | |||||
break; | break; | ||||
default: | default: | ||||
newreno_cc_algo.cong_signal(ccv, signal_type); | newreno_cc_algo.cong_signal(ccv, signal_type); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |