FreeBSD/sys/netinet/cc/cc_dctcp.c
/*
 * Update the fraction of marked bytes represented as 'alpha'.
 * Also initialize several internal parameters at the end of this function.
 */
Update the fraction of marked bytes represented as 'alpha'.
Also initialize several internal parameters at the end of this function.
Update the fraction of marked bytes represented as ' alpha ' . Also initialize several internal parameters at the end of this function .
static void
dctcp_update_alpha(struct cc_var *ccv)
{
	struct dctcp *dctcp_data;
	int alpha_prev;
	dctcp_data = ccv->cc_data;
	alpha_prev = dctcp_data->alpha;
	dctcp_data->bytes_total = max(dctcp_data->bytes_total, 1);
	dctcp_data->alpha = min(alpha_prev - (alpha_prev >> V_dctcp_shift_g) +
	    (dctcp_data->bytes_ecn << (10 - V_dctcp_shift_g)) /
	    dctcp_data->bytes_total, MAX_ALPHA_VALUE);
	dctcp_data->bytes_ecn = 0;
	dctcp_data->bytes_total = 0;
	dctcp_data->save_sndnxt = CCV(ccv, snd_nxt);
}
static void dctcp_update_alpha ( struct cc_var * ccv ) { struct dctcp * dctcp_data ; int alpha_prev ; dctcp_data = ccv -> cc_data ; alpha_prev = dctcp_data -> alpha ; dctcp_data -> bytes_total = max ( dctcp_data -> bytes_total , 1 ) ; dctcp_data -> alpha = min ( alpha_prev - ( alpha_prev >> V_dctcp_shift_g ) + ( dctcp_data -> bytes_ecn << ( 10 - V_dctcp_shift_g ) ) / dctcp_data -> bytes_total , MAX_ALPHA_VALUE ) ; dctcp_data -> bytes_ecn = 0 ; dctcp_data -> bytes_total = 0 ; dctcp_data -> save_sndnxt = CCV ( ccv , snd_nxt ) ; }
Update the fraction of marked bytes represented as 'alpha'.
Update the fraction of marked bytes represented as ' alpha ' .
/*
	 * Update alpha: alpha = (1 - g) * alpha + g * F.
	 * Here:
	 * g is weight factor
	 *	recommaded to be set to 1/16
	 *	small g = slow convergence between competitive DCTCP flows
	 *	large g = impacts low utilization of bandwidth at switches
	 * F is fraction of marked segments in last RTT
	 *	updated every RTT
	 * Alpha must be round to 0 - MAX_ALPHA_VALUE.
	 */ /* Initialize internal parameters for next alpha calculation */