Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/cc/cc_chd.c
Show First 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static void | static void | ||||
chd_cong_signal(struct cc_var *ccv, uint32_t signal_type) | chd_cong_signal(struct cc_var *ccv, uint32_t signal_type) | ||||
{ | { | ||||
struct ertt *e_t; | struct ertt *e_t; | ||||
struct chd *chd_data; | struct chd *chd_data; | ||||
int qdly; | int qdly; | ||||
uint32_t cwin; | |||||
u_int mss; | |||||
e_t = khelp_get_osd(CCV(ccv, osd), ertt_id); | e_t = khelp_get_osd(CCV(ccv, osd), ertt_id); | ||||
chd_data = ccv->cc_data; | chd_data = ccv->cc_data; | ||||
qdly = imax(e_t->rtt, chd_data->maxrtt_in_rtt) - e_t->minrtt; | qdly = imax(e_t->rtt, chd_data->maxrtt_in_rtt) - e_t->minrtt; | ||||
cwin = CCV(ccv, snd_cwnd); | |||||
mss = CCV(ccv, t_maxseg); | |||||
switch(signal_type) { | switch(signal_type) { | ||||
case CC_CHD_DELAY: | case CC_CHD_DELAY: | ||||
chd_window_decrease(ccv); /* Set new ssthresh. */ | chd_window_decrease(ccv); /* Set new ssthresh. */ | ||||
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); | ||||
ENTER_CONGRECOVERY(CCV(ccv, t_flags)); | ENTER_CONGRECOVERY(CCV(ccv, t_flags)); | ||||
break; | break; | ||||
Show All 22 Lines | if (!IN_RECOVERY(CCV(ccv, t_flags)) && qdly > V_chd_qthresh) { | ||||
CCV(ccv, snd_recover) = CCV(ccv, snd_max); | CCV(ccv, snd_recover) = CCV(ccv, snd_max); | ||||
} | } | ||||
if (chd_data->shadow_w > 0) { | if (chd_data->shadow_w > 0) { | ||||
chd_data->shadow_w = max(chd_data->shadow_w / | chd_data->shadow_w = max(chd_data->shadow_w / | ||||
CCV(ccv, t_maxseg) / 2, 2) * CCV(ccv, t_maxseg); | CCV(ccv, t_maxseg) / 2, 2) * CCV(ccv, t_maxseg); | ||||
} | } | ||||
ENTER_FASTRECOVERY(CCV(ccv, t_flags)); | ENTER_FASTRECOVERY(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); | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |