Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/cc/cc_cubic.c
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | if (incr > 0) | ||||
CCV(ccv, snd_cwnd) = min((cw + incr), | CCV(ccv, snd_cwnd) = min((cw + incr), | ||||
TCP_MAXWIN << CCV(ccv, snd_scale)); | TCP_MAXWIN << CCV(ccv, snd_scale)); | ||||
} | } | ||||
static void | static void | ||||
cubic_ack_received(struct cc_var *ccv, uint16_t type) | cubic_ack_received(struct cc_var *ccv, uint16_t type) | ||||
{ | { | ||||
struct cubic *cubic_data; | struct cubic *cubic_data; | ||||
unsigned long w_tf, w_cubic_next; | unsigned long W_est, W_cubic; | ||||
int usecs_since_cong; | int usecs_since_epoch; | ||||
cubic_data = ccv->cc_data; | cubic_data = ccv->cc_data; | ||||
cubic_record_rtt(ccv); | cubic_record_rtt(ccv); | ||||
/* | /* | ||||
* For a regular ACK and we're not in cong/fast recovery and | * For a regular ACK and we're not in cong/fast recovery and | ||||
* we're cwnd limited, always recalculate cwnd. | * we're cwnd limited, always recalculate cwnd. | ||||
*/ | */ | ||||
Show All 15 Lines | if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || | ||||
cubic_data->flags &= ~CUBICFLAG_HYSTART_ENABLED; | cubic_data->flags &= ~CUBICFLAG_HYSTART_ENABLED; | ||||
cubic_log_hystart_event(ccv, cubic_data, 11, CCV(ccv, snd_ssthresh)); | cubic_log_hystart_event(ccv, cubic_data, 11, CCV(ccv, snd_ssthresh)); | ||||
} | } | ||||
if ((cubic_data->flags & CUBICFLAG_RTO_EVENT) && | if ((cubic_data->flags & CUBICFLAG_RTO_EVENT) && | ||||
(cubic_data->flags & CUBICFLAG_IN_SLOWSTART)) { | (cubic_data->flags & CUBICFLAG_IN_SLOWSTART)) { | ||||
/* RFC8312 Section 4.7 */ | /* RFC8312 Section 4.7 */ | ||||
cubic_data->flags &= ~(CUBICFLAG_RTO_EVENT | | cubic_data->flags &= ~(CUBICFLAG_RTO_EVENT | | ||||
CUBICFLAG_IN_SLOWSTART); | CUBICFLAG_IN_SLOWSTART); | ||||
cubic_data->max_cwnd = 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_last_cong = ticks; | cubic_data->t_epoch = ticks; | ||||
cubic_data->K = cubic_k(cubic_data->max_cwnd / | cubic_data->K = cubic_k(cubic_data->W_max / | ||||
CCV(ccv, t_maxseg)); | CCV(ccv, t_maxseg)); | ||||
} | } | ||||
usecs_since_cong = (ticks - cubic_data->t_last_cong) * tick; | usecs_since_epoch = (ticks - cubic_data->t_epoch) * tick; | ||||
if (usecs_since_cong < 0) { | if (usecs_since_epoch < 0) { | ||||
/* | /* | ||||
* dragging t_last_cong along | * dragging t_epoch along | ||||
*/ | */ | ||||
usecs_since_cong = INT_MAX; | usecs_since_epoch = INT_MAX; | ||||
cubic_data->t_last_cong = ticks - INT_MAX; | cubic_data->t_epoch = ticks - INT_MAX; | ||||
} | } | ||||
/* | /* | ||||
* The mean RTT is used to best reflect the equations in | * The mean RTT is used to best reflect the equations in | ||||
* the I-D. Using min_rtt in the tf_cwnd calculation | * the I-D. Using min_rtt in the tf_cwnd calculation | ||||
* causes w_tf to grow much faster than it should if the | * causes W_est to grow much faster than it should if the | ||||
* RTT is dominated by network buffering rather than | * RTT is dominated by network buffering rather than | ||||
* propagation delay. | * propagation delay. | ||||
*/ | */ | ||||
w_tf = tf_cwnd(usecs_since_cong, cubic_data->mean_rtt_usecs, | W_est = tf_cwnd(usecs_since_epoch, cubic_data->mean_rtt_usecs, | ||||
cubic_data->max_cwnd, CCV(ccv, t_maxseg)); | cubic_data->W_max, CCV(ccv, t_maxseg)); | ||||
w_cubic_next = cubic_cwnd(usecs_since_cong + | W_cubic = cubic_cwnd(usecs_since_epoch + | ||||
cubic_data->mean_rtt_usecs, | cubic_data->mean_rtt_usecs, | ||||
cubic_data->max_cwnd, | cubic_data->W_max, | ||||
CCV(ccv, t_maxseg), | CCV(ccv, t_maxseg), | ||||
cubic_data->K); | cubic_data->K); | ||||
ccv->flags &= ~CCF_ABC_SENTAWND; | ccv->flags &= ~CCF_ABC_SENTAWND; | ||||
if (w_cubic_next < w_tf) { | if (W_cubic < W_est) { | ||||
/* | /* | ||||
* TCP-friendly region, follow tf | * TCP-friendly region, follow tf | ||||
* cwnd growth. | * cwnd growth. | ||||
*/ | */ | ||||
if (CCV(ccv, snd_cwnd) < w_tf) | if (CCV(ccv, snd_cwnd) < W_est) | ||||
CCV(ccv, snd_cwnd) = ulmin(w_tf, INT_MAX); | CCV(ccv, snd_cwnd) = ulmin(W_est, INT_MAX); | ||||
} else if (CCV(ccv, snd_cwnd) < w_cubic_next) { | } else if (CCV(ccv, snd_cwnd) < W_cubic) { | ||||
/* | /* | ||||
* Concave or convex region, follow CUBIC | * Concave or convex region, follow CUBIC | ||||
* cwnd growth. | * cwnd growth. | ||||
* Only update snd_cwnd, if it doesn't shrink. | * Only update snd_cwnd, if it doesn't shrink. | ||||
*/ | */ | ||||
CCV(ccv, snd_cwnd) = ulmin(w_cubic_next, | CCV(ccv, snd_cwnd) = ulmin(W_cubic, INT_MAX); | ||||
INT_MAX); | |||||
} | } | ||||
/* | /* | ||||
* 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 | ||||
* max_cwnd. | * W_max. | ||||
*/ | */ | ||||
if (((cubic_data->flags & CUBICFLAG_CONG_EVENT) == 0) && | if (((cubic_data->flags & CUBICFLAG_CONG_EVENT) == 0) && | ||||
cubic_data->max_cwnd < CCV(ccv, snd_cwnd)) { | cubic_data->W_max < CCV(ccv, snd_cwnd)) { | ||||
cubic_data->max_cwnd = CCV(ccv, snd_cwnd); | cubic_data->W_max = CCV(ccv, snd_cwnd); | ||||
cubic_data->K = cubic_k(cubic_data->max_cwnd / | cubic_data->K = cubic_k(cubic_data->W_max / | ||||
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_last_cong. | * - 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->max_cwnd = ulmax(cubic_data->max_cwnd, CCV(ccv, snd_cwnd)); | cubic_data->W_max = ulmax(cubic_data->W_max, CCV(ccv, snd_cwnd)); | ||||
cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); | cubic_data->K = cubic_k(cubic_data->W_max / CCV(ccv, t_maxseg)); | ||||
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)); | ||||
} | } | ||||
newreno_cc_after_idle(ccv); | newreno_cc_after_idle(ccv); | ||||
cubic_data->t_last_cong = ticks; | cubic_data->t_epoch = ticks; | ||||
} | } | ||||
static void | static void | ||||
cubic_cb_destroy(struct cc_var *ccv) | cubic_cb_destroy(struct cc_var *ccv) | ||||
{ | { | ||||
free(ccv->cc_data, M_CC_MEM); | free(ccv->cc_data, M_CC_MEM); | ||||
} | } | ||||
Show All 12 Lines | cubic_cb_init(struct cc_var *ccv, void *ptr) | ||||
if (ptr == NULL) { | if (ptr == NULL) { | ||||
cubic_data = malloc(sizeof(struct cubic), M_CC_MEM, M_NOWAIT|M_ZERO); | cubic_data = malloc(sizeof(struct cubic), M_CC_MEM, M_NOWAIT|M_ZERO); | ||||
if (cubic_data == NULL) | if (cubic_data == NULL) | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} else | } else | ||||
cubic_data = ptr; | cubic_data = ptr; | ||||
/* Init some key variables with sensible defaults. */ | /* Init some key variables with sensible defaults. */ | ||||
cubic_data->t_last_cong = ticks; | cubic_data->t_epoch = ticks; | ||||
cubic_data->min_rtt_usecs = TCPTV_SRTTBASE; | cubic_data->min_rtt_usecs = TCPTV_SRTTBASE; | ||||
cubic_data->mean_rtt_usecs = 1; | cubic_data->mean_rtt_usecs = 1; | ||||
ccv->cc_data = cubic_data; | ccv->cc_data = cubic_data; | ||||
cubic_data->flags = CUBICFLAG_HYSTART_ENABLED; | cubic_data->flags = CUBICFLAG_HYSTART_ENABLED; | ||||
/* At init set both to infinity */ | /* At init set both to infinity */ | ||||
cubic_data->css_lastround_minrtt = 0xffffffff; | cubic_data->css_lastround_minrtt = 0xffffffff; | ||||
cubic_data->css_current_round_minrtt = 0xffffffff; | cubic_data->css_current_round_minrtt = 0xffffffff; | ||||
Show All 27 Lines | if (cubic_data->flags & CUBICFLAG_HYSTART_ENABLED) { | ||||
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->flags |= CUBICFLAG_CONG_EVENT; | ||||
cubic_data->t_last_cong = ticks; | cubic_data->t_epoch = ticks; | ||||
cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); | 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->flags |= CUBICFLAG_CONG_EVENT; | ||||
cubic_data->t_last_cong = ticks; | cubic_data->t_epoch = ticks; | ||||
cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); | 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) { | ||||
cubic_data->t_last_cong_prev = cubic_data->t_last_cong; | /* | ||||
cubic_data->prev_max_cwnd_cp = cubic_data->prev_max_cwnd; | * Remember the state only for the first RTO event. This | ||||
* will help us restore the state to the values seen | |||||
* at the most recent congestion avoidance stage before | |||||
* the current RTO event. | |||||
*/ | |||||
cubic_data->undo_t_epoch = cubic_data->t_epoch; | |||||
cubic_data->undo_cwnd_epoch = cubic_data->cwnd_epoch; | |||||
cubic_data->undo_W_est = cubic_data->W_est; | |||||
cubic_data->undo_cwnd_prior = cubic_data->cwnd_prior; | |||||
cubic_data->undo_W_max = cubic_data->W_max; | |||||
cubic_data->undo_K = cubic_data->K; | |||||
} | } | ||||
cubic_data->flags |= CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT; | cubic_data->flags |= CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT; | ||||
cubic_data->prev_max_cwnd = cubic_data->max_cwnd; | cubic_data->undo_W_max = cubic_data->W_max; | ||||
cubic_data->num_cong_events++; | |||||
CCV(ccv, snd_ssthresh) = ((uint64_t)CCV(ccv, snd_cwnd) * | CCV(ccv, snd_ssthresh) = ((uint64_t)CCV(ccv, snd_cwnd) * | ||||
CUBIC_BETA) >> CUBIC_SHIFT; | CUBIC_BETA) >> CUBIC_SHIFT; | ||||
CCV(ccv, snd_cwnd) = mss; | CCV(ccv, snd_cwnd) = mss; | ||||
break; | break; | ||||
case CC_RTO_ERR: | case CC_RTO_ERR: | ||||
cubic_data->flags &= ~(CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT); | cubic_data->flags &= ~(CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT); | ||||
cubic_data->max_cwnd = cubic_data->prev_max_cwnd; | cubic_data->num_cong_events--; | ||||
cubic_data->prev_max_cwnd = cubic_data->prev_max_cwnd_cp; | cubic_data->K = cubic_data->undo_K; | ||||
cubic_data->t_last_cong = cubic_data->t_last_cong_prev; | cubic_data->cwnd_prior = cubic_data->undo_cwnd_prior; | ||||
cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); | cubic_data->W_max = cubic_data->undo_W_max; | ||||
cubic_data->W_est = cubic_data->undo_W_est; | |||||
cubic_data->cwnd_epoch = cubic_data->undo_cwnd_epoch; | |||||
cubic_data->t_epoch = cubic_data->undo_t_epoch; | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
cubic_conn_init(struct cc_var *ccv) | cubic_conn_init(struct cc_var *ccv) | ||||
{ | { | ||||
struct cubic *cubic_data; | struct cubic *cubic_data; | ||||
cubic_data = ccv->cc_data; | cubic_data = ccv->cc_data; | ||||
/* | /* | ||||
* Ensure we have a sane initial value for max_cwnd recorded. Without | * Ensure we have a sane initial value for W_max recorded. Without | ||||
* this here bad things happen when entries from the TCP hostcache | * this here bad things happen when entries from the TCP hostcache | ||||
* get used. | * get used. | ||||
*/ | */ | ||||
cubic_data->max_cwnd = CCV(ccv, snd_cwnd); | cubic_data->W_max = CCV(ccv, snd_cwnd); | ||||
} | } | ||||
static int | static int | ||||
cubic_mod_init(void) | cubic_mod_init(void) | ||||
{ | { | ||||
return (0); | return (0); | ||||
} | } | ||||
Show All 25 Lines | if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { | ||||
if (pipe < CCV(ccv, snd_ssthresh)) | if (pipe < CCV(ccv, snd_ssthresh)) | ||||
/* | /* | ||||
* Ensure that cwnd does not collapse to 1 MSS under | * Ensure that cwnd does not collapse to 1 MSS under | ||||
* adverse conditions. Implements RFC6582 | * adverse conditions. Implements RFC6582 | ||||
*/ | */ | ||||
CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) + | CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) + | ||||
CCV(ccv, t_maxseg); | CCV(ccv, t_maxseg); | ||||
else | else | ||||
/* Update cwnd based on beta and adjusted max_cwnd. */ | /* Update cwnd based on beta and adjusted W_max. */ | ||||
CCV(ccv, snd_cwnd) = max(((uint64_t)cubic_data->max_cwnd * | CCV(ccv, snd_cwnd) = max(((uint64_t)cubic_data->W_max * | ||||
CUBIC_BETA) >> CUBIC_SHIFT, | CUBIC_BETA) >> CUBIC_SHIFT, | ||||
2 * CCV(ccv, t_maxseg)); | 2 * CCV(ccv, t_maxseg)); | ||||
} | } | ||||
/* Calculate the average RTT between congestion epochs. */ | /* Calculate the average RTT between congestion epochs. */ | ||||
if (cubic_data->epoch_ack_count > 0 && | if (cubic_data->epoch_ack_count > 0 && | ||||
cubic_data->sum_rtt_usecs >= cubic_data->epoch_ack_count) { | cubic_data->sum_rtt_usecs >= cubic_data->epoch_ack_count) { | ||||
cubic_data->mean_rtt_usecs = (int)(cubic_data->sum_rtt_usecs / | cubic_data->mean_rtt_usecs = (int)(cubic_data->sum_rtt_usecs / | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | cubic_ssthresh_update(struct cc_var *ccv, uint32_t maxseg) | ||||
struct cubic *cubic_data; | struct cubic *cubic_data; | ||||
uint32_t ssthresh; | uint32_t ssthresh; | ||||
uint32_t cwnd; | uint32_t cwnd; | ||||
cubic_data = ccv->cc_data; | cubic_data = ccv->cc_data; | ||||
cwnd = CCV(ccv, snd_cwnd); | cwnd = CCV(ccv, snd_cwnd); | ||||
/* Fast convergence heuristic. */ | /* Fast convergence heuristic. */ | ||||
if (cwnd < cubic_data->max_cwnd) { | if (cwnd < cubic_data->W_max) { | ||||
cwnd = ((uint64_t)cwnd * CUBIC_FC_FACTOR) >> CUBIC_SHIFT; | cwnd = ((uint64_t)cwnd * CUBIC_FC_FACTOR) >> CUBIC_SHIFT; | ||||
} | } | ||||
cubic_data->prev_max_cwnd = cubic_data->max_cwnd; | cubic_data->undo_W_max = cubic_data->W_max; | ||||
cubic_data->max_cwnd = cwnd; | cubic_data->W_max = cwnd; | ||||
/* | /* | ||||
* On the first congestion event, set ssthresh to cwnd * 0.5 | * On the first congestion event, set ssthresh to cwnd * 0.5 | ||||
* and reduce max_cwnd to cwnd * beta. This aligns the cubic concave | * and reduce W_max to cwnd * beta. This aligns the cubic concave | ||||
* region appropriately. On subsequent congestion events, set | * region appropriately. On subsequent congestion events, set | ||||
* ssthresh to cwnd * beta. | * ssthresh to cwnd * beta. | ||||
*/ | */ | ||||
if ((cubic_data->flags & CUBICFLAG_CONG_EVENT) == 0) { | if ((cubic_data->flags & CUBICFLAG_CONG_EVENT) == 0) { | ||||
ssthresh = cwnd >> 1; | ssthresh = cwnd >> 1; | ||||
cubic_data->max_cwnd = ((uint64_t)cwnd * | cubic_data->W_max = ((uint64_t)cwnd * | ||||
CUBIC_BETA) >> CUBIC_SHIFT; | CUBIC_BETA) >> CUBIC_SHIFT; | ||||
} else { | } else { | ||||
ssthresh = ((uint64_t)cwnd * | ssthresh = ((uint64_t)cwnd * | ||||
CUBIC_BETA) >> CUBIC_SHIFT; | CUBIC_BETA) >> CUBIC_SHIFT; | ||||
} | } | ||||
CCV(ccv, snd_ssthresh) = max(ssthresh, 2 * maxseg); | CCV(ccv, snd_ssthresh) = max(ssthresh, 2 * maxseg); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |