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->ccvc.tcp;
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 u_int incr = CCV(ccv, t_maxseg);
175 if (ccv->flags & CCF_USE_LOCAL_ABC)
176 abc_val = ccv->labc;
179 if ((ccv->flags & CCF_HYSTART_ALLOWED) &&
198 cubic_log_hystart_event(ccv, cubicd, 1, rtt_thresh);
213 cubic_log_hystart_event(ccv, cubicd, 2, rtt_thresh);
217 if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max))
218 incr = min(ccv->bytes_this_ack,
219 ccv->nsegs * abc_val *
220 CCV(ccv, t_maxseg));
222 incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg));
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)
242 cubic_data = ccv->cc_data;
243 cubic_record_rtt(ccv);
249 if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) &&
250 (ccv->flags & CCF_CWND_LIMITED)) {
252 if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) ||
254 cubic_does_slow_start(ccv, cubic_data);
265 cubic_log_hystart_event(ccv, cubic_data, 11, CCV(ccv, snd_ssthresh));
272 cubic_data->W_max = CCV(ccv, snd_cwnd);
281 CCV(ccv, t_maxseg));
299 cubic_data->W_max, CCV(ccv, t_maxseg));
304 CCV(ccv, t_maxseg),
307 ccv->flags &= ~CCF_ABC_SENTAWND;
314 if (CCV(ccv, snd_cwnd) < W_est)
315 CCV(ccv, snd_cwnd) = ulmin(W_est, INT_MAX);
316 } else if (CCV(ccv, snd_cwnd) < W_cubic) {
322 CCV(ccv, snd_cwnd) = ulmin(W_cubic, INT_MAX);
333 cubic_data->W_max < CCV(ccv, snd_cwnd)) {
334 cubic_data->W_max = CCV(ccv, snd_cwnd);
336 CCV(ccv, t_maxseg));
339 } else if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) &&
340 !(ccv->flags & CCF_CWND_LIMITED)) {
351 cubic_after_idle(struct cc_var *ccv)
355 cubic_data = ccv->cc_data;
357 cubic_data->W_max = ulmax(cubic_data->W_max, CCV(ccv, snd_cwnd));
358 cubic_data->K = cubic_k(cubic_data->W_max / CCV(ccv, t_maxseg));
365 cubic_log_hystart_event(ccv, cubic_data, 12, CCV(ccv, snd_ssthresh));
367 newreno_cc_after_idle(ccv);
372 cubic_cb_destroy(struct cc_var *ccv)
374 free(ccv->cc_data, M_CC_MEM);
384 cubic_cb_init(struct cc_var *ccv, void *ptr)
388 INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp));
401 ccv->cc_data = cubic_data;
421 cubic_cong_signal(struct cc_var *ccv, ccsignal_t type)
426 cubic_data = ccv->cc_data;
427 mss = tcp_fixed_maxseg(ccv->ccvc.tcp);
435 cubic_log_hystart_event(ccv, cubic_data, 10, CCV(ccv, snd_ssthresh));
437 if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) {
438 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
439 cubic_ssthresh_update(ccv, mss);
444 ENTER_RECOVERY(CCV(ccv, t_flags));
453 cubic_log_hystart_event(ccv, cubic_data, 9, CCV(ccv, snd_ssthresh));
455 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
456 cubic_ssthresh_update(ccv, mss);
460 CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
461 ENTER_CONGRECOVERY(CCV(ccv, t_flags));
467 if (CCV(ccv, t_rxtshift) == 1) {
481 pipe = tcp_compute_pipe(ccv->ccvc.tcp);
483 pipe = CCV(ccv, snd_max) -
484 CCV(ccv, snd_fack) +
485 CCV(ccv, sackhint.sack_bytes_rexmit);
487 CCV(ccv, snd_ssthresh) = max(2,
488 (((uint64_t)min(CCV(ccv, snd_wnd), pipe) *
494 CCV(ccv, snd_cwnd) = mss;
513 cubic_conn_init(struct cc_var *ccv)
517 cubic_data = ccv->cc_data;
524 cubic_data->W_max = CCV(ccv, snd_cwnd);
537 cubic_post_recovery(struct cc_var *ccv)
542 cubic_data = ccv->cc_data;
545 if (IN_FASTRECOVERY(CCV(ccv, t_flags))) {
554 pipe = tcp_compute_pipe(ccv->ccvc.tcp);
556 pipe = CCV(ccv, snd_max) - ccv->curack;
558 if (pipe < CCV(ccv, snd_ssthresh))
563 CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) +
564 CCV(ccv, t_maxseg);
567 CCV(ccv, snd_cwnd) = max(((uint64_t)cubic_data->W_max *
569 2 * CCV(ccv, t_maxseg));
587 cubic_record_rtt(struct cc_var *ccv)
593 if (CCV(ccv, t_rttupdated) >= CUBIC_MIN_RTT_SAMPLES) {
594 cubic_data = ccv->cc_data;
595 t_srtt_usecs = tcp_get_srtt(ccv->ccvc.tcp,
633 cubic_ssthresh_update(struct cc_var *ccv, uint32_t maxseg)
639 cubic_data = ccv->cc_data;
640 cwnd = CCV(ccv, snd_cwnd);
663 CCV(ccv, snd_ssthresh) = max(ssthresh, 2 * maxseg);
667 cubic_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas)
671 cubicd = ccv->cc_data;
693 cubic_log_hystart_event(ccv, cubicd, 8, cubicd->css_baseline_minrtt);
697 cubic_log_hystart_event(ccv, cubicd, 5, usec_rtt);
701 cubic_newround(struct cc_var *ccv, uint32_t round_cnt)
705 cubicd = ccv->cc_data;
714 if (ccv->flags & CCF_HYSTART_CAN_SH_CWND) {
721 if (ccv->flags & CCF_HYSTART_CONS_SSTH) {
722 CCV(ccv, snd_ssthresh) = ((cubicd->css_lowrtt_fas + cubicd->css_fas_at_css_entry) / 2);
724 CCV(ccv, snd_ssthresh) = cubicd->css_lowrtt_fas;
726 CCV(ccv, snd_cwnd) = cubicd->css_fas_at_css_entry;
729 CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd);
735 cubic_log_hystart_event(ccv, cubicd, 6, CCV(ccv, snd_ssthresh));
738 cubic_log_hystart_event(ccv, cubicd, 4, round_cnt);