Lines Matching refs:ccv
139 static void htcp_ack_received(struct cc_var *ccv, ccsignal_t type);
140 static void htcp_cb_destroy(struct cc_var *ccv);
141 static int htcp_cb_init(struct cc_var *ccv, void *ptr);
142 static void htcp_cong_signal(struct cc_var *ccv, ccsignal_t type);
144 static void htcp_post_recovery(struct cc_var *ccv);
145 static void htcp_recalc_alpha(struct cc_var *ccv);
146 static void htcp_recalc_beta(struct cc_var *ccv);
147 static void htcp_record_rtt(struct cc_var *ccv);
148 static void htcp_ssthresh_update(struct cc_var *ccv);
193 htcp_ack_received(struct cc_var *ccv, ccsignal_t type) in htcp_ack_received() argument
196 uint32_t mss = tcp_fixed_maxseg(ccv->tp); in htcp_ack_received()
198 htcp_data = ccv->cc_data; in htcp_ack_received()
199 htcp_record_rtt(ccv); in htcp_ack_received()
206 if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && in htcp_ack_received()
207 (ccv->flags & CCF_CWND_LIMITED) && (!V_tcp_do_rfc3465 || in htcp_ack_received()
208 CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || in htcp_ack_received()
209 (V_tcp_do_rfc3465 && ccv->flags & CCF_ABC_SENTAWND))) { in htcp_ack_received()
210 htcp_recalc_beta(ccv); in htcp_ack_received()
211 htcp_recalc_alpha(ccv); in htcp_ack_received()
218 CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)) in htcp_ack_received()
219 newreno_cc_ack_received(ccv, type); in htcp_ack_received()
223 CCV(ccv, snd_cwnd) += htcp_data->alpha * in htcp_ack_received()
225 ccv->flags &= ~CCF_ABC_SENTAWND; in htcp_ack_received()
232 CCV(ccv, snd_cwnd) += (((htcp_data->alpha << in htcp_ack_received()
234 CCV(ccv, snd_cwnd) / mss))) * in htcp_ack_received()
241 htcp_cb_destroy(struct cc_var *ccv) in htcp_cb_destroy() argument
243 free(ccv->cc_data, M_CC_MEM); in htcp_cb_destroy()
253 htcp_cb_init(struct cc_var *ccv, void *ptr) in htcp_cb_init() argument
257 INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); in htcp_cb_init()
273 ccv->cc_data = htcp_data; in htcp_cb_init()
282 htcp_cong_signal(struct cc_var *ccv, ccsignal_t type) in htcp_cong_signal() argument
287 htcp_data = ccv->cc_data; in htcp_cong_signal()
288 mss = tcp_fixed_maxseg(ccv->tp); in htcp_cong_signal()
292 if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { in htcp_cong_signal()
293 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { in htcp_cong_signal()
302 htcp_ssthresh_update(ccv); in htcp_cong_signal()
304 htcp_data->prev_cwnd = CCV(ccv, snd_cwnd); in htcp_cong_signal()
306 ENTER_RECOVERY(CCV(ccv, t_flags)); in htcp_cong_signal()
311 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { in htcp_cong_signal()
318 htcp_ssthresh_update(ccv); in htcp_cong_signal()
319 CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); in htcp_cong_signal()
321 htcp_data->prev_cwnd = CCV(ccv, snd_cwnd); in htcp_cong_signal()
322 ENTER_CONGRECOVERY(CCV(ccv, t_flags)); in htcp_cong_signal()
327 if (CCV(ccv, t_rxtshift) == 1) { in htcp_cong_signal()
329 pipe = tcp_compute_pipe(ccv->tp); in htcp_cong_signal()
331 pipe = CCV(ccv, snd_max) - in htcp_cong_signal()
332 CCV(ccv, snd_fack) + in htcp_cong_signal()
333 CCV(ccv, sackhint.sack_bytes_rexmit); in htcp_cong_signal()
335 CCV(ccv, snd_ssthresh) = max(2, in htcp_cong_signal()
336 min(CCV(ccv, snd_wnd), pipe) / 2 / mss) * mss; in htcp_cong_signal()
338 CCV(ccv, snd_cwnd) = mss; in htcp_cong_signal()
346 if (CCV(ccv, t_rxtshift) >= 2) in htcp_cong_signal()
370 htcp_post_recovery(struct cc_var *ccv) in htcp_post_recovery() argument
374 uint32_t mss = tcp_fixed_maxseg(ccv->tp); in htcp_post_recovery()
377 htcp_data = ccv->cc_data; in htcp_post_recovery()
379 if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { in htcp_post_recovery()
388 pipe = tcp_compute_pipe(ccv->tp); in htcp_post_recovery()
390 pipe = CCV(ccv, snd_max) - ccv->curack; in htcp_post_recovery()
392 if (pipe < CCV(ccv, snd_ssthresh)) in htcp_post_recovery()
397 CCV(ccv, snd_cwnd) = max(pipe, mss) + mss; in htcp_post_recovery()
399 CCV(ccv, snd_cwnd) = max(1, ((htcp_data->beta * in htcp_post_recovery()
406 htcp_recalc_alpha(struct cc_var *ccv) in htcp_recalc_alpha() argument
411 htcp_data = ccv->cc_data; in htcp_recalc_alpha()
455 (tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS) << HTCP_SHIFT) / in htcp_recalc_alpha()
467 htcp_recalc_beta(struct cc_var *ccv) in htcp_recalc_beta() argument
471 htcp_data = ccv->cc_data; in htcp_recalc_beta()
493 htcp_record_rtt(struct cc_var *ccv) in htcp_record_rtt() argument
497 htcp_data = ccv->cc_data; in htcp_record_rtt()
506 if ((tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS) < htcp_data->minrtt || in htcp_record_rtt()
508 (CCV(ccv, t_rttupdated) >= HTCP_MIN_RTT_SAMPLES)) in htcp_record_rtt()
509 htcp_data->minrtt = tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS); in htcp_record_rtt()
515 if (tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS) > htcp_data->maxrtt in htcp_record_rtt()
516 && CCV(ccv, t_rttupdated) >= HTCP_MIN_RTT_SAMPLES) in htcp_record_rtt()
517 htcp_data->maxrtt = tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS); in htcp_record_rtt()
524 htcp_ssthresh_update(struct cc_var *ccv) in htcp_ssthresh_update() argument
528 htcp_data = ccv->cc_data; in htcp_ssthresh_update()
534 if (CCV(ccv, snd_ssthresh) == TCP_MAXWIN << TCP_MAX_WINSHIFT) in htcp_ssthresh_update()
535 CCV(ccv, snd_ssthresh) = ((u_long)CCV(ccv, snd_cwnd) * in htcp_ssthresh_update()
538 htcp_recalc_beta(ccv); in htcp_ssthresh_update()
539 CCV(ccv, snd_ssthresh) = ((u_long)CCV(ccv, snd_cwnd) * in htcp_ssthresh_update()