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

Function cdg_window_increase

freebsd/netinet/cc/cc_cdg.c:406–443  ·  view source on GitHub ↗

* Window increase function * This window increase function is independent of the initial window size * to ensure small window flows are not discriminated against (i.e. fairness). * It increases at 1pkt/rtt like Reno for alpha_inc rtts, and then 2pkts/rtt for * the next alpha_inc rtts, etc. */

Source from the content-addressed store, hash-verified

404 * the next alpha_inc rtts, etc.
405 */
406static void
407cdg_window_increase(struct cc_var *ccv, int new_measurement)
408{
409 struct cdg *cdg_data;
410 int incr, s_w_incr;
411
412 cdg_data = ccv->cc_data;
413 incr = s_w_incr = 0;
414
415 if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)) {
416 /* Slow start. */
417 incr = CCV(ccv, t_maxseg);
418 s_w_incr = incr;
419 cdg_data->window_incr = cdg_data->rtt_count = 0;
420 } else {
421 /* Congestion avoidance. */
422 if (new_measurement) {
423 s_w_incr = CCV(ccv, t_maxseg);
424 if (V_cdg_alpha_inc == 0) {
425 incr = CCV(ccv, t_maxseg);
426 } else {
427 if (++cdg_data->rtt_count >= V_cdg_alpha_inc) {
428 cdg_data->window_incr++;
429 cdg_data->rtt_count = 0;
430 }
431 incr = CCV(ccv, t_maxseg) *
432 cdg_data->window_incr;
433 }
434 }
435 }
436
437 if (cdg_data->shadow_w > 0)
438 cdg_data->shadow_w = ulmin(cdg_data->shadow_w + s_w_incr,
439 TCP_MAXWIN << CCV(ccv, snd_scale));
440
441 CCV(ccv, snd_cwnd) = ulmin(CCV(ccv, snd_cwnd) + incr,
442 TCP_MAXWIN << CCV(ccv, snd_scale));
443}
444
445static void
446cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type)

Callers 1

cdg_ack_receivedFunction · 0.85

Calls 1

ulminFunction · 0.85

Tested by

no test coverage detected