Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/cc/cc_cubic.c
Show First 20 Lines • Show All 272 Lines • ▼ Show 20 Lines | if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || | ||||
cubic_data->W_max = CCV(ccv, snd_cwnd); | cubic_data->W_max = CCV(ccv, snd_cwnd); | ||||
cubic_data->K = 0; | cubic_data->K = 0; | ||||
} else if (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | | } else if (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | | ||||
CUBICFLAG_IN_APPLIMIT)) { | CUBICFLAG_IN_APPLIMIT)) { | ||||
cubic_data->flags &= ~(CUBICFLAG_IN_SLOWSTART | | cubic_data->flags &= ~(CUBICFLAG_IN_SLOWSTART | | ||||
CUBICFLAG_IN_APPLIMIT); | CUBICFLAG_IN_APPLIMIT); | ||||
cubic_data->t_epoch = ticks; | cubic_data->t_epoch = ticks; | ||||
cubic_data->K = cubic_k(cubic_data->W_max / | cubic_data->K = cubic_k(cubic_data->W_max / | ||||
CCV(ccv, t_maxseg), | |||||
cubic_data->cwnd_epoch / | |||||
CCV(ccv, t_maxseg)); | CCV(ccv, t_maxseg)); | ||||
} | } | ||||
usecs_since_epoch = (ticks - cubic_data->t_epoch) * tick; | usecs_since_epoch = (ticks - cubic_data->t_epoch) * tick; | ||||
if (usecs_since_epoch < 0) { | if (usecs_since_epoch < 0) { | ||||
/* | /* | ||||
* dragging t_epoch along | * dragging t_epoch along | ||||
*/ | */ | ||||
usecs_since_epoch = INT_MAX; | usecs_since_epoch = INT_MAX; | ||||
Show All 35 Lines | if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || | ||||
/* | /* | ||||
* If we're not in slow start and we're probing for a | * If we're not in slow start and we're probing for a | ||||
* new cwnd limit at the start of a connection | * new cwnd limit at the start of a connection | ||||
* (happens when hostcache has a relevant entry), | * (happens when hostcache has a relevant entry), | ||||
* keep updating our current estimate of the | * keep updating our current estimate of the | ||||
* W_max. | * W_max. | ||||
*/ | */ | ||||
if (((cubic_data->flags & CUBICFLAG_CONG_EVENT) == 0) && | if (((cubic_data->flags & CUBICFLAG_CONG_EVENT) == 0) && | ||||
cc: Here, we are mixing the usage of "CUBICFLAG_CONG_EVENT" flag with the usage of… | |||||
rscheffAuthorUnsubmitted Done Inline ActionsYes; I'm not done yet in dissecting the summary patch into smaller snippets; the flags will all be removed and only the num_cong_events remaining... If you think it is unneccessary to split up the patch into logical subunits - which compile but may contain logic shortcomings, I can simply discard these (currently 2, probably will be 6-9) diffs and provide a single summary Diff? rscheff: Yes; I'm not done yet in dissecting the summary patch into smaller snippets; the flags will all… | |||||
ccUnsubmitted Done Inline ActionsReading probably 6 to 9 patches and looking up connecting logics may also be a challenge. Also test the single patch by emulation is easier. I prefer to a single patch on top of the 1st patch which is committed as eb5bfdd06565. Others thoughts? cc: Reading probably 6 to 9 patches and looking up connecting logics may also be a challenge. Also… | |||||
cubic_data->W_max < CCV(ccv, snd_cwnd)) { | cubic_data->W_max < CCV(ccv, snd_cwnd)) { | ||||
cubic_data->W_max = CCV(ccv, snd_cwnd); | cubic_data->W_max = CCV(ccv, snd_cwnd); | ||||
cubic_data->K = cubic_k(cubic_data->W_max / | cubic_data->K = cubic_k(cubic_data->W_max / | ||||
CCV(ccv, t_maxseg), cubic_data->cwnd_epoch / | |||||
CCV(ccv, t_maxseg)); | CCV(ccv, t_maxseg)); | ||||
} | } | ||||
} | } | ||||
} else if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && | } else if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && | ||||
!(ccv->flags & CCF_CWND_LIMITED)) { | !(ccv->flags & CCF_CWND_LIMITED)) { | ||||
cubic_data->flags |= CUBICFLAG_IN_APPLIMIT; | cubic_data->flags |= CUBICFLAG_IN_APPLIMIT; | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* This is a CUBIC specific implementation of after_idle. | * This is a CUBIC specific implementation of after_idle. | ||||
* - Reset cwnd by calling New Reno implementation of after_idle. | * - Reset cwnd by calling New Reno implementation of after_idle. | ||||
* - Reset t_epoch. | * - Reset t_epoch. | ||||
*/ | */ | ||||
static void | static void | ||||
cubic_after_idle(struct cc_var *ccv) | cubic_after_idle(struct cc_var *ccv) | ||||
{ | { | ||||
struct cubic *cubic_data; | struct cubic *cubic_data; | ||||
cubic_data = ccv->cc_data; | cubic_data = ccv->cc_data; | ||||
cubic_data->W_max = ulmax(cubic_data->W_max, CCV(ccv, snd_cwnd)); | cubic_data->cwnd_prior = ulmax(cubic_data->cwnd_prior, CCV(ccv, snd_cwnd)); | ||||
cubic_data->K = cubic_k(cubic_data->W_max / CCV(ccv, t_maxseg)); | cubic_data->W_max = cubic_data->cwnd_prior; | ||||
cubic_data->t_epoch = 0; /* This will recalculate K */ | |||||
if ((cubic_data->flags & CUBICFLAG_HYSTART_ENABLED) == 0) { | if ((cubic_data->flags & CUBICFLAG_HYSTART_ENABLED) == 0) { | ||||
/* | /* | ||||
* Re-enable hystart if we have been idle. | * Re-enable hystart if we have been idle. | ||||
*/ | */ | ||||
cubic_data->flags &= ~CUBICFLAG_HYSTART_IN_CSS; | cubic_data->flags &= ~CUBICFLAG_HYSTART_IN_CSS; | ||||
cubic_data->flags |= CUBICFLAG_HYSTART_ENABLED; | cubic_data->flags |= CUBICFLAG_HYSTART_ENABLED; | ||||
cubic_log_hystart_event(ccv, cubic_data, 12, CCV(ccv, snd_ssthresh)); | cubic_log_hystart_event(ccv, cubic_data, 12, CCV(ccv, snd_ssthresh)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | if (cubic_data->flags & CUBICFLAG_HYSTART_ENABLED) { | ||||
/* Make sure the flags are all off we had a loss */ | /* Make sure the flags are all off we had a loss */ | ||||
cubic_data->flags &= ~CUBICFLAG_HYSTART_ENABLED; | cubic_data->flags &= ~CUBICFLAG_HYSTART_ENABLED; | ||||
cubic_data->flags &= ~CUBICFLAG_HYSTART_IN_CSS; | cubic_data->flags &= ~CUBICFLAG_HYSTART_IN_CSS; | ||||
cubic_log_hystart_event(ccv, cubic_data, 10, CCV(ccv, snd_ssthresh)); | cubic_log_hystart_event(ccv, cubic_data, 10, CCV(ccv, snd_ssthresh)); | ||||
} | } | ||||
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))) { | ||||
cubic_ssthresh_update(ccv, mss); | cubic_ssthresh_update(ccv, mss); | ||||
cubic_data->flags |= CUBICFLAG_CONG_EVENT; | cubic_data->num_cong_events++; | ||||
cubic_data->t_epoch = ticks; | cubic_data->t_epoch = 0; /* This will recalculate K */ | ||||
cubic_data->K = cubic_k(cubic_data->W_max / mss); | |||||
} | } | ||||
ENTER_RECOVERY(CCV(ccv, t_flags)); | ENTER_RECOVERY(CCV(ccv, t_flags)); | ||||
} | } | ||||
break; | break; | ||||
case CC_ECN: | case CC_ECN: | ||||
if (cubic_data->flags & CUBICFLAG_HYSTART_ENABLED) { | if (cubic_data->flags & CUBICFLAG_HYSTART_ENABLED) { | ||||
/* Make sure the flags are all off we had a loss */ | /* Make sure the flags are all off we had a loss */ | ||||
cubic_data->flags &= ~CUBICFLAG_HYSTART_ENABLED; | cubic_data->flags &= ~CUBICFLAG_HYSTART_ENABLED; | ||||
cubic_data->flags &= ~CUBICFLAG_HYSTART_IN_CSS; | cubic_data->flags &= ~CUBICFLAG_HYSTART_IN_CSS; | ||||
cubic_log_hystart_event(ccv, cubic_data, 9, CCV(ccv, snd_ssthresh)); | cubic_log_hystart_event(ccv, cubic_data, 9, CCV(ccv, snd_ssthresh)); | ||||
} | } | ||||
if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { | if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { | ||||
cubic_ssthresh_update(ccv, mss); | cubic_ssthresh_update(ccv, mss); | ||||
cubic_data->flags |= CUBICFLAG_CONG_EVENT; | cubic_data->num_cong_events++; | ||||
cubic_data->t_epoch = ticks; | cubic_data->t_epoch = 0; /* This will recalculate K */ | ||||
cubic_data->K = cubic_k(cubic_data->W_max / mss); | |||||
CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); | CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); | ||||
ENTER_CONGRECOVERY(CCV(ccv, t_flags)); | ENTER_CONGRECOVERY(CCV(ccv, t_flags)); | ||||
} | } | ||||
break; | break; | ||||
case CC_RTO: | case CC_RTO: | ||||
/* RFC8312 Section 4.7 */ | /* RFC8312 Section 4.7 */ | ||||
if (CCV(ccv, t_rxtshift) == 1) { | if (CCV(ccv, t_rxtshift) == 1) { | ||||
▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines |
Here, we are mixing the usage of "CUBICFLAG_CONG_EVENT" flag with the usage of "num_cong_events" variable below in the cases of cubic_cong_signal().
We shall not use both. Suggest remove the usage of "num_cong_events" as in commit 6907bbae187e