Lines Matching refs:cdg_data
296 struct cdg *cdg_data; in cdg_cb_init() local
300 cdg_data = malloc(sizeof(struct cdg), M_CC_MEM, M_NOWAIT); in cdg_cb_init()
301 if (cdg_data == NULL) in cdg_cb_init()
304 cdg_data = ptr; in cdg_cb_init()
306 cdg_data->shadow_w = 0; in cdg_cb_init()
307 cdg_data->max_qtrend = 0; in cdg_cb_init()
308 cdg_data->min_qtrend = 0; in cdg_cb_init()
309 cdg_data->queue_state = CDG_Q_UNKNOWN; in cdg_cb_init()
310 cdg_data->maxrtt_in_rtt = 0; in cdg_cb_init()
311 cdg_data->maxrtt_in_prevrtt = 0; in cdg_cb_init()
312 cdg_data->minrtt_in_rtt = INT_MAX; in cdg_cb_init()
313 cdg_data->minrtt_in_prevrtt = 0; in cdg_cb_init()
314 cdg_data->window_incr = 0; in cdg_cb_init()
315 cdg_data->rtt_count = 0; in cdg_cb_init()
316 cdg_data->consec_cong_cnt = 0; in cdg_cb_init()
317 cdg_data->sample_q_size = V_cdg_smoothing_factor; in cdg_cb_init()
318 cdg_data->num_samples = 0; in cdg_cb_init()
319 STAILQ_INIT(&cdg_data->qdiffmin_q); in cdg_cb_init()
320 STAILQ_INIT(&cdg_data->qdiffmax_q); in cdg_cb_init()
322 ccv->cc_data = cdg_data; in cdg_cb_init()
330 struct cdg *cdg_data = ccv->cc_data; in cdg_conn_init() local
336 cdg_data->shadow_w = CCV(ccv, snd_cwnd); in cdg_conn_init()
342 struct cdg *cdg_data; in cdg_cb_destroy() local
345 cdg_data = ccv->cc_data; in cdg_cb_destroy()
347 qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); in cdg_cb_destroy()
354 qds = STAILQ_FIRST(&cdg_data->qdiffmax_q); in cdg_cb_destroy()
417 struct cdg *cdg_data; in cdg_window_increase() local
420 cdg_data = ccv->cc_data; in cdg_window_increase()
427 cdg_data->window_incr = cdg_data->rtt_count = 0; in cdg_window_increase()
435 if (++cdg_data->rtt_count >= V_cdg_alpha_inc) { in cdg_window_increase()
436 cdg_data->window_incr++; in cdg_window_increase()
437 cdg_data->rtt_count = 0; in cdg_window_increase()
440 cdg_data->window_incr; in cdg_window_increase()
445 if (cdg_data->shadow_w > 0) in cdg_window_increase()
446 cdg_data->shadow_w = ulmin(cdg_data->shadow_w + s_w_incr, in cdg_window_increase()
456 struct cdg *cdg_data = ccv->cc_data; in cdg_cong_signal() local
464 cdg_data->window_incr = cdg_data->rtt_count = 0; in cdg_cong_signal()
473 cdg_data->queue_state < CDG_Q_FULL) { in cdg_cong_signal()
482 if (cdg_data->shadow_w > 0) in cdg_cong_signal()
483 cdg_data->shadow_w = cdg_window_decrease(ccv, in cdg_cong_signal()
484 cdg_data->shadow_w, RENO_BETA); in cdg_cong_signal()
486 CCV(ccv, snd_ssthresh) = max(cdg_data->shadow_w, in cdg_cong_signal()
490 cdg_data->window_incr = cdg_data->rtt_count = 0; in cdg_cong_signal()
531 calc_moving_average(struct cdg *cdg_data, long qdiff_max, long qdiff_min) in calc_moving_average() argument
535 ++cdg_data->num_samples; in calc_moving_average()
536 if (cdg_data->num_samples > cdg_data->sample_q_size) { in calc_moving_average()
538 qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); in calc_moving_average()
539 cdg_data->min_qtrend = cdg_data->min_qtrend + in calc_moving_average()
540 (qdiff_min - qds->qdiff) / cdg_data->sample_q_size; in calc_moving_average()
541 STAILQ_REMOVE_HEAD(&cdg_data->qdiffmin_q, qdiff_lnk); in calc_moving_average()
543 STAILQ_INSERT_TAIL(&cdg_data->qdiffmin_q, qds, qdiff_lnk); in calc_moving_average()
546 qds = STAILQ_FIRST(&cdg_data->qdiffmax_q); in calc_moving_average()
547 cdg_data->max_qtrend = cdg_data->max_qtrend + in calc_moving_average()
548 (qdiff_max - qds->qdiff) / cdg_data->sample_q_size; in calc_moving_average()
549 STAILQ_REMOVE_HEAD(&cdg_data->qdiffmax_q, qdiff_lnk); in calc_moving_average()
551 STAILQ_INSERT_TAIL(&cdg_data->qdiffmax_q, qds, qdiff_lnk); in calc_moving_average()
552 --cdg_data->num_samples; in calc_moving_average()
556 cdg_data->min_qtrend = cdg_data->min_qtrend + in calc_moving_average()
557 qdiff_min / cdg_data->sample_q_size; in calc_moving_average()
559 STAILQ_INSERT_TAIL(&cdg_data->qdiffmin_q, qds, in calc_moving_average()
565 cdg_data->max_qtrend = cdg_data->max_qtrend + in calc_moving_average()
566 qdiff_max / cdg_data->sample_q_size; in calc_moving_average()
568 STAILQ_INSERT_TAIL(&cdg_data->qdiffmax_q, qds, in calc_moving_average()
577 struct cdg *cdg_data; in cdg_ack_received() local
582 cdg_data = ccv->cc_data; in cdg_ack_received()
586 cdg_data->maxrtt_in_rtt = imax(e_t->rtt, cdg_data->maxrtt_in_rtt); in cdg_ack_received()
587 cdg_data->minrtt_in_rtt = imin(e_t->rtt, cdg_data->minrtt_in_rtt); in cdg_ack_received()
597 if (cdg_data->maxrtt_in_prevrtt) { in cdg_ack_received()
598 qdiff_max = ((long)(cdg_data->maxrtt_in_rtt - in cdg_ack_received()
599 cdg_data->maxrtt_in_prevrtt) << D_P_E ); in cdg_ack_received()
600 qdiff_min = ((long)(cdg_data->minrtt_in_rtt - in cdg_ack_received()
601 cdg_data->minrtt_in_prevrtt) << D_P_E ); in cdg_ack_received()
603 if (cdg_data->sample_q_size == 0) { in cdg_ack_received()
604 cdg_data->max_qtrend = qdiff_max; in cdg_ack_received()
605 cdg_data->min_qtrend = qdiff_min; in cdg_ack_received()
607 calc_moving_average(cdg_data, qdiff_max, qdiff_min); in cdg_ack_received()
612 else if (cdg_data->min_qtrend > 0) in cdg_ack_received()
613 congestion = prob_backoff(cdg_data->min_qtrend); in cdg_ack_received()
616 else if (cdg_data->max_qtrend > 0) in cdg_ack_received()
617 congestion = prob_backoff(cdg_data->max_qtrend); in cdg_ack_received()
620 if (cdg_data->min_qtrend > 0 && in cdg_ack_received()
621 cdg_data->max_qtrend <= 0) { in cdg_ack_received()
622 cdg_data->queue_state = CDG_Q_FULL; in cdg_ack_received()
623 } else if (cdg_data->min_qtrend >= 0 && in cdg_ack_received()
624 cdg_data->max_qtrend < 0) { in cdg_ack_received()
625 cdg_data->queue_state = CDG_Q_EMPTY; in cdg_ack_received()
626 cdg_data->shadow_w = 0; in cdg_ack_received()
627 } else if (cdg_data->min_qtrend > 0 && in cdg_ack_received()
628 cdg_data->max_qtrend > 0) { in cdg_ack_received()
629 cdg_data->queue_state = CDG_Q_RISING; in cdg_ack_received()
630 } else if (cdg_data->min_qtrend < 0 && in cdg_ack_received()
631 cdg_data->max_qtrend < 0) { in cdg_ack_received()
632 cdg_data->queue_state = CDG_Q_FALLING; in cdg_ack_received()
635 if (cdg_data->min_qtrend < 0 || in cdg_ack_received()
636 cdg_data->max_qtrend < 0) in cdg_ack_received()
637 cdg_data->consec_cong_cnt = 0; in cdg_ack_received()
640 cdg_data->minrtt_in_prevrtt = cdg_data->minrtt_in_rtt; in cdg_ack_received()
641 cdg_data->minrtt_in_rtt = INT_MAX; in cdg_ack_received()
642 cdg_data->maxrtt_in_prevrtt = cdg_data->maxrtt_in_rtt; in cdg_ack_received()
643 cdg_data->maxrtt_in_rtt = 0; in cdg_ack_received()
648 cdg_data->consec_cong_cnt++; in cdg_ack_received()
650 if (cdg_data->consec_cong_cnt <= V_cdg_consec_cong) in cdg_ack_received()
659 if (cdg_data->consec_cong_cnt >= in cdg_ack_received()
661 cdg_data->consec_cong_cnt = 0; in cdg_ack_received()
664 cdg_data->maxrtt_in_prevrtt = 0; in cdg_ack_received()
669 cdg_data->shadow_w = ulmax(CCV(ccv, snd_cwnd), in cdg_ack_received()
670 cdg_data->shadow_w); in cdg_ack_received()