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