Lines Matching refs:ccv
76 static void cubic_ack_received(struct cc_var *ccv, ccsignal_t type);
77 static void cubic_cb_destroy(struct cc_var *ccv);
78 static int cubic_cb_init(struct cc_var *ccv, void *ptr);
79 static void cubic_cong_signal(struct cc_var *ccv, ccsignal_t type);
80 static void cubic_conn_init(struct cc_var *ccv);
82 static void cubic_post_recovery(struct cc_var *ccv);
83 static void cubic_record_rtt(struct cc_var *ccv);
84 static void cubic_ssthresh_update(struct cc_var *ccv, uint32_t maxseg);
85 static void cubic_after_idle(struct cc_var *ccv);
87 static void cubic_newround(struct cc_var *ccv, uint32_t round_cnt);
88 static void cubic_rttsample(struct cc_var *ccv, uint32_t usec_rtt,
107 cubic_log_hystart_event(struct cc_var *ccv, struct cubic *cubicd, uint8_t mod, uint32_t flex1) in cubic_log_hystart_event() argument
128 tp = ccv->tp; in cubic_log_hystart_event()
148 log.u_bbr.pkt_epoch = ccv->flags; in cubic_log_hystart_event()
158 cubic_does_slow_start(struct cc_var *ccv, struct cubic *cubicd) in cubic_does_slow_start() argument
170 u_int cw = CCV(ccv, snd_cwnd); in cubic_does_slow_start()
171 uint32_t mss = tcp_fixed_maxseg(ccv->tp); in cubic_does_slow_start()
176 if (ccv->flags & CCF_USE_LOCAL_ABC) in cubic_does_slow_start()
177 abc_val = ccv->labc; in cubic_does_slow_start()
180 if ((ccv->flags & CCF_HYSTART_ALLOWED) && in cubic_does_slow_start()
199 cubic_log_hystart_event(ccv, cubicd, 1, rtt_thresh); in cubic_does_slow_start()
214 cubic_log_hystart_event(ccv, cubicd, 2, rtt_thresh); in cubic_does_slow_start()
218 if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) in cubic_does_slow_start()
219 incr = min(ccv->bytes_this_ack, in cubic_does_slow_start()
220 ccv->nsegs * abc_val * mss); in cubic_does_slow_start()
222 incr = min(ccv->bytes_this_ack, mss); in cubic_does_slow_start()
227 cubic_log_hystart_event(ccv, cubicd, 3, incr); in cubic_does_slow_start()
231 CCV(ccv, snd_cwnd) = min((cw + incr), in cubic_does_slow_start()
232 TCP_MAXWIN << CCV(ccv, snd_scale)); in cubic_does_slow_start()
236 cubic_ack_received(struct cc_var *ccv, ccsignal_t type) in cubic_ack_received() argument
241 uint32_t mss = tcp_fixed_maxseg(ccv->tp); in cubic_ack_received()
243 cubic_data = ccv->cc_data; in cubic_ack_received()
244 cubic_record_rtt(ccv); in cubic_ack_received()
250 if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && in cubic_ack_received()
251 (ccv->flags & CCF_CWND_LIMITED)) { in cubic_ack_received()
253 if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || in cubic_ack_received()
255 cubic_does_slow_start(ccv, cubic_data); in cubic_ack_received()
266 cubic_log_hystart_event(ccv, cubic_data, 11, CCV(ccv, snd_ssthresh)); in cubic_ack_received()
273 cubic_data->W_max = CCV(ccv, snd_cwnd); in cubic_ack_received()
292 W_est = tf_cwnd(ccv); in cubic_ack_received()
301 tcp_fixed_maxseg(ccv->tp), in cubic_ack_received()
309 CCV(ccv, snd_cwnd) = ulmin(W_est, INT_MAX); in cubic_ack_received()
311 } else if (CCV(ccv, snd_cwnd) < W_cubic) { in cubic_ack_received()
317 CCV(ccv, snd_cwnd) = ulmin(W_cubic, INT_MAX); in cubic_ack_received()
329 cubic_data->W_max < CCV(ccv, snd_cwnd)) { in cubic_ack_received()
330 cubic_data->W_max = CCV(ccv, snd_cwnd); in cubic_ack_received()
332 tcp_fixed_maxseg(ccv->tp)); in cubic_ack_received()
335 } else if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && in cubic_ack_received()
336 !(ccv->flags & CCF_CWND_LIMITED)) { in cubic_ack_received()
347 cubic_after_idle(struct cc_var *ccv) in cubic_after_idle() argument
351 cubic_data = ccv->cc_data; in cubic_after_idle()
353 cubic_data->W_max = ulmax(cubic_data->W_max, CCV(ccv, snd_cwnd)); in cubic_after_idle()
354 cubic_data->K = cubic_k(cubic_data->W_max / tcp_fixed_maxseg(ccv->tp)); in cubic_after_idle()
361 cubic_log_hystart_event(ccv, cubic_data, 12, CCV(ccv, snd_ssthresh)); in cubic_after_idle()
363 newreno_cc_after_idle(ccv); in cubic_after_idle()
368 cubic_cb_destroy(struct cc_var *ccv) in cubic_cb_destroy() argument
370 free(ccv->cc_data, M_CC_MEM); in cubic_cb_destroy()
380 cubic_cb_init(struct cc_var *ccv, void *ptr) in cubic_cb_init() argument
384 INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); in cubic_cb_init()
397 ccv->cc_data = cubic_data; in cubic_cb_init()
417 cubic_cong_signal(struct cc_var *ccv, ccsignal_t type) in cubic_cong_signal() argument
422 cubic_data = ccv->cc_data; in cubic_cong_signal()
423 mss = tcp_fixed_maxseg(ccv->tp); in cubic_cong_signal()
431 cubic_log_hystart_event(ccv, cubic_data, 10, CCV(ccv, snd_ssthresh)); in cubic_cong_signal()
433 if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { in cubic_cong_signal()
434 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { in cubic_cong_signal()
435 cubic_ssthresh_update(ccv, mss); in cubic_cong_signal()
440 ENTER_RECOVERY(CCV(ccv, t_flags)); in cubic_cong_signal()
449 cubic_log_hystart_event(ccv, cubic_data, 9, CCV(ccv, snd_ssthresh)); in cubic_cong_signal()
451 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { in cubic_cong_signal()
452 cubic_ssthresh_update(ccv, mss); in cubic_cong_signal()
456 CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); in cubic_cong_signal()
457 ENTER_CONGRECOVERY(CCV(ccv, t_flags)); in cubic_cong_signal()
463 if (CCV(ccv, t_rxtshift) == 1) { in cubic_cong_signal()
477 pipe = tcp_compute_pipe(ccv->tp); in cubic_cong_signal()
479 pipe = CCV(ccv, snd_max) - in cubic_cong_signal()
480 CCV(ccv, snd_fack) + in cubic_cong_signal()
481 CCV(ccv, sackhint.sack_bytes_rexmit); in cubic_cong_signal()
483 CCV(ccv, snd_ssthresh) = max(2, in cubic_cong_signal()
484 (((uint64_t)min(CCV(ccv, snd_wnd), pipe) * in cubic_cong_signal()
489 CCV(ccv, snd_cwnd) = mss; in cubic_cong_signal()
507 cubic_conn_init(struct cc_var *ccv) in cubic_conn_init() argument
511 cubic_data = ccv->cc_data; in cubic_conn_init()
518 cubic_data->W_max = CCV(ccv, snd_cwnd); in cubic_conn_init()
531 cubic_post_recovery(struct cc_var *ccv) in cubic_post_recovery() argument
535 uint32_t mss = tcp_fixed_maxseg(ccv->tp); in cubic_post_recovery()
537 cubic_data = ccv->cc_data; in cubic_post_recovery()
540 if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { in cubic_post_recovery()
549 pipe = tcp_compute_pipe(ccv->tp); in cubic_post_recovery()
551 pipe = CCV(ccv, snd_max) - ccv->curack; in cubic_post_recovery()
553 if (pipe < CCV(ccv, snd_ssthresh)) in cubic_post_recovery()
558 CCV(ccv, snd_cwnd) = max(pipe, mss) + mss; in cubic_post_recovery()
561 CCV(ccv, snd_cwnd) = max(((uint64_t)cubic_data->W_max * in cubic_post_recovery()
581 cubic_record_rtt(struct cc_var *ccv) in cubic_record_rtt() argument
587 if (CCV(ccv, t_rttupdated) >= CUBIC_MIN_RTT_SAMPLES) { in cubic_record_rtt()
588 cubic_data = ccv->cc_data; in cubic_record_rtt()
589 t_srtt_usecs = tcp_get_srtt(ccv->tp, in cubic_record_rtt()
627 cubic_ssthresh_update(struct cc_var *ccv, uint32_t maxseg) in cubic_ssthresh_update() argument
633 cubic_data = ccv->cc_data; in cubic_ssthresh_update()
634 cwnd = CCV(ccv, snd_cwnd); in cubic_ssthresh_update()
645 ssthresh = newreno_cc_cwnd_on_multiplicative_decrease(ccv, maxseg); in cubic_ssthresh_update()
661 CCV(ccv, snd_ssthresh) = max(ssthresh, 2 * maxseg); in cubic_ssthresh_update()
665 cubic_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas) in cubic_rttsample() argument
669 cubicd = ccv->cc_data; in cubic_rttsample()
691 cubic_log_hystart_event(ccv, cubicd, 8, cubicd->css_baseline_minrtt); in cubic_rttsample()
695 cubic_log_hystart_event(ccv, cubicd, 5, usec_rtt); in cubic_rttsample()
699 cubic_newround(struct cc_var *ccv, uint32_t round_cnt) in cubic_newround() argument
703 cubicd = ccv->cc_data; in cubic_newround()
712 if (ccv->flags & CCF_HYSTART_CAN_SH_CWND) { in cubic_newround()
719 if (ccv->flags & CCF_HYSTART_CONS_SSTH) { in cubic_newround()
720 CCV(ccv, snd_ssthresh) = ((cubicd->css_lowrtt_fas + cubicd->css_fas_at_css_entry) / 2); in cubic_newround()
722 CCV(ccv, snd_ssthresh) = cubicd->css_lowrtt_fas; in cubic_newround()
724 CCV(ccv, snd_cwnd) = cubicd->css_fas_at_css_entry; in cubic_newround()
727 CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd); in cubic_newround()
733 cubic_log_hystart_event(ccv, cubicd, 6, CCV(ccv, snd_ssthresh)); in cubic_newround()
736 cubic_log_hystart_event(ccv, cubicd, 4, round_cnt); in cubic_newround()