Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/cc/cc_newreno.c
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | cwin = max(((uint64_t)cwin * (uint64_t)factor) / (100ULL * (uint64_t)mss), | ||||
2) * mss; | 2) * mss; | ||||
switch (type) { | switch (type) { | ||||
case CC_NDUPACK: | case CC_NDUPACK: | ||||
if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { | if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { | ||||
if (IN_CONGRECOVERY(CCV(ccv, t_flags) && | if (IN_CONGRECOVERY(CCV(ccv, t_flags) && | ||||
V_cc_do_abe && V_cc_abe_frlossreduce)) { | V_cc_do_abe && V_cc_abe_frlossreduce)) { | ||||
CCV(ccv, snd_ssthresh) = | CCV(ccv, snd_ssthresh) = | ||||
((uint64_t)CCV(ccv, snd_ssthresh) * | max(((uint64_t)CCV(ccv, snd_ssthresh) * | ||||
(uint64_t)beta) / | (uint64_t)beta) / (uint64_t)beta_ecn, | ||||
(100ULL * (uint64_t)beta_ecn); | 2 * mss); | ||||
} | } | ||||
if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) | if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) | ||||
CCV(ccv, snd_ssthresh) = cwin; | CCV(ccv, snd_ssthresh) = cwin; | ||||
ENTER_RECOVERY(CCV(ccv, t_flags)); | ENTER_RECOVERY(CCV(ccv, t_flags)); | ||||
} | } | ||||
break; | break; | ||||
case CC_ECN: | case CC_ECN: | ||||
if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { | if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | case SOPT_SET: | ||||
/* We cannot set without cc_data memory. */ | /* We cannot set without cc_data memory. */ | ||||
if (nreno == NULL) { | if (nreno == NULL) { | ||||
nreno = newreno_malloc(ccv); | nreno = newreno_malloc(ccv); | ||||
if (nreno == NULL) | if (nreno == NULL) | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
switch (opt->name) { | switch (opt->name) { | ||||
case CC_NEWRENO_BETA: | case CC_NEWRENO_BETA: | ||||
if (opt->val == 0 || opt->val > 100) | |||||
return (EINVAL); | |||||
nreno->beta = opt->val; | nreno->beta = opt->val; | ||||
break; | break; | ||||
case CC_NEWRENO_BETA_ECN: | case CC_NEWRENO_BETA_ECN: | ||||
if (!V_cc_do_abe) | if (!V_cc_do_abe) | ||||
return (EACCES); | return (EACCES); | ||||
if (opt->val == 0 || opt->val > 100) | |||||
return (EINVAL); | |||||
nreno->beta_ecn = opt->val; | nreno->beta_ecn = opt->val; | ||||
break; | break; | ||||
default: | default: | ||||
return (ENOPROTOOPT); | return (ENOPROTOOPT); | ||||
} | } | ||||
break; | break; | ||||
case SOPT_GET: | case SOPT_GET: | ||||
switch (opt->name) { | switch (opt->name) { | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |