Lines Matching full:net

61 sctp_enforce_cwnd_limit(struct sctp_association *assoc, struct sctp_nets *net)  in sctp_enforce_cwnd_limit()  argument
64 (net->cwnd > assoc->max_cwnd) && in sctp_enforce_cwnd_limit()
65 (net->cwnd > (net->mtu - sizeof(struct sctphdr)))) { in sctp_enforce_cwnd_limit()
66 net->cwnd = assoc->max_cwnd; in sctp_enforce_cwnd_limit()
67 if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { in sctp_enforce_cwnd_limit()
68 net->cwnd = net->mtu - sizeof(struct sctphdr); in sctp_enforce_cwnd_limit()
74 sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) in sctp_set_initial_cc_param() argument
83 net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); in sctp_set_initial_cc_param()
91 net->cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; in sctp_set_initial_cc_param()
96 net->cwnd /= assoc->numnets; in sctp_set_initial_cc_param()
97 if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) { in sctp_set_initial_cc_param()
98 net->cwnd = net->mtu - sizeof(struct sctphdr); in sctp_set_initial_cc_param()
101 sctp_enforce_cwnd_limit(assoc, net); in sctp_set_initial_cc_param()
102 net->ssthresh = assoc->peers_rwnd; in sctp_set_initial_cc_param()
103 SDT_PROBE5(sctp, cwnd, net, init, in sctp_set_initial_cc_param()
104 stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, in sctp_set_initial_cc_param()
105 0, net->cwnd); in sctp_set_initial_cc_param()
108 sctp_log_cwnd(stcb, net, 0, SCTP_CWND_INITIALIZATION); in sctp_set_initial_cc_param()
116 struct sctp_nets *net; in sctp_cwnd_update_after_fr() local
126 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_cwnd_update_after_fr()
127 t_ssthresh += net->ssthresh; in sctp_cwnd_update_after_fr()
128 t_cwnd += net->cwnd; in sctp_cwnd_update_after_fr()
129 if (net->lastsa > 0) { in sctp_cwnd_update_after_fr()
130 t_ucwnd_sbw += (uint64_t)net->cwnd / (uint64_t)net->lastsa; in sctp_cwnd_update_after_fr()
140 * (net->fast_retran_loss_recovery == 0))) in sctp_cwnd_update_after_fr()
142 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_cwnd_update_after_fr()
146 if (net->net_ack > 0) { in sctp_cwnd_update_after_fr()
154 int old_cwnd = net->cwnd; in sctp_cwnd_update_after_fr()
159 net->ssthresh = (uint32_t)(((uint64_t)4 * in sctp_cwnd_update_after_fr()
160 (uint64_t)net->mtu * in sctp_cwnd_update_after_fr()
161 (uint64_t)net->ssthresh) / in sctp_cwnd_update_after_fr()
167 srtt = net->lastsa; in sctp_cwnd_update_after_fr()
179 net->ssthresh = (uint32_t)(((uint64_t)4 * in sctp_cwnd_update_after_fr()
180 (uint64_t)net->mtu * in sctp_cwnd_update_after_fr()
181 (uint64_t)net->cwnd) / in sctp_cwnd_update_after_fr()
186 if ((net->cwnd > t_cwnd / 2) && in sctp_cwnd_update_after_fr()
187 (net->ssthresh < net->cwnd - t_cwnd / 2)) { in sctp_cwnd_update_after_fr()
188 net->ssthresh = net->cwnd - t_cwnd / 2; in sctp_cwnd_update_after_fr()
190 if (net->ssthresh < net->mtu) { in sctp_cwnd_update_after_fr()
191 net->ssthresh = net->mtu; in sctp_cwnd_update_after_fr()
194 net->ssthresh = net->cwnd / 2; in sctp_cwnd_update_after_fr()
195 if (net->ssthresh < (net->mtu * 2)) { in sctp_cwnd_update_after_fr()
196 net->ssthresh = 2 * net->mtu; in sctp_cwnd_update_after_fr()
199 net->cwnd = net->ssthresh; in sctp_cwnd_update_after_fr()
200 sctp_enforce_cwnd_limit(asoc, net); in sctp_cwnd_update_after_fr()
201 SDT_PROBE5(sctp, cwnd, net, fr, in sctp_cwnd_update_after_fr()
202 stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, in sctp_cwnd_update_after_fr()
203 old_cwnd, net->cwnd); in sctp_cwnd_update_after_fr()
205 sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), in sctp_cwnd_update_after_fr()
210 net->partial_bytes_acked = 0; in sctp_cwnd_update_after_fr()
224 net->fast_retran_loss_recovery = 1; in sctp_cwnd_update_after_fr()
228 net->fast_recovery_tsn = asoc->sending_seq - 1; in sctp_cwnd_update_after_fr()
230 net->fast_recovery_tsn = lchk->rec.data.tsn - 1; in sctp_cwnd_update_after_fr()
234 stcb->sctp_ep, stcb, net, in sctp_cwnd_update_after_fr()
237 stcb->sctp_ep, stcb, net); in sctp_cwnd_update_after_fr()
239 } else if (net->net_ack > 0) { in sctp_cwnd_update_after_fr()
255 cc_bw_same(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, in cc_bw_same() argument
260 probepoint = (((uint64_t)net->cwnd) << 32); in cc_bw_same()
261 if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { in cc_bw_same()
268 SDT_PROBE5(sctp, cwnd, net, rttvar, in cc_bw_same()
270 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_same()
271 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_same()
272 net->flight_size, in cc_bw_same()
274 if ((net->cc_mod.rtcc.steady_step) && (inst_ind != SCTP_INST_LOOSING)) { in cc_bw_same()
275 if (net->cc_mod.rtcc.last_step_state == 5) in cc_bw_same()
276 net->cc_mod.rtcc.step_cnt++; in cc_bw_same()
278 net->cc_mod.rtcc.step_cnt = 1; in cc_bw_same()
279 net->cc_mod.rtcc.last_step_state = 5; in cc_bw_same()
280 if ((net->cc_mod.rtcc.step_cnt == net->cc_mod.rtcc.steady_step) || in cc_bw_same()
281 ((net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step) && in cc_bw_same()
282 ((net->cc_mod.rtcc.step_cnt % net->cc_mod.rtcc.steady_step) == 0))) { in cc_bw_same()
284 oth = net->cc_mod.rtcc.vol_reduce; in cc_bw_same()
286 oth |= net->cc_mod.rtcc.step_cnt; in cc_bw_same()
288 oth |= net->cc_mod.rtcc.last_step_state; in cc_bw_same()
289 SDT_PROBE5(sctp, cwnd, net, rttstep, in cc_bw_same()
291 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_same()
292 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_same()
295 if (net->cwnd > (4 * net->mtu)) { in cc_bw_same()
296 net->cwnd -= net->mtu; in cc_bw_same()
297 net->cc_mod.rtcc.vol_reduce++; in cc_bw_same()
299 net->cc_mod.rtcc.step_cnt = 0; in cc_bw_same()
305 if (net->rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { in cc_bw_same()
313 SDT_PROBE5(sctp, cwnd, net, rttvar, in cc_bw_same()
315 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_same()
316 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_same()
317 net->flight_size, in cc_bw_same()
319 if (net->cc_mod.rtcc.steady_step) { in cc_bw_same()
320 oth = net->cc_mod.rtcc.vol_reduce; in cc_bw_same()
322 oth |= net->cc_mod.rtcc.step_cnt; in cc_bw_same()
324 oth |= net->cc_mod.rtcc.last_step_state; in cc_bw_same()
325 SDT_PROBE5(sctp, cwnd, net, rttstep, in cc_bw_same()
327 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_same()
328 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_same()
331 if ((net->cc_mod.rtcc.last_step_state == 5) && in cc_bw_same()
332 (net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step)) { in cc_bw_same()
334 net->cc_mod.rtcc.step_cnt = 0; in cc_bw_same()
337 net->cc_mod.rtcc.last_step_state = 6; in cc_bw_same()
338 net->cc_mod.rtcc.step_cnt = 0; in cc_bw_same()
341 net->cc_mod.rtcc.lbw = nbw; in cc_bw_same()
342 net->cc_mod.rtcc.lbw_rtt = net->rtt; in cc_bw_same()
343 net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; in cc_bw_same()
355 probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); in cc_bw_same()
356 SDT_PROBE5(sctp, cwnd, net, rttvar, in cc_bw_same()
358 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_same()
359 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_same()
360 net->flight_size, in cc_bw_same()
362 if ((net->cc_mod.rtcc.steady_step) && (inst_ind != SCTP_INST_LOOSING)) { in cc_bw_same()
363 if (net->cc_mod.rtcc.last_step_state == 5) in cc_bw_same()
364 net->cc_mod.rtcc.step_cnt++; in cc_bw_same()
366 net->cc_mod.rtcc.step_cnt = 1; in cc_bw_same()
367 net->cc_mod.rtcc.last_step_state = 5; in cc_bw_same()
368 if ((net->cc_mod.rtcc.step_cnt == net->cc_mod.rtcc.steady_step) || in cc_bw_same()
369 ((net->cc_mod.rtcc.step_cnt > net->cc_mod.rtcc.steady_step) && in cc_bw_same()
370 ((net->cc_mod.rtcc.step_cnt % net->cc_mod.rtcc.steady_step) == 0))) { in cc_bw_same()
372 if (net->cwnd > (4 * net->mtu)) { in cc_bw_same()
373 net->cwnd -= net->mtu; in cc_bw_same()
374 net->cc_mod.rtcc.vol_reduce++; in cc_bw_same()
377 net->cc_mod.rtcc.step_cnt = 0; in cc_bw_same()
386 return ((int)net->cc_mod.rtcc.ret_from_eq); in cc_bw_same()
390 cc_bw_decrease(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t rtt_offset, in cc_bw_decrease() argument
396 probepoint = (((uint64_t)net->cwnd) << 32); in cc_bw_decrease()
397 if (net->rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { in cc_bw_decrease()
400 if ((net->cwnd > net->cc_mod.rtcc.cwnd_at_bw_set) && in cc_bw_decrease()
405 SDT_PROBE5(sctp, cwnd, net, rttvar, in cc_bw_decrease()
407 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_decrease()
408 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_decrease()
409 net->flight_size, in cc_bw_decrease()
411 if (net->cc_mod.rtcc.ret_from_eq) { in cc_bw_decrease()
416 net->ssthresh = net->cwnd - 1; in cc_bw_decrease()
417 net->partial_bytes_acked = 0; in cc_bw_decrease()
423 SDT_PROBE5(sctp, cwnd, net, rttvar, in cc_bw_decrease()
425 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_decrease()
426 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_decrease()
427 net->flight_size, in cc_bw_decrease()
430 if (net->cc_mod.rtcc.steady_step) { in cc_bw_decrease()
431 oth = net->cc_mod.rtcc.vol_reduce; in cc_bw_decrease()
433 oth |= net->cc_mod.rtcc.step_cnt; in cc_bw_decrease()
435 oth |= net->cc_mod.rtcc.last_step_state; in cc_bw_decrease()
436 SDT_PROBE5(sctp, cwnd, net, rttstep, in cc_bw_decrease()
438 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_decrease()
439 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_decrease()
446 if ((net->cc_mod.rtcc.vol_reduce) && in cc_bw_decrease()
448 net->cwnd += net->mtu; in cc_bw_decrease()
449 sctp_enforce_cwnd_limit(&stcb->asoc, net); in cc_bw_decrease()
450 net->cc_mod.rtcc.vol_reduce--; in cc_bw_decrease()
452 net->cc_mod.rtcc.last_step_state = 2; in cc_bw_decrease()
453 net->cc_mod.rtcc.step_cnt = 0; in cc_bw_decrease()
456 } else if (net->rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { in cc_bw_decrease()
460 SDT_PROBE5(sctp, cwnd, net, rttvar, in cc_bw_decrease()
462 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_decrease()
463 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_decrease()
464 net->flight_size, in cc_bw_decrease()
466 if (net->cc_mod.rtcc.steady_step) { in cc_bw_decrease()
467 oth = net->cc_mod.rtcc.vol_reduce; in cc_bw_decrease()
469 oth |= net->cc_mod.rtcc.step_cnt; in cc_bw_decrease()
471 oth |= net->cc_mod.rtcc.last_step_state; in cc_bw_decrease()
472 SDT_PROBE5(sctp, cwnd, net, rttstep, in cc_bw_decrease()
474 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_decrease()
475 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_decrease()
478 if ((net->cc_mod.rtcc.vol_reduce) && in cc_bw_decrease()
480 net->cwnd += net->mtu; in cc_bw_decrease()
481 sctp_enforce_cwnd_limit(&stcb->asoc, net); in cc_bw_decrease()
482 net->cc_mod.rtcc.vol_reduce--; in cc_bw_decrease()
484 net->cc_mod.rtcc.last_step_state = 3; in cc_bw_decrease()
485 net->cc_mod.rtcc.step_cnt = 0; in cc_bw_decrease()
492 SDT_PROBE5(sctp, cwnd, net, rttvar, in cc_bw_decrease()
494 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_decrease()
495 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_decrease()
496 net->flight_size, in cc_bw_decrease()
498 if (net->cc_mod.rtcc.steady_step) { in cc_bw_decrease()
499 oth = net->cc_mod.rtcc.vol_reduce; in cc_bw_decrease()
501 oth |= net->cc_mod.rtcc.step_cnt; in cc_bw_decrease()
503 oth |= net->cc_mod.rtcc.last_step_state; in cc_bw_decrease()
504 SDT_PROBE5(sctp, cwnd, net, rttstep, in cc_bw_decrease()
506 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_decrease()
507 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_decrease()
510 if ((net->cc_mod.rtcc.vol_reduce) && in cc_bw_decrease()
512 net->cwnd += net->mtu; in cc_bw_decrease()
513 sctp_enforce_cwnd_limit(&stcb->asoc, net); in cc_bw_decrease()
514 net->cc_mod.rtcc.vol_reduce--; in cc_bw_decrease()
516 net->cc_mod.rtcc.last_step_state = 4; in cc_bw_decrease()
517 net->cc_mod.rtcc.step_cnt = 0; in cc_bw_decrease()
520 net->cc_mod.rtcc.lbw = nbw; in cc_bw_decrease()
521 net->cc_mod.rtcc.lbw_rtt = net->rtt; in cc_bw_decrease()
522 net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; in cc_bw_decrease()
531 cc_bw_increase(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t vtag) in cc_bw_increase() argument
541 probepoint = (((uint64_t)net->cwnd) << 32); in cc_bw_increase()
542 SDT_PROBE5(sctp, cwnd, net, rttvar, in cc_bw_increase()
544 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_increase()
545 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_increase()
546 net->flight_size, in cc_bw_increase()
548 if (net->cc_mod.rtcc.steady_step) { in cc_bw_increase()
549 oth = net->cc_mod.rtcc.vol_reduce; in cc_bw_increase()
551 oth |= net->cc_mod.rtcc.step_cnt; in cc_bw_increase()
553 oth |= net->cc_mod.rtcc.last_step_state; in cc_bw_increase()
554 SDT_PROBE5(sctp, cwnd, net, rttstep, in cc_bw_increase()
556 ((net->cc_mod.rtcc.lbw << 32) | nbw), in cc_bw_increase()
557 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in cc_bw_increase()
560 net->cc_mod.rtcc.last_step_state = 0; in cc_bw_increase()
561 net->cc_mod.rtcc.step_cnt = 0; in cc_bw_increase()
562 net->cc_mod.rtcc.vol_reduce = 0; in cc_bw_increase()
564 net->cc_mod.rtcc.lbw = nbw; in cc_bw_increase()
565 net->cc_mod.rtcc.lbw_rtt = net->rtt; in cc_bw_increase()
566 net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; in cc_bw_increase()
574 cc_bw_limit(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw) in cc_bw_limit() argument
624 probepoint = (((uint64_t)net->cwnd) << 32); in cc_bw_limit()
625 rtt = net->rtt; in cc_bw_limit()
626 if (net->cc_mod.rtcc.rtt_set_this_sack) { in cc_bw_limit()
627 net->cc_mod.rtcc.rtt_set_this_sack = 0; in cc_bw_limit()
628 bytes_for_this_rtt = net->cc_mod.rtcc.bw_bytes - net->cc_mod.rtcc.bw_bytes_at_last_rttc; in cc_bw_limit()
629 net->cc_mod.rtcc.bw_bytes_at_last_rttc = net->cc_mod.rtcc.bw_bytes; in cc_bw_limit()
630 if (net->rtt) { in cc_bw_limit()
631 div = net->rtt / 1000; in cc_bw_limit()
643 inst_ind = net->cc_mod.rtcc.last_inst_ind; in cc_bw_limit()
644 inst_bw = bytes_for_this_rtt / (uint64_t)(net->rtt); in cc_bw_limit()
649 inst_ind = net->cc_mod.rtcc.last_inst_ind; in cc_bw_limit()
654 SDT_PROBE5(sctp, cwnd, net, rttvar, in cc_bw_limit()
657 ((net->cc_mod.rtcc.lbw_rtt << 32) | rtt), in cc_bw_limit()
658 net->flight_size, in cc_bw_limit()
662 inst_ind = net->cc_mod.rtcc.last_inst_ind; in cc_bw_limit()
664 bw_offset = net->cc_mod.rtcc.lbw >> bw_shift; in cc_bw_limit()
665 if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { in cc_bw_limit()
666 ret = cc_bw_increase(stcb, net, nbw, vtag); in cc_bw_limit()
669 rtt_offset = net->cc_mod.rtcc.lbw_rtt >> SCTP_BASE_SYSCTL(sctp_rttvar_rtt); in cc_bw_limit()
670 if (nbw < net->cc_mod.rtcc.lbw - bw_offset) { in cc_bw_limit()
671 ret = cc_bw_decrease(stcb, net, nbw, rtt_offset, vtag, inst_ind); in cc_bw_limit()
678 ret = cc_bw_same(stcb, net, nbw, rtt_offset, vtag, inst_ind); in cc_bw_limit()
680 net->cc_mod.rtcc.last_inst_ind = inst_ind; in cc_bw_limit()
689 struct sctp_nets *net; in sctp_cwnd_update_after_sack_common() local
707 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { in sctp_cwnd_update_after_sack_common()
708 t_ssthresh += net->ssthresh; in sctp_cwnd_update_after_sack_common()
710 srtt = net->lastsa; in sctp_cwnd_update_after_sack_common()
714 t_ucwnd_sbw += (uint64_t)net->cwnd / (uint64_t)srtt; in sctp_cwnd_update_after_sack_common()
715 t_path_mptcp += (((uint64_t)net->cwnd) << SHIFT_MPTCP_MULTI_Z) / in sctp_cwnd_update_after_sack_common()
716 (((uint64_t)net->mtu) * (uint64_t)srtt); in sctp_cwnd_update_after_sack_common()
717 tmp = (((uint64_t)net->cwnd) << SHIFT_MPTCP_MULTI_N) / in sctp_cwnd_update_after_sack_common()
718 ((uint64_t)net->mtu * (uint64_t)(srtt * srtt)); in sctp_cwnd_update_after_sack_common()
739 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_cwnd_update_after_sack_common()
744 if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { in sctp_cwnd_update_after_sack_common()
745 if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || in sctp_cwnd_update_after_sack_common()
746 SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { in sctp_cwnd_update_after_sack_common()
747 net->will_exit_fast_recovery = 1; in sctp_cwnd_update_after_sack_common()
752 if (net->net_ack == 0) { in sctp_cwnd_update_after_sack_common()
754 sctp_log_cwnd(stcb, net, 0, SCTP_CWND_LOG_FROM_SACK); in sctp_cwnd_update_after_sack_common()
763 * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery in sctp_cwnd_update_after_sack_common()
764 * && net->will_exit_fast_recovery == 0) { @@@ Do something in sctp_cwnd_update_after_sack_common()
782 if (use_rtcc && (net->cc_mod.rtcc.tls_needs_set > 0)) { in sctp_cwnd_update_after_sack_common()
792 if ((net->cc_mod.rtcc.new_tot_time / 1000) > 0) { in sctp_cwnd_update_after_sack_common()
793 nbw = net->cc_mod.rtcc.bw_bytes / (net->cc_mod.rtcc.new_tot_time / 1000); in sctp_cwnd_update_after_sack_common()
795 nbw = net->cc_mod.rtcc.bw_bytes; in sctp_cwnd_update_after_sack_common()
797 if (net->cc_mod.rtcc.lbw) { in sctp_cwnd_update_after_sack_common()
798 if (cc_bw_limit(stcb, net, nbw)) { in sctp_cwnd_update_after_sack_common()
805 probepoint = (((uint64_t)net->cwnd) << 32); in sctp_cwnd_update_after_sack_common()
807 vtag = (net->rtt << 32) | in sctp_cwnd_update_after_sack_common()
811 SDT_PROBE5(sctp, cwnd, net, rttvar, in sctp_cwnd_update_after_sack_common()
814 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in sctp_cwnd_update_after_sack_common()
815 net->flight_size, in sctp_cwnd_update_after_sack_common()
817 net->cc_mod.rtcc.lbw = nbw; in sctp_cwnd_update_after_sack_common()
818 net->cc_mod.rtcc.lbw_rtt = net->rtt; in sctp_cwnd_update_after_sack_common()
819 if (net->cc_mod.rtcc.rtt_set_this_sack) { in sctp_cwnd_update_after_sack_common()
820 net->cc_mod.rtcc.rtt_set_this_sack = 0; in sctp_cwnd_update_after_sack_common()
821 net->cc_mod.rtcc.bw_bytes_at_last_rttc = net->cc_mod.rtcc.bw_bytes; in sctp_cwnd_update_after_sack_common()
830 ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { in sctp_cwnd_update_after_sack_common()
832 if (net->cwnd <= net->ssthresh) { in sctp_cwnd_update_after_sack_common()
834 if (net->flight_size + net->net_ack >= net->cwnd) { in sctp_cwnd_update_after_sack_common()
837 old_cwnd = net->cwnd; in sctp_cwnd_update_after_sack_common()
840 limit = (uint32_t)(((uint64_t)net->mtu * in sctp_cwnd_update_after_sack_common()
842 (uint64_t)net->ssthresh) / in sctp_cwnd_update_after_sack_common()
844 incr = (uint32_t)(((uint64_t)net->net_ack * in sctp_cwnd_update_after_sack_common()
845 (uint64_t)net->ssthresh) / in sctp_cwnd_update_after_sack_common()
859 srtt = net->lastsa; in sctp_cwnd_update_after_sack_common()
863 limit = (uint32_t)(((uint64_t)net->mtu * in sctp_cwnd_update_after_sack_common()
865 (uint64_t)net->cwnd) / in sctp_cwnd_update_after_sack_common()
868 incr = (uint32_t)(((uint64_t)net->net_ack * in sctp_cwnd_update_after_sack_common()
869 (uint64_t)net->cwnd) / in sctp_cwnd_update_after_sack_common()
880 limit = (uint32_t)(((uint64_t)net->mtu * in sctp_cwnd_update_after_sack_common()
884 incr = (uint32_t)(((uint64_t)net->net_ack * in sctp_cwnd_update_after_sack_common()
890 if (incr > net->net_ack) { in sctp_cwnd_update_after_sack_common()
891 incr = net->net_ack; in sctp_cwnd_update_after_sack_common()
893 if (incr > net->mtu) { in sctp_cwnd_update_after_sack_common()
894 incr = net->mtu; in sctp_cwnd_update_after_sack_common()
898 incr = net->net_ack; in sctp_cwnd_update_after_sack_common()
899 if (incr > net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)) { in sctp_cwnd_update_after_sack_common()
900 incr = net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable); in sctp_cwnd_update_after_sack_common()
904 net->cwnd += incr; in sctp_cwnd_update_after_sack_common()
905 sctp_enforce_cwnd_limit(asoc, net); in sctp_cwnd_update_after_sack_common()
907 sctp_log_cwnd(stcb, net, incr, in sctp_cwnd_update_after_sack_common()
910 SDT_PROBE5(sctp, cwnd, net, ack, in sctp_cwnd_update_after_sack_common()
913 net, in sctp_cwnd_update_after_sack_common()
914 old_cwnd, net->cwnd); in sctp_cwnd_update_after_sack_common()
917 sctp_log_cwnd(stcb, net, net->net_ack, in sctp_cwnd_update_after_sack_common()
926 net->partial_bytes_acked += net->net_ack; in sctp_cwnd_update_after_sack_common()
928 if ((net->flight_size + net->net_ack >= net->cwnd) && in sctp_cwnd_update_after_sack_common()
929 (net->partial_bytes_acked >= net->cwnd)) { in sctp_cwnd_update_after_sack_common()
930 net->partial_bytes_acked -= net->cwnd; in sctp_cwnd_update_after_sack_common()
931 old_cwnd = net->cwnd; in sctp_cwnd_update_after_sack_common()
934 incr = (uint32_t)(((uint64_t)net->mtu * in sctp_cwnd_update_after_sack_common()
935 (uint64_t)net->ssthresh) / in sctp_cwnd_update_after_sack_common()
946 srtt = net->lastsa; in sctp_cwnd_update_after_sack_common()
950 incr = (uint32_t)((uint64_t)net->mtu * in sctp_cwnd_update_after_sack_common()
951 (uint64_t)net->cwnd / in sctp_cwnd_update_after_sack_common()
961 (uint64_t)net->cwnd) >> in sctp_cwnd_update_after_sack_common()
963 if (incr > net->mtu) { in sctp_cwnd_update_after_sack_common()
964 incr = net->mtu; in sctp_cwnd_update_after_sack_common()
968 incr = net->mtu; in sctp_cwnd_update_after_sack_common()
971 net->cwnd += incr; in sctp_cwnd_update_after_sack_common()
972 sctp_enforce_cwnd_limit(asoc, net); in sctp_cwnd_update_after_sack_common()
973 SDT_PROBE5(sctp, cwnd, net, ack, in sctp_cwnd_update_after_sack_common()
976 net, in sctp_cwnd_update_after_sack_common()
977 old_cwnd, net->cwnd); in sctp_cwnd_update_after_sack_common()
979 sctp_log_cwnd(stcb, net, net->mtu, in sctp_cwnd_update_after_sack_common()
984 sctp_log_cwnd(stcb, net, net->net_ack, in sctp_cwnd_update_after_sack_common()
991 sctp_log_cwnd(stcb, net, net->mtu, in sctp_cwnd_update_after_sack_common()
999 sctp_cwnd_update_exit_pf_common(struct sctp_tcb *stcb, struct sctp_nets *net) in sctp_cwnd_update_exit_pf_common() argument
1003 old_cwnd = net->cwnd; in sctp_cwnd_update_exit_pf_common()
1004 net->cwnd = net->mtu; in sctp_cwnd_update_exit_pf_common()
1005 SDT_PROBE5(sctp, cwnd, net, ack, in sctp_cwnd_update_exit_pf_common()
1006 stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, in sctp_cwnd_update_exit_pf_common()
1007 old_cwnd, net->cwnd); in sctp_cwnd_update_exit_pf_common()
1009 (void *)net, net->cwnd); in sctp_cwnd_update_exit_pf_common()
1013 sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) in sctp_cwnd_update_after_timeout() argument
1015 int old_cwnd = net->cwnd; in sctp_cwnd_update_after_timeout()
1044 net->ssthresh = (uint32_t)(((uint64_t)4 * in sctp_cwnd_update_after_timeout()
1045 (uint64_t)net->mtu * in sctp_cwnd_update_after_timeout()
1046 (uint64_t)net->ssthresh) / in sctp_cwnd_update_after_timeout()
1051 srtt = net->lastsa; in sctp_cwnd_update_after_timeout()
1058 net->ssthresh = (uint32_t)((uint64_t)t_cwnd - cc_delta); in sctp_cwnd_update_after_timeout()
1060 net->ssthresh = net->mtu; in sctp_cwnd_update_after_timeout()
1063 if ((net->cwnd > t_cwnd / 2) && in sctp_cwnd_update_after_timeout()
1064 (net->ssthresh < net->cwnd - t_cwnd / 2)) { in sctp_cwnd_update_after_timeout()
1065 net->ssthresh = net->cwnd - t_cwnd / 2; in sctp_cwnd_update_after_timeout()
1067 if (net->ssthresh < net->mtu) { in sctp_cwnd_update_after_timeout()
1068 net->ssthresh = net->mtu; in sctp_cwnd_update_after_timeout()
1071 net->ssthresh = max(net->cwnd / 2, 4 * net->mtu); in sctp_cwnd_update_after_timeout()
1073 net->cwnd = net->mtu; in sctp_cwnd_update_after_timeout()
1074 net->partial_bytes_acked = 0; in sctp_cwnd_update_after_timeout()
1075 SDT_PROBE5(sctp, cwnd, net, to, in sctp_cwnd_update_after_timeout()
1078 net, in sctp_cwnd_update_after_timeout()
1079 old_cwnd, net->cwnd); in sctp_cwnd_update_after_timeout()
1081 sctp_log_cwnd(stcb, net, net->cwnd - old_cwnd, SCTP_CWND_LOG_FROM_RTX); in sctp_cwnd_update_after_timeout()
1086 sctp_cwnd_update_after_ecn_echo_common(struct sctp_tcb *stcb, struct sctp_nets *net, in sctp_cwnd_update_after_ecn_echo_common() argument
1089 int old_cwnd = net->cwnd; in sctp_cwnd_update_after_ecn_echo_common()
1091 if ((use_rtcc) && (net->lan_type == SCTP_LAN_LOCAL) && (net->cc_mod.rtcc.use_dccc_ecn)) { in sctp_cwnd_update_after_ecn_echo_common()
1098 if (net->ecn_prev_cwnd < net->cwnd) { in sctp_cwnd_update_after_ecn_echo_common()
1100 net->cwnd = net->ecn_prev_cwnd - (net->mtu * num_pkt_lost); in sctp_cwnd_update_after_ecn_echo_common()
1103 net->cwnd /= 2; in sctp_cwnd_update_after_ecn_echo_common()
1106 net->ssthresh = net->cwnd - (num_pkt_lost * net->mtu); in sctp_cwnd_update_after_ecn_echo_common()
1108 sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); in sctp_cwnd_update_after_ecn_echo_common()
1115 net->ssthresh -= (net->mtu * num_pkt_lost); in sctp_cwnd_update_after_ecn_echo_common()
1116 net->cwnd -= (net->mtu * num_pkt_lost); in sctp_cwnd_update_after_ecn_echo_common()
1118 sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); in sctp_cwnd_update_after_ecn_echo_common()
1125 net->ssthresh = net->cwnd / 2; in sctp_cwnd_update_after_ecn_echo_common()
1126 if (net->ssthresh < net->mtu) { in sctp_cwnd_update_after_ecn_echo_common()
1127 net->ssthresh = net->mtu; in sctp_cwnd_update_after_ecn_echo_common()
1132 net->RTO <<= 1; in sctp_cwnd_update_after_ecn_echo_common()
1134 net->cwnd = net->ssthresh; in sctp_cwnd_update_after_ecn_echo_common()
1135 SDT_PROBE5(sctp, cwnd, net, ecn, in sctp_cwnd_update_after_ecn_echo_common()
1138 net, in sctp_cwnd_update_after_ecn_echo_common()
1139 old_cwnd, net->cwnd); in sctp_cwnd_update_after_ecn_echo_common()
1141 sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); in sctp_cwnd_update_after_ecn_echo_common()
1150 struct sctp_nets *net, struct sctp_pktdrop_chunk *cp, in sctp_cwnd_update_after_packet_dropped() argument
1155 int old_cwnd = net->cwnd; in sctp_cwnd_update_after_packet_dropped()
1165 if (*on_queue < net->flight_size) { in sctp_cwnd_update_after_packet_dropped()
1166 *on_queue = net->flight_size; in sctp_cwnd_update_after_packet_dropped()
1169 bw_avail = (uint32_t)(((uint64_t)(*bottle_bw) * net->rtt) / (uint64_t)1000000); in sctp_cwnd_update_after_packet_dropped()
1188 net->partial_bytes_acked = 0; in sctp_cwnd_update_after_packet_dropped()
1196 net->cwnd = net->prev_cwnd; in sctp_cwnd_update_after_packet_dropped()
1199 seg_inflight = net->flight_size / net->mtu; in sctp_cwnd_update_after_packet_dropped()
1200 seg_onqueue = *on_queue / net->mtu; in sctp_cwnd_update_after_packet_dropped()
1204 if (net->cwnd > net->flight_size) { in sctp_cwnd_update_after_packet_dropped()
1212 diff_adj = net->cwnd - net->flight_size; in sctp_cwnd_update_after_packet_dropped()
1223 net->cwnd -= my_portion; in sctp_cwnd_update_after_packet_dropped()
1226 if (net->cwnd <= net->mtu) { in sctp_cwnd_update_after_packet_dropped()
1227 net->cwnd = net->mtu; in sctp_cwnd_update_after_packet_dropped()
1230 net->ssthresh = net->cwnd - 1; in sctp_cwnd_update_after_packet_dropped()
1238 (stcb->asoc.max_burst * net->mtu < incr)) { in sctp_cwnd_update_after_packet_dropped()
1239 incr = stcb->asoc.max_burst * net->mtu; in sctp_cwnd_update_after_packet_dropped()
1241 net->cwnd += incr; in sctp_cwnd_update_after_packet_dropped()
1243 if (net->cwnd > bw_avail) { in sctp_cwnd_update_after_packet_dropped()
1245 net->cwnd = bw_avail; in sctp_cwnd_update_after_packet_dropped()
1247 if (net->cwnd < net->mtu) { in sctp_cwnd_update_after_packet_dropped()
1249 net->cwnd = net->mtu; in sctp_cwnd_update_after_packet_dropped()
1251 sctp_enforce_cwnd_limit(&stcb->asoc, net); in sctp_cwnd_update_after_packet_dropped()
1252 if (net->cwnd - old_cwnd != 0) { in sctp_cwnd_update_after_packet_dropped()
1254 SDT_PROBE5(sctp, cwnd, net, pd, in sctp_cwnd_update_after_packet_dropped()
1257 net, in sctp_cwnd_update_after_packet_dropped()
1258 old_cwnd, net->cwnd); in sctp_cwnd_update_after_packet_dropped()
1260 sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), in sctp_cwnd_update_after_packet_dropped()
1268 struct sctp_nets *net, int burst_limit) in sctp_cwnd_update_after_output() argument
1270 int old_cwnd = net->cwnd; in sctp_cwnd_update_after_output()
1272 if (net->ssthresh < net->cwnd) in sctp_cwnd_update_after_output()
1273 net->ssthresh = net->cwnd; in sctp_cwnd_update_after_output()
1275 net->cwnd = (net->flight_size + (burst_limit * net->mtu)); in sctp_cwnd_update_after_output()
1276 sctp_enforce_cwnd_limit(&stcb->asoc, net); in sctp_cwnd_update_after_output()
1277 SDT_PROBE5(sctp, cwnd, net, bl, in sctp_cwnd_update_after_output()
1280 net, in sctp_cwnd_update_after_output()
1281 old_cwnd, net->cwnd); in sctp_cwnd_update_after_output()
1283 sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_BRST); in sctp_cwnd_update_after_output()
1298 sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, in sctp_cwnd_update_after_ecn_echo() argument
1302 sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, num_pkt_lost, 0); in sctp_cwnd_update_after_ecn_echo()
1311 sctp_cwnd_update_rtcc_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, in sctp_cwnd_update_rtcc_after_ecn_echo() argument
1314 sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, num_pkt_lost, 1); in sctp_cwnd_update_rtcc_after_ecn_echo()
1318 sctp_cwnd_update_rtcc_tsn_acknowledged(struct sctp_nets *net, in sctp_cwnd_update_rtcc_tsn_acknowledged() argument
1321 net->cc_mod.rtcc.bw_bytes += tp1->send_size; in sctp_cwnd_update_rtcc_tsn_acknowledged()
1326 struct sctp_nets *net) in sctp_cwnd_prepare_rtcc_net_for_sack() argument
1328 if (net->cc_mod.rtcc.tls_needs_set > 0) { in sctp_cwnd_prepare_rtcc_net_for_sack()
1333 timevalsub(&ltls, &net->cc_mod.rtcc.tls); in sctp_cwnd_prepare_rtcc_net_for_sack()
1334 net->cc_mod.rtcc.new_tot_time = (ltls.tv_sec * 1000000) + ltls.tv_usec; in sctp_cwnd_prepare_rtcc_net_for_sack()
1340 struct sctp_nets *net) in sctp_cwnd_new_rtcc_transmission_begins() argument
1344 if (net->cc_mod.rtcc.lbw) { in sctp_cwnd_new_rtcc_transmission_begins()
1346 vtag = (net->rtt << 32) | (((uint32_t)(stcb->sctp_ep->sctp_lport)) << 16) | in sctp_cwnd_new_rtcc_transmission_begins()
1348 probepoint = (((uint64_t)net->cwnd) << 32); in sctp_cwnd_new_rtcc_transmission_begins()
1351 SDT_PROBE5(sctp, cwnd, net, rttvar, in sctp_cwnd_new_rtcc_transmission_begins()
1353 ((net->cc_mod.rtcc.lbw << 32) | 0), in sctp_cwnd_new_rtcc_transmission_begins()
1354 ((net->cc_mod.rtcc.lbw_rtt << 32) | net->rtt), in sctp_cwnd_new_rtcc_transmission_begins()
1355 net->flight_size, in sctp_cwnd_new_rtcc_transmission_begins()
1357 net->cc_mod.rtcc.lbw_rtt = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1358 net->cc_mod.rtcc.cwnd_at_bw_set = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1359 net->cc_mod.rtcc.lbw = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1360 net->cc_mod.rtcc.bw_bytes_at_last_rttc = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1361 net->cc_mod.rtcc.vol_reduce = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1362 net->cc_mod.rtcc.bw_tot_time = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1363 net->cc_mod.rtcc.bw_bytes = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1364 net->cc_mod.rtcc.tls_needs_set = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1365 if (net->cc_mod.rtcc.steady_step) { in sctp_cwnd_new_rtcc_transmission_begins()
1366 net->cc_mod.rtcc.vol_reduce = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1367 net->cc_mod.rtcc.step_cnt = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1368 net->cc_mod.rtcc.last_step_state = 0; in sctp_cwnd_new_rtcc_transmission_begins()
1370 if (net->cc_mod.rtcc.ret_from_eq) { in sctp_cwnd_new_rtcc_transmission_begins()
1380 cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); in sctp_cwnd_new_rtcc_transmission_begins()
1388 cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; in sctp_cwnd_new_rtcc_transmission_begins()
1390 if (net->cwnd > cwnd) { in sctp_cwnd_new_rtcc_transmission_begins()
1395 net->cwnd = cwnd; in sctp_cwnd_new_rtcc_transmission_begins()
1403 struct sctp_nets *net) in sctp_set_rtcc_initial_cc_param() argument
1407 sctp_set_initial_cc_param(stcb, net); in sctp_set_rtcc_initial_cc_param()
1409 probepoint = (((uint64_t)net->cwnd) << 32); in sctp_set_rtcc_initial_cc_param()
1411 vtag = (net->rtt << 32) | in sctp_set_rtcc_initial_cc_param()
1414 SDT_PROBE5(sctp, cwnd, net, rttvar, in sctp_set_rtcc_initial_cc_param()
1420 net->cc_mod.rtcc.lbw_rtt = 0; in sctp_set_rtcc_initial_cc_param()
1421 net->cc_mod.rtcc.cwnd_at_bw_set = 0; in sctp_set_rtcc_initial_cc_param()
1422 net->cc_mod.rtcc.vol_reduce = 0; in sctp_set_rtcc_initial_cc_param()
1423 net->cc_mod.rtcc.lbw = 0; in sctp_set_rtcc_initial_cc_param()
1424 net->cc_mod.rtcc.vol_reduce = 0; in sctp_set_rtcc_initial_cc_param()
1425 net->cc_mod.rtcc.bw_bytes_at_last_rttc = 0; in sctp_set_rtcc_initial_cc_param()
1426 net->cc_mod.rtcc.bw_tot_time = 0; in sctp_set_rtcc_initial_cc_param()
1427 net->cc_mod.rtcc.bw_bytes = 0; in sctp_set_rtcc_initial_cc_param()
1428 net->cc_mod.rtcc.tls_needs_set = 0; in sctp_set_rtcc_initial_cc_param()
1429 net->cc_mod.rtcc.ret_from_eq = SCTP_BASE_SYSCTL(sctp_rttvar_eqret); in sctp_set_rtcc_initial_cc_param()
1430 net->cc_mod.rtcc.steady_step = SCTP_BASE_SYSCTL(sctp_steady_step); in sctp_set_rtcc_initial_cc_param()
1431 net->cc_mod.rtcc.use_dccc_ecn = SCTP_BASE_SYSCTL(sctp_use_dccc_ecn); in sctp_set_rtcc_initial_cc_param()
1432 net->cc_mod.rtcc.step_cnt = 0; in sctp_set_rtcc_initial_cc_param()
1433 net->cc_mod.rtcc.last_step_state = 0; in sctp_set_rtcc_initial_cc_param()
1440 struct sctp_nets *net; in sctp_cwnd_rtcc_socket_option() local
1449 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { in sctp_cwnd_rtcc_socket_option()
1450 net->cc_mod.rtcc.ret_from_eq = cc_opt->aid_value.assoc_value; in sctp_cwnd_rtcc_socket_option()
1457 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { in sctp_cwnd_rtcc_socket_option()
1458 net->cc_mod.rtcc.use_dccc_ecn = cc_opt->aid_value.assoc_value; in sctp_cwnd_rtcc_socket_option()
1461 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { in sctp_cwnd_rtcc_socket_option()
1462 net->cc_mod.rtcc.steady_step = cc_opt->aid_value.assoc_value; in sctp_cwnd_rtcc_socket_option()
1470 net = TAILQ_FIRST(&stcb->asoc.nets); in sctp_cwnd_rtcc_socket_option()
1471 if (net == NULL) { in sctp_cwnd_rtcc_socket_option()
1474 cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.ret_from_eq; in sctp_cwnd_rtcc_socket_option()
1476 net = TAILQ_FIRST(&stcb->asoc.nets); in sctp_cwnd_rtcc_socket_option()
1477 if (net == NULL) { in sctp_cwnd_rtcc_socket_option()
1480 cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.use_dccc_ecn; in sctp_cwnd_rtcc_socket_option()
1482 net = TAILQ_FIRST(&stcb->asoc.nets); in sctp_cwnd_rtcc_socket_option()
1483 if (net == NULL) { in sctp_cwnd_rtcc_socket_option()
1486 cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.steady_step; in sctp_cwnd_rtcc_socket_option()
1496 struct sctp_nets *net) in sctp_cwnd_update_rtcc_packet_transmitted() argument
1498 if (net->cc_mod.rtcc.tls_needs_set == 0) { in sctp_cwnd_update_rtcc_packet_transmitted()
1499 SCTP_GETPTIME_TIMEVAL(&net->cc_mod.rtcc.tls); in sctp_cwnd_update_rtcc_packet_transmitted()
1500 net->cc_mod.rtcc.tls_needs_set = 2; in sctp_cwnd_update_rtcc_packet_transmitted()
1515 struct sctp_nets *net, in sctp_rtt_rtcc_calculated() argument
1518 net->cc_mod.rtcc.rtt_set_this_sack = 1; in sctp_rtt_rtcc_calculated()
1608 sctp_hs_cwnd_increase(struct sctp_tcb *stcb, struct sctp_nets *net) in sctp_hs_cwnd_increase() argument
1611 int old_cwnd = net->cwnd; in sctp_hs_cwnd_increase()
1613 cur_val = net->cwnd >> 10; in sctp_hs_cwnd_increase()
1618 if (net->net_ack > net->mtu) { in sctp_hs_cwnd_increase()
1619 net->cwnd += net->mtu; in sctp_hs_cwnd_increase()
1621 net->cwnd += net->net_ack; in sctp_hs_cwnd_increase()
1624 for (i = net->last_hs_used; i < SCTP_HS_TABLE_SIZE; i++) { in sctp_hs_cwnd_increase()
1630 net->last_hs_used = indx; in sctp_hs_cwnd_increase()
1632 net->cwnd += incr; in sctp_hs_cwnd_increase()
1634 sctp_enforce_cwnd_limit(&stcb->asoc, net); in sctp_hs_cwnd_increase()
1636 sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SS); in sctp_hs_cwnd_increase()
1641 sctp_hs_cwnd_decrease(struct sctp_tcb *stcb, struct sctp_nets *net) in sctp_hs_cwnd_decrease() argument
1644 int old_cwnd = net->cwnd; in sctp_hs_cwnd_decrease()
1646 cur_val = net->cwnd >> 10; in sctp_hs_cwnd_decrease()
1649 net->ssthresh = net->cwnd / 2; in sctp_hs_cwnd_decrease()
1650 if (net->ssthresh < (net->mtu * 2)) { in sctp_hs_cwnd_decrease()
1651 net->ssthresh = 2 * net->mtu; in sctp_hs_cwnd_decrease()
1653 net->cwnd = net->ssthresh; in sctp_hs_cwnd_decrease()
1656 net->ssthresh = net->cwnd - (int)((net->cwnd / 100) * in sctp_hs_cwnd_decrease()
1657 (int32_t)sctp_cwnd_adjust[net->last_hs_used].drop_percent); in sctp_hs_cwnd_decrease()
1658 net->cwnd = net->ssthresh; in sctp_hs_cwnd_decrease()
1660 indx = net->last_hs_used; in sctp_hs_cwnd_decrease()
1661 cur_val = net->cwnd >> 10; in sctp_hs_cwnd_decrease()
1665 net->last_hs_used = 0; in sctp_hs_cwnd_decrease()
1672 net->last_hs_used = indx; in sctp_hs_cwnd_decrease()
1675 sctp_enforce_cwnd_limit(&stcb->asoc, net); in sctp_hs_cwnd_decrease()
1677 sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_FR); in sctp_hs_cwnd_decrease()
1685 struct sctp_nets *net; in sctp_hs_cwnd_update_after_fr() local
1689 * (net->fast_retran_loss_recovery == 0))) in sctp_hs_cwnd_update_after_fr()
1691 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_hs_cwnd_update_after_fr()
1695 if (net->net_ack > 0) { in sctp_hs_cwnd_update_after_fr()
1704 sctp_hs_cwnd_decrease(stcb, net); in sctp_hs_cwnd_update_after_fr()
1708 net->partial_bytes_acked = 0; in sctp_hs_cwnd_update_after_fr()
1722 net->fast_retran_loss_recovery = 1; in sctp_hs_cwnd_update_after_fr()
1726 net->fast_recovery_tsn = asoc->sending_seq - 1; in sctp_hs_cwnd_update_after_fr()
1728 net->fast_recovery_tsn = lchk->rec.data.tsn - 1; in sctp_hs_cwnd_update_after_fr()
1732 stcb->sctp_ep, stcb, net, in sctp_hs_cwnd_update_after_fr()
1735 stcb->sctp_ep, stcb, net); in sctp_hs_cwnd_update_after_fr()
1737 } else if (net->net_ack > 0) { in sctp_hs_cwnd_update_after_fr()
1752 struct sctp_nets *net; in sctp_hs_cwnd_update_after_sack() local
1757 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_hs_cwnd_update_after_sack()
1762 if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { in sctp_hs_cwnd_update_after_sack()
1763 if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || in sctp_hs_cwnd_update_after_sack()
1764 SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { in sctp_hs_cwnd_update_after_sack()
1765 net->will_exit_fast_recovery = 1; in sctp_hs_cwnd_update_after_sack()
1770 if (net->net_ack == 0) { in sctp_hs_cwnd_update_after_sack()
1772 sctp_log_cwnd(stcb, net, 0, SCTP_CWND_LOG_FROM_SACK); in sctp_hs_cwnd_update_after_sack()
1781 * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery in sctp_hs_cwnd_update_after_sack()
1782 * && net->will_exit_fast_recovery == 0) { @@@ Do something in sctp_hs_cwnd_update_after_sack()
1802 ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { in sctp_hs_cwnd_update_after_sack()
1804 if (net->cwnd <= net->ssthresh) { in sctp_hs_cwnd_update_after_sack()
1806 if (net->flight_size + net->net_ack >= net->cwnd) { in sctp_hs_cwnd_update_after_sack()
1807 sctp_hs_cwnd_increase(stcb, net); in sctp_hs_cwnd_update_after_sack()
1810 sctp_log_cwnd(stcb, net, net->net_ack, in sctp_hs_cwnd_update_after_sack()
1816 net->partial_bytes_acked += net->net_ack; in sctp_hs_cwnd_update_after_sack()
1817 if ((net->flight_size + net->net_ack >= net->cwnd) && in sctp_hs_cwnd_update_after_sack()
1818 (net->partial_bytes_acked >= net->cwnd)) { in sctp_hs_cwnd_update_after_sack()
1819 net->partial_bytes_acked -= net->cwnd; in sctp_hs_cwnd_update_after_sack()
1820 net->cwnd += net->mtu; in sctp_hs_cwnd_update_after_sack()
1821 sctp_enforce_cwnd_limit(asoc, net); in sctp_hs_cwnd_update_after_sack()
1823 sctp_log_cwnd(stcb, net, net->mtu, in sctp_hs_cwnd_update_after_sack()
1828 sctp_log_cwnd(stcb, net, net->net_ack, in sctp_hs_cwnd_update_after_sack()
1835 sctp_log_cwnd(stcb, net, net->mtu, in sctp_hs_cwnd_update_after_sack()
1847 * http://www.hamilton.ie/net/htcp3.pdf
1883 htcp_cwnd_undo(struct sctp_tcb *stcb, struct sctp_nets *net) in htcp_cwnd_undo() argument
1885 net->cc_mod.htcp_ca.last_cong = net->cc_mod.htcp_ca.undo_last_cong; in htcp_cwnd_undo()
1886 net->cc_mod.htcp_ca.maxRTT = net->cc_mod.htcp_ca.undo_maxRTT; in htcp_cwnd_undo()
1887 net->cc_mod.htcp_ca.old_maxB = net->cc_mod.htcp_ca.undo_old_maxB; in htcp_cwnd_undo()
1888 return (max(net->cwnd, ((net->ssthresh / net->mtu << 7) / net->cc_mod.htcp_ca.beta) * net->mtu)); in htcp_cwnd_undo()
1894 measure_rtt(struct sctp_nets *net) in measure_rtt() argument
1896 uint32_t srtt = net->lastsa >> SCTP_RTT_SHIFT; in measure_rtt()
1899 if (net->cc_mod.htcp_ca.minRTT > srtt || !net->cc_mod.htcp_ca.minRTT) in measure_rtt()
1900 net->cc_mod.htcp_ca.minRTT = srtt; in measure_rtt()
1903 if (net->fast_retran_ip == 0 && net->ssthresh < 0xFFFF && htcp_ccount(&net->cc_mod.htcp_ca) > 3) { in measure_rtt()
1904 if (net->cc_mod.htcp_ca.maxRTT < net->cc_mod.htcp_ca.minRTT) in measure_rtt()
1905 net->cc_mod.htcp_ca.maxRTT = net->cc_mod.htcp_ca.minRTT; in measure_rtt()
1906 …if (net->cc_mod.htcp_ca.maxRTT < srtt && srtt <= net->cc_mod.htcp_ca.maxRTT + sctp_msecs_to_ticks(… in measure_rtt()
1907 net->cc_mod.htcp_ca.maxRTT = srtt; in measure_rtt()
1912 measure_achieved_throughput(struct sctp_nets *net) in measure_achieved_throughput() argument
1916 if (net->fast_retran_ip == 0) in measure_achieved_throughput()
1917 net->cc_mod.htcp_ca.bytes_acked = net->net_ack; in measure_achieved_throughput()
1924 if (net->fast_retran_ip == 1) { in measure_achieved_throughput()
1925 net->cc_mod.htcp_ca.bytecount = 0; in measure_achieved_throughput()
1926 net->cc_mod.htcp_ca.lasttime = now; in measure_achieved_throughput()
1930 net->cc_mod.htcp_ca.bytecount += net->net_ack; in measure_achieved_throughput()
1931 …if ((net->cc_mod.htcp_ca.bytecount >= net->cwnd - (((net->cc_mod.htcp_ca.alpha >> 7) ? (net->cc_mo… in measure_achieved_throughput()
1932 (now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT) && in measure_achieved_throughput()
1933 (net->cc_mod.htcp_ca.minRTT > 0)) { in measure_achieved_throughput()
1934 …uint32_t cur_Bi = net->cc_mod.htcp_ca.bytecount / net->mtu * hz / (now - net->cc_mod.htcp_ca.lastt… in measure_achieved_throughput()
1936 if (htcp_ccount(&net->cc_mod.htcp_ca) <= 3) { in measure_achieved_throughput()
1938 net->cc_mod.htcp_ca.minB = net->cc_mod.htcp_ca.maxB = net->cc_mod.htcp_ca.Bi = cur_Bi; in measure_achieved_throughput()
1940 net->cc_mod.htcp_ca.Bi = (3 * net->cc_mod.htcp_ca.Bi + cur_Bi) / 4; in measure_achieved_throughput()
1941 if (net->cc_mod.htcp_ca.Bi > net->cc_mod.htcp_ca.maxB) in measure_achieved_throughput()
1942 net->cc_mod.htcp_ca.maxB = net->cc_mod.htcp_ca.Bi; in measure_achieved_throughput()
1943 if (net->cc_mod.htcp_ca.minB > net->cc_mod.htcp_ca.maxB) in measure_achieved_throughput()
1944 net->cc_mod.htcp_ca.minB = net->cc_mod.htcp_ca.maxB; in measure_achieved_throughput()
1946 net->cc_mod.htcp_ca.bytecount = 0; in measure_achieved_throughput()
1947 net->cc_mod.htcp_ca.lasttime = now; in measure_achieved_throughput()
2015 htcp_param_update(struct sctp_nets *net) in htcp_param_update() argument
2017 uint32_t minRTT = net->cc_mod.htcp_ca.minRTT; in htcp_param_update()
2018 uint32_t maxRTT = net->cc_mod.htcp_ca.maxRTT; in htcp_param_update()
2020 htcp_beta_update(&net->cc_mod.htcp_ca, minRTT, maxRTT); in htcp_param_update()
2021 htcp_alpha_update(&net->cc_mod.htcp_ca); in htcp_param_update()
2028 net->cc_mod.htcp_ca.maxRTT = minRTT + ((maxRTT - minRTT) * 95) / 100; in htcp_param_update()
2032 htcp_recalc_ssthresh(struct sctp_nets *net) in htcp_recalc_ssthresh() argument
2034 htcp_param_update(net); in htcp_recalc_ssthresh()
2035 return (max(((net->cwnd / net->mtu * net->cc_mod.htcp_ca.beta) >> 7) * net->mtu, 2U * net->mtu)); in htcp_recalc_ssthresh()
2039 htcp_cong_avoid(struct sctp_tcb *stcb, struct sctp_nets *net) in htcp_cong_avoid() argument
2046 if (net->cwnd <= net->ssthresh) { in htcp_cong_avoid()
2048 if (net->flight_size + net->net_ack >= net->cwnd) { in htcp_cong_avoid()
2049 if (net->net_ack > (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable))) { in htcp_cong_avoid()
2050 net->cwnd += (net->mtu * SCTP_BASE_SYSCTL(sctp_L2_abc_variable)); in htcp_cong_avoid()
2052 sctp_log_cwnd(stcb, net, net->mtu, in htcp_cong_avoid()
2057 net->cwnd += net->net_ack; in htcp_cong_avoid()
2059 sctp_log_cwnd(stcb, net, net->net_ack, in htcp_cong_avoid()
2063 sctp_enforce_cwnd_limit(&stcb->asoc, net); in htcp_cong_avoid()
2066 sctp_log_cwnd(stcb, net, net->net_ack, in htcp_cong_avoid()
2071 measure_rtt(net); in htcp_cong_avoid()
2075 * net->cwnd += alpha / net->cwnd in htcp_cong_avoid()
2078 …if (((net->partial_bytes_acked / net->mtu * net->cc_mod.htcp_ca.alpha) >> 7) * net->mtu >= net->cw… in htcp_cong_avoid()
2081 * if (net->snd_cwnd < net->snd_cwnd_clamp) - Nope (RRS). in htcp_cong_avoid()
2083 net->cwnd += net->mtu; in htcp_cong_avoid()
2084 net->partial_bytes_acked = 0; in htcp_cong_avoid()
2085 sctp_enforce_cwnd_limit(&stcb->asoc, net); in htcp_cong_avoid()
2086 htcp_alpha_update(&net->cc_mod.htcp_ca); in htcp_cong_avoid()
2088 sctp_log_cwnd(stcb, net, net->mtu, in htcp_cong_avoid()
2092 net->partial_bytes_acked += net->net_ack; in htcp_cong_avoid()
2094 sctp_log_cwnd(stcb, net, net->net_ack, in htcp_cong_avoid()
2099 net->cc_mod.htcp_ca.bytes_acked = net->mtu; in htcp_cong_avoid()
2106 htcp_min_cwnd(struct sctp_tcb *stcb, struct sctp_nets *net) in htcp_min_cwnd() argument
2108 return (net->ssthresh); in htcp_min_cwnd()
2113 htcp_init(struct sctp_nets *net) in htcp_init() argument
2115 memset(&net->cc_mod.htcp_ca, 0, sizeof(struct htcp)); in htcp_init()
2116 net->cc_mod.htcp_ca.alpha = ALPHA_BASE; in htcp_init()
2117 net->cc_mod.htcp_ca.beta = BETA_MIN; in htcp_init()
2118 net->cc_mod.htcp_ca.bytes_acked = net->mtu; in htcp_init()
2119 net->cc_mod.htcp_ca.last_cong = sctp_get_tick_count(); in htcp_init()
2123 sctp_htcp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net) in sctp_htcp_set_initial_cc_param() argument
2129 net->cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); in sctp_htcp_set_initial_cc_param()
2130 net->ssthresh = stcb->asoc.peers_rwnd; in sctp_htcp_set_initial_cc_param()
2131 sctp_enforce_cwnd_limit(&stcb->asoc, net); in sctp_htcp_set_initial_cc_param()
2132 htcp_init(net); in sctp_htcp_set_initial_cc_param()
2135 sctp_log_cwnd(stcb, net, 0, SCTP_CWND_INITIALIZATION); in sctp_htcp_set_initial_cc_param()
2144 struct sctp_nets *net; in sctp_htcp_cwnd_update_after_sack() local
2149 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_htcp_cwnd_update_after_sack()
2154 if (net->fast_retran_loss_recovery && net->new_pseudo_cumack) { in sctp_htcp_cwnd_update_after_sack()
2155 if (SCTP_TSN_GE(asoc->last_acked_seq, net->fast_recovery_tsn) || in sctp_htcp_cwnd_update_after_sack()
2156 SCTP_TSN_GE(net->pseudo_cumack, net->fast_recovery_tsn)) { in sctp_htcp_cwnd_update_after_sack()
2157 net->will_exit_fast_recovery = 1; in sctp_htcp_cwnd_update_after_sack()
2162 if (net->net_ack == 0) { in sctp_htcp_cwnd_update_after_sack()
2164 sctp_log_cwnd(stcb, net, 0, SCTP_CWND_LOG_FROM_SACK); in sctp_htcp_cwnd_update_after_sack()
2173 * if (sctp_cmt_on_off > 0 && net->fast_retran_loss_recovery in sctp_htcp_cwnd_update_after_sack()
2174 * && net->will_exit_fast_recovery == 0) { @@@ Do something in sctp_htcp_cwnd_update_after_sack()
2194 ((asoc->sctp_cmt_on_off > 0) && net->new_pseudo_cumack)) { in sctp_htcp_cwnd_update_after_sack()
2195 htcp_cong_avoid(stcb, net); in sctp_htcp_cwnd_update_after_sack()
2196 measure_achieved_throughput(net); in sctp_htcp_cwnd_update_after_sack()
2199 sctp_log_cwnd(stcb, net, net->mtu, in sctp_htcp_cwnd_update_after_sack()
2210 struct sctp_nets *net; in sctp_htcp_cwnd_update_after_fr() local
2214 * (net->fast_retran_loss_recovery == 0))) in sctp_htcp_cwnd_update_after_fr()
2216 TAILQ_FOREACH(net, &asoc->nets, sctp_next) { in sctp_htcp_cwnd_update_after_fr()
2220 if (net->net_ack > 0) { in sctp_htcp_cwnd_update_after_fr()
2228 int old_cwnd = net->cwnd; in sctp_htcp_cwnd_update_after_fr()
2231 htcp_reset(&net->cc_mod.htcp_ca); in sctp_htcp_cwnd_update_after_fr()
2232 net->ssthresh = htcp_recalc_ssthresh(net); in sctp_htcp_cwnd_update_after_fr()
2233 net->cwnd = net->ssthresh; in sctp_htcp_cwnd_update_after_fr()
2234 sctp_enforce_cwnd_limit(asoc, net); in sctp_htcp_cwnd_update_after_fr()
2236 sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), in sctp_htcp_cwnd_update_after_fr()
2241 net->partial_bytes_acked = 0; in sctp_htcp_cwnd_update_after_fr()
2255 net->fast_retran_loss_recovery = 1; in sctp_htcp_cwnd_update_after_fr()
2259 net->fast_recovery_tsn = asoc->sending_seq - 1; in sctp_htcp_cwnd_update_after_fr()
2261 net->fast_recovery_tsn = lchk->rec.data.tsn - 1; in sctp_htcp_cwnd_update_after_fr()
2265 stcb->sctp_ep, stcb, net, in sctp_htcp_cwnd_update_after_fr()
2268 stcb->sctp_ep, stcb, net); in sctp_htcp_cwnd_update_after_fr()
2270 } else if (net->net_ack > 0) { in sctp_htcp_cwnd_update_after_fr()
2282 struct sctp_nets *net) in sctp_htcp_cwnd_update_after_timeout() argument
2284 int old_cwnd = net->cwnd; in sctp_htcp_cwnd_update_after_timeout()
2287 htcp_reset(&net->cc_mod.htcp_ca); in sctp_htcp_cwnd_update_after_timeout()
2288 net->ssthresh = htcp_recalc_ssthresh(net); in sctp_htcp_cwnd_update_after_timeout()
2289 net->cwnd = net->mtu; in sctp_htcp_cwnd_update_after_timeout()
2290 net->partial_bytes_acked = 0; in sctp_htcp_cwnd_update_after_timeout()
2292 sctp_log_cwnd(stcb, net, net->cwnd - old_cwnd, SCTP_CWND_LOG_FROM_RTX); in sctp_htcp_cwnd_update_after_timeout()
2298 struct sctp_nets *net, int in_window, int num_pkt_lost SCTP_UNUSED) in sctp_htcp_cwnd_update_after_ecn_echo() argument
2302 old_cwnd = net->cwnd; in sctp_htcp_cwnd_update_after_ecn_echo()
2306 htcp_reset(&net->cc_mod.htcp_ca); in sctp_htcp_cwnd_update_after_ecn_echo()
2308 net->ssthresh = htcp_recalc_ssthresh(net); in sctp_htcp_cwnd_update_after_ecn_echo()
2309 if (net->ssthresh < net->mtu) { in sctp_htcp_cwnd_update_after_ecn_echo()
2310 net->ssthresh = net->mtu; in sctp_htcp_cwnd_update_after_ecn_echo()
2312 net->RTO <<= 1; in sctp_htcp_cwnd_update_after_ecn_echo()
2314 net->cwnd = net->ssthresh; in sctp_htcp_cwnd_update_after_ecn_echo()
2315 sctp_enforce_cwnd_limit(&stcb->asoc, net); in sctp_htcp_cwnd_update_after_ecn_echo()
2317 sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); in sctp_htcp_cwnd_update_after_ecn_echo()