Lines Matching refs:ccv
86 static void newreno_cb_destroy(struct cc_var *ccv);
87 static void newreno_ack_received(struct cc_var *ccv, ccsignal_t type);
88 static void newreno_after_idle(struct cc_var *ccv);
89 static void newreno_cong_signal(struct cc_var *ccv, ccsignal_t type);
90 static int newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf);
91 static void newreno_newround(struct cc_var *ccv, uint32_t round_cnt);
92 static void newreno_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas);
93 static int newreno_cb_init(struct cc_var *ccv, void *);
117 newreno_log_hystart_event(struct cc_var *ccv, struct newreno *nreno, uint8_t mod, uint32_t flex1) in newreno_log_hystart_event() argument
138 tp = ccv->tp; in newreno_log_hystart_event()
158 log.u_bbr.pkt_epoch = ccv->flags; in newreno_log_hystart_event()
174 newreno_cb_init(struct cc_var *ccv, void *ptr) in newreno_cb_init() argument
178 INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); in newreno_cb_init()
180 ccv->cc_data = malloc(sizeof(struct newreno), M_CC_MEM, M_NOWAIT); in newreno_cb_init()
181 if (ccv->cc_data == NULL) in newreno_cb_init()
184 ccv->cc_data = ptr; in newreno_cb_init()
185 nreno = (struct newreno *)ccv->cc_data; in newreno_cb_init()
209 newreno_cb_destroy(struct cc_var *ccv) in newreno_cb_destroy() argument
211 free(ccv->cc_data, M_CC_MEM); in newreno_cb_destroy()
215 newreno_ack_received(struct cc_var *ccv, ccsignal_t type) in newreno_ack_received() argument
218 uint32_t mss = tcp_fixed_maxseg(ccv->tp); in newreno_ack_received()
220 nreno = ccv->cc_data; in newreno_ack_received()
221 if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && in newreno_ack_received()
222 (ccv->flags & CCF_CWND_LIMITED)) { in newreno_ack_received()
223 u_int cw = CCV(ccv, snd_cwnd); in newreno_ack_received()
253 if (cw > CCV(ccv, snd_ssthresh)) { in newreno_ack_received()
263 newreno_log_hystart_event(ccv, nreno, 11, CCV(ccv, snd_ssthresh)); in newreno_ack_received()
266 if (ccv->flags & CCF_ABC_SENTAWND) in newreno_ack_received()
267 ccv->flags &= ~CCF_ABC_SENTAWND; in newreno_ack_received()
285 if (ccv->flags & CCF_USE_LOCAL_ABC) in newreno_ack_received()
286 abc_val = ccv->labc; in newreno_ack_received()
289 if ((ccv->flags & CCF_HYSTART_ALLOWED) && in newreno_ack_received()
308 newreno_log_hystart_event(ccv, nreno, 1, rtt_thresh); in newreno_ack_received()
322 newreno_log_hystart_event(ccv, nreno, 2, rtt_thresh); in newreno_ack_received()
326 if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) in newreno_ack_received()
327 incr = min(ccv->bytes_this_ack, in newreno_ack_received()
328 ccv->nsegs * abc_val * mss); in newreno_ack_received()
330 incr = min(ccv->bytes_this_ack, mss); in newreno_ack_received()
335 newreno_log_hystart_event(ccv, nreno, 3, incr); in newreno_ack_received()
340 CCV(ccv, snd_cwnd) = min(cw + incr, in newreno_ack_received()
341 TCP_MAXWIN << CCV(ccv, snd_scale)); in newreno_ack_received()
346 newreno_after_idle(struct cc_var *ccv) in newreno_after_idle() argument
350 nreno = ccv->cc_data; in newreno_after_idle()
351 newreno_cc_after_idle(ccv); in newreno_after_idle()
358 newreno_log_hystart_event(ccv, nreno, 12, CCV(ccv, snd_ssthresh)); in newreno_after_idle()
366 newreno_cong_signal(struct cc_var *ccv, ccsignal_t type) in newreno_cong_signal() argument
371 cwin = CCV(ccv, snd_cwnd); in newreno_cong_signal()
372 mss = tcp_fixed_maxseg(ccv->tp); in newreno_cong_signal()
373 nreno = ccv->cc_data; in newreno_cong_signal()
402 newreno_log_hystart_event(ccv, nreno, 10, CCV(ccv, snd_ssthresh)); in newreno_cong_signal()
404 if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { in newreno_cong_signal()
405 if (IN_CONGRECOVERY(CCV(ccv, t_flags) && in newreno_cong_signal()
407 CCV(ccv, snd_ssthresh) = in newreno_cong_signal()
408 ((uint64_t)CCV(ccv, snd_ssthresh) * in newreno_cong_signal()
411 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) in newreno_cong_signal()
412 CCV(ccv, snd_ssthresh) = cwin; in newreno_cong_signal()
413 ENTER_RECOVERY(CCV(ccv, t_flags)); in newreno_cong_signal()
421 newreno_log_hystart_event(ccv, nreno, 9, CCV(ccv, snd_ssthresh)); in newreno_cong_signal()
423 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { in newreno_cong_signal()
424 CCV(ccv, snd_ssthresh) = cwin; in newreno_cong_signal()
425 CCV(ccv, snd_cwnd) = cwin; in newreno_cong_signal()
426 ENTER_CONGRECOVERY(CCV(ccv, t_flags)); in newreno_cong_signal()
430 if (CCV(ccv, t_rxtshift) == 1) { in newreno_cong_signal()
432 pipe = tcp_compute_pipe(ccv->tp); in newreno_cong_signal()
434 pipe = CCV(ccv, snd_max) - in newreno_cong_signal()
435 CCV(ccv, snd_fack) + in newreno_cong_signal()
436 CCV(ccv, sackhint.sack_bytes_rexmit); in newreno_cong_signal()
438 CCV(ccv, snd_ssthresh) = max(2, in newreno_cong_signal()
439 ((uint64_t)min(CCV(ccv, snd_wnd), pipe) * in newreno_cong_signal()
443 CCV(ccv, snd_cwnd) = mss; in newreno_cong_signal()
451 newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) in newreno_ctl_output() argument
459 if (CC_ALGO(ccv->tp) != &newreno_cc_algo) in newreno_ctl_output()
462 nreno = (struct newreno *)ccv->cc_data; in newreno_ctl_output()
518 newreno_newround(struct cc_var *ccv, uint32_t round_cnt) in newreno_newround() argument
522 nreno = (struct newreno *)ccv->cc_data; in newreno_newround()
531 if (ccv->flags & CCF_HYSTART_CAN_SH_CWND) { in newreno_newround()
538 if (ccv->flags & CCF_HYSTART_CONS_SSTH) { in newreno_newround()
539 CCV(ccv, snd_ssthresh) = ((nreno->css_lowrtt_fas + nreno->css_fas_at_css_entry) / 2); in newreno_newround()
541 CCV(ccv, snd_ssthresh) = nreno->css_lowrtt_fas; in newreno_newround()
543 CCV(ccv, snd_cwnd) = nreno->css_fas_at_css_entry; in newreno_newround()
546 CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd); in newreno_newround()
552 newreno_log_hystart_event(ccv, nreno, 6, CCV(ccv, snd_ssthresh)); in newreno_newround()
555 newreno_log_hystart_event(ccv, nreno, 4, round_cnt); in newreno_newround()
559 newreno_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas) in newreno_rttsample() argument
563 nreno = (struct newreno *)ccv->cc_data; in newreno_rttsample()
585 newreno_log_hystart_event(ccv, nreno, 8, nreno->css_baseline_minrtt); in newreno_rttsample()
589 newreno_log_hystart_event(ccv, nreno, 5, usec_rtt); in newreno_rttsample()