MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dctcp_update_alpha

Function dctcp_update_alpha

freebsd/netinet/cc/cc_dctcp.c:365–394  ·  view source on GitHub ↗

* Update the fraction of marked bytes represented as 'alpha'. * Also initialize several internal parameters at the end of this function. */

Source from the content-addressed store, hash-verified

363 * Also initialize several internal parameters at the end of this function.
364 */
365static void
366dctcp_update_alpha(struct cc_var *ccv)
367{
368 struct dctcp *dctcp_data;
369 int alpha_prev;
370
371 dctcp_data = ccv->cc_data;
372 alpha_prev = dctcp_data->alpha;
373 dctcp_data->bytes_total = max(dctcp_data->bytes_total, 1);
374
375 /*
376 * Update alpha: alpha = (1 - g) * alpha + g * M.
377 * Here:
378 * g is weight factor
379 * recommaded to be set to 1/16
380 * small g = slow convergence between competitive DCTCP flows
381 * large g = impacts low utilization of bandwidth at switches
382 * M is fraction of marked segments in last RTT
383 * updated every RTT
384 * Alpha must be round to 0 - MAX_ALPHA_VALUE.
385 */
386 dctcp_data->alpha = ulmin(alpha_prev - (alpha_prev >> V_dctcp_shift_g) +
387 ((uint64_t)dctcp_data->bytes_ecn << (DCTCP_SHIFT - V_dctcp_shift_g)) /
388 dctcp_data->bytes_total, MAX_ALPHA_VALUE);
389
390 /* Initialize internal parameters for next alpha calculation */
391 dctcp_data->bytes_ecn = 0;
392 dctcp_data->bytes_total = 0;
393 dctcp_data->save_sndnxt = CCV(ccv, snd_nxt);
394}
395
396static int
397dctcp_alpha_handler(SYSCTL_HANDLER_ARGS)

Callers 3

dctcp_ack_receivedFunction · 0.85
dctcp_cong_signalFunction · 0.85
dctcp_post_recoveryFunction · 0.85

Calls 2

maxFunction · 0.85
ulminFunction · 0.85

Tested by

no test coverage detected