Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/cc/cc_newreno.c
Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/* | /* | ||||
* Perform any necessary tasks before we enter congestion recovery. | * Perform any necessary tasks before we enter congestion recovery. | ||||
*/ | */ | ||||
static void | static void | ||||
newreno_cong_signal(struct cc_var *ccv, uint32_t type) | newreno_cong_signal(struct cc_var *ccv, uint32_t type) | ||||
{ | { | ||||
u_int win; | uint32_t cwin; | ||||
u_int mss; | |||||
cwin = CCV(ccv, snd_cwnd); | |||||
mss = CCV(ccv, t_maxseg); | |||||
/* Catch algos which mistakenly leak private signal types. */ | /* Catch algos which mistakenly leak private signal types. */ | ||||
KASSERT((type & CC_SIGPRIVMASK) == 0, | KASSERT((type & CC_SIGPRIVMASK) == 0, | ||||
("%s: congestion signal type 0x%08x is private\n", __func__, type)); | ("%s: congestion signal type 0x%08x is private\n", __func__, type)); | ||||
win = max(CCV(ccv, snd_cwnd) / 2 / CCV(ccv, t_maxseg), 2) * | cwin = max(2*mss, cwin/2); | ||||
CCV(ccv, t_maxseg); | |||||
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))) { | ||||
CCV(ccv, snd_ssthresh) = win; | CCV(ccv, snd_ssthresh) = cwin; | ||||
CCV(ccv, snd_cwnd) = 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))) { | ||||
CCV(ccv, snd_ssthresh) = win; | CCV(ccv, snd_ssthresh) = cwin; | ||||
CCV(ccv, snd_cwnd) = win; | CCV(ccv, snd_cwnd) = cwin; | ||||
ENTER_CONGRECOVERY(CCV(ccv, t_flags)); | ENTER_CONGRECOVERY(CCV(ccv, t_flags)); | ||||
} | } | ||||
break; | |||||
case CC_RTO: | |||||
CCV(ccv, snd_ssthresh) = cwin; | |||||
CCV(ccv, snd_cwnd) = mss; | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* Perform any necessary tasks before we exit congestion recovery. | * Perform any necessary tasks before we exit congestion recovery. | ||||
*/ | */ | ||||
static void | static void | ||||
Show All 29 Lines |