Lines Matching refs:r_ctl

526 		  bbr->r_ctl.rc_pace_max_segs);  in get_min_cwnd()
539 bbr->r_ctl.rc_hpts_flags |= PACE_TMR_PERSIT; in bbr_get_persists_timer_val()
574 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_tmap); in bbr_timer_start()
585 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_tmap); in bbr_timer_start()
588 if (TSTMP_GEQ(rsm->r_tim_lastsent[idx], bbr->r_ctl.rc_tlp_rxt_last_time)) in bbr_timer_start()
591 tstmp_touse = bbr->r_ctl.rc_tlp_rxt_last_time; in bbr_timer_start()
595 bbr->r_ctl.rc_hpts_flags |= PACE_TMR_RXT; in bbr_timer_start()
606 tov = bbr->r_ctl.rc_min_to; in bbr_timer_start()
608 (bbr->r_ctl.rc_min_rto_ms * MS_IN_USEC), in bbr_timer_start()
639 if (to < bbr->r_ctl.rc_min_to) { in bbr_timer_start()
640 to = bbr->r_ctl.rc_min_to; in bbr_timer_start()
643 to = bbr->r_ctl.rc_min_to; in bbr_timer_start()
653 rsm = TAILQ_LAST_FAST(&bbr->r_ctl.rc_tmap, bbr_sendmap, r_tnext); in bbr_timer_start()
665 if (TSTMP_GEQ(rsm->r_tim_lastsent[idx], bbr->r_ctl.rc_tlp_rxt_last_time)) in bbr_timer_start()
668 tstmp_touse = bbr->r_ctl.rc_tlp_rxt_last_time; in bbr_timer_start()
677 to = bbr->r_ctl.rc_min_to; in bbr_timer_start()
686 (rsm->r_start == bbr->r_ctl.rc_last_tlp_seq)) { in bbr_timer_start()
694 if (rsm->r_start != bbr->r_ctl.rc_last_tlp_seq) { in bbr_timer_start()
699 bbr->r_ctl.rc_tlp_seg_send_cnt = 0; in bbr_timer_start()
700 bbr->r_ctl.rc_last_tlp_seq = rsm->r_start; in bbr_timer_start()
705 bbr->r_ctl.rc_hpts_flags |= PACE_TMR_RACK; in bbr_timer_start()
708 if (bbr->r_ctl.rc_tlp_seg_send_cnt > bbr_tlp_max_resend) { in bbr_timer_start()
716 bbr->r_ctl.rc_hpts_flags |= PACE_TMR_TLP; in bbr_timer_start()
725 return (bbr->r_ctl.rc_pace_min_segs - bbr->rc_last_options); in bbr_minseg()
749 if (stopped && TSTMP_GT(bbr->r_ctl.rc_timer_exp, cts)) { in bbr_start_hpts_timer()
750 left = bbr->r_ctl.rc_timer_exp - cts; in bbr_start_hpts_timer()
752 bbr->r_ctl.rc_hpts_flags = 0; in bbr_start_hpts_timer()
753 bbr->r_ctl.rc_timer_exp = 0; in bbr_start_hpts_timer()
754 prev_delay = bbr->r_ctl.rc_last_delay_val; in bbr_start_hpts_timer()
755 if (bbr->r_ctl.rc_last_delay_val && in bbr_start_hpts_timer()
762 slot = bbr->r_ctl.rc_last_delay_val; in bbr_start_hpts_timer()
772 bbr_log_pacing_delay_calc(bbr, 0, bbr->r_ctl.rc_agg_early, cts, slot, 0, bbr->r_agg_early_set, 2); in bbr_start_hpts_timer()
773 slot += bbr->r_ctl.rc_agg_early; in bbr_start_hpts_timer()
774 bbr->r_ctl.rc_agg_early = 0; in bbr_start_hpts_timer()
778 if (bbr->r_ctl.rc_hptsi_agg_delay) { in bbr_start_hpts_timer()
779 if (slot > bbr->r_ctl.rc_hptsi_agg_delay) { in bbr_start_hpts_timer()
781 slot -= bbr->r_ctl.rc_hptsi_agg_delay; in bbr_start_hpts_timer()
782 bbr->r_ctl.rc_hptsi_agg_delay = 0; in bbr_start_hpts_timer()
785 bbr->r_ctl.rc_hptsi_agg_delay -= slot; in bbr_start_hpts_timer()
786 bbr->r_ctl.rc_last_delay_val = slot = 100; in bbr_start_hpts_timer()
789 bbr->r_ctl.rc_last_delay_val = slot; in bbr_start_hpts_timer()
812 bbr->r_ctl.rc_hpts_flags = PACE_TMR_DELACK; in bbr_start_hpts_timer()
818 bbr->r_ctl.rc_hpts_flags |= PACE_PKT_OUTPUT; in bbr_start_hpts_timer()
838 bbr->r_ctl.rc_hpts_flags |= PACE_TMR_KEEP; in bbr_start_hpts_timer()
842 (bbr->r_ctl.rc_hpts_flags & PACE_TMR_MASK)) { in bbr_start_hpts_timer()
854 if (bbr->r_ctl.rc_incr_tmrs && slot && in bbr_start_hpts_timer()
855 (bbr->r_ctl.rc_hpts_flags & (PACE_TMR_TLP|PACE_TMR_RXT))) { in bbr_start_hpts_timer()
881 bbr->r_ctl.rc_timer_exp = cts + hpts_timeout; in bbr_start_hpts_timer()
883 bbr->r_ctl.rc_timer_exp = 0; in bbr_start_hpts_timer()
893 if ((bbr->r_ctl.rc_hpts_flags & PACE_TMR_RACK) && in bbr_start_hpts_timer()
926 if ((bbr->r_ctl.rc_hpts_flags & PACE_TMR_RACK) && in bbr_start_hpts_timer()
962 tmr_up = bbr->r_ctl.rc_hpts_flags & PACE_TMR_MASK; in bbr_timer_audit()
965 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_tmap); in bbr_timer_audit()
1042 if ((bbr->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT) == 0) { in bbr_timer_audit()
1046 bbr_start_hpts_timer(bbr, tp, cts, 1, bbr->r_ctl.rc_last_delay_val, in bbr_timer_audit()
1061 bbr->r_ctl.rc_hpts_flags = PACE_TMR_DELACK; in bbr_timer_audit()
1065 bbr->r_ctl.rc_hpts_flags = PACE_TMR_DELACK; in bbr_timer_audit()
1071 bbr->r_ctl.rc_timer_exp = cts + hpts_timeout; in bbr_timer_audit()
1852 l->cur_del_rate = bbr->r_ctl.rc_bbr_cur_del_rate; in bbr_fill_in_logging_data()
1853 l->delRate = get_filter_value(&bbr->r_ctl.rc_delrate); in bbr_fill_in_logging_data()
1854 l->rttProp = get_filter_value_small(&bbr->r_ctl.rc_rttprop); in bbr_fill_in_logging_data()
1857 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_fill_in_logging_data()
1858 l->applimited = bbr->r_ctl.r_app_limited_until; in bbr_fill_in_logging_data()
1859 l->delivered = bbr->r_ctl.rc_delivered; in bbr_fill_in_logging_data()
1861 l->lost = bbr->r_ctl.rc_lost; in bbr_fill_in_logging_data()
1864 l->epoch = bbr->r_ctl.rc_rtt_epoch; in bbr_fill_in_logging_data()
1865 l->lt_epoch = bbr->r_ctl.rc_lt_epoch; in bbr_fill_in_logging_data()
1866 l->pacing_gain = bbr->r_ctl.rc_bbr_hptsi_gain; in bbr_fill_in_logging_data()
1867 l->cwnd_gain = bbr->r_ctl.rc_bbr_cwnd_gain; in bbr_fill_in_logging_data()
1870 l->pkts_out = bbr->r_ctl.rc_flight_at_input; in bbr_fill_in_logging_data()
1871 l->pkt_epoch = bbr->r_ctl.rc_pkt_epoch; in bbr_fill_in_logging_data()
1880 bbr_fill_in_logging_data(bbr, &log.u_bbr, bbr->r_ctl.rc_rcvtime); in bbr_log_type_bw_reduce()
1885 log.u_bbr.flex4 = bbr->r_ctl.rc_pkt_epoch_loss_rate; in bbr_log_type_bw_reduce()
1887 log.u_bbr.flex6 = bbr->r_ctl.rc_bbr_enters_probertt; in bbr_log_type_bw_reduce()
1903 bbr_fill_in_logging_data(bbr, &log.u_bbr, bbr->r_ctl.rc_rcvtime); in bbr_log_type_rwnd_collapse()
1924 log.u_bbr.flex2 = bbr->r_ctl.rc_hpts_flags; in bbr_log_type_just_return()
1925 log.u_bbr.flex3 = bbr->r_ctl.rc_timer_exp; in bbr_log_type_just_return()
1928 log.u_bbr.flex6 = bbr->r_ctl.rc_last_delay_val; in bbr_log_type_just_return()
1947 bbr_fill_in_logging_data(bbr, &log.u_bbr, bbr->r_ctl.rc_rcvtime); in bbr_log_type_enter_rec()
1949 log.u_bbr.flex2 = bbr->r_ctl.rc_cwnd_on_ent; in bbr_log_type_enter_rec()
1950 log.u_bbr.flex3 = bbr->r_ctl.rc_recovery_start; in bbr_log_type_enter_rec()
2010 log.u_bbr.flex3 = bbr->r_ctl.rc_bbr_lastbtlbw; in bbr_log_pkt_epoch()
2011 log.u_bbr.flex4 = bbr->r_ctl.rc_pkt_epoch_rtt; in bbr_log_pkt_epoch()
2012 log.u_bbr.flex5 = bbr->r_ctl.rc_bbr_last_startup_epoch; in bbr_log_pkt_epoch()
2013 log.u_bbr.flex6 = bbr->r_ctl.rc_lost_at_startup; in bbr_log_pkt_epoch()
2016 log.u_bbr.inflight = bbr->r_ctl.r_measurement_count; in bbr_log_pkt_epoch()
2032 log.u_bbr.flex1 = bbr->r_ctl.rc_lost; in bbr_log_time_epoch()
2050 bbr_fill_in_logging_data(bbr, &log.u_bbr, bbr->r_ctl.rc_rcvtime); in bbr_log_set_of_state_target()
2051 log.u_bbr.flex1 = bbr->r_ctl.rc_target_at_state; in bbr_log_set_of_state_target()
2054 log.u_bbr.flex4 = bbr->r_ctl.rc_pace_max_segs; in bbr_log_set_of_state_target()
2056 log.u_bbr.flex6 = bbr->r_ctl.rc_pace_min_segs; in bbr_log_set_of_state_target()
2076 log.u_bbr.flex2 = bbr->r_ctl.rc_rtt_shrinks; in bbr_log_type_statechange()
2077 log.u_bbr.flex3 = bbr->r_ctl.rc_probertt_int; in bbr_log_type_statechange()
2082 log.u_bbr.flex5 = bbr->r_ctl.rc_bbr_last_startup_epoch; in bbr_log_type_statechange()
2083 log.u_bbr.flex6 = bbr->r_ctl.rc_lost_at_startup; in bbr_log_type_statechange()
2084 log.u_bbr.flex7 = (bbr->r_ctl.rc_target_at_state/1000); in bbr_log_type_statechange()
2085 log.u_bbr.lt_epoch = bbr->r_ctl.rc_level_state_extra; in bbr_log_type_statechange()
2086 log.u_bbr.pkts_out = bbr->r_ctl.rc_target_at_state; in bbr_log_type_statechange()
2104 log.u_bbr.flex2 = bbr->r_ctl.rc_rtt_shrinks; in bbr_log_rtt_shrinks()
2105 log.u_bbr.flex3 = bbr->r_ctl.last_in_probertt; in bbr_log_rtt_shrinks()
2108 log.u_bbr.flex6 = bbr->r_ctl.rc_target_at_state; in bbr_log_rtt_shrinks()
2125 bbr_fill_in_logging_data(bbr, &log.u_bbr, bbr->r_ctl.rc_rcvtime); in bbr_log_type_exit_rec()
2126 log.u_bbr.flex1 = bbr->r_ctl.rc_recovery_start; in bbr_log_type_exit_rec()
2127 log.u_bbr.flex2 = bbr->r_ctl.rc_cwnd_on_ent; in bbr_log_type_exit_rec()
2128 log.u_bbr.flex5 = bbr->r_ctl.rc_target_at_state; in bbr_log_type_exit_rec()
2144 bbr_fill_in_logging_data(bbr, &log.u_bbr, bbr->r_ctl.rc_rcvtime); in bbr_log_type_cwndupd()
2170 bbr_fill_in_logging_data(bbr, &log.u_bbr, bbr->r_ctl.rc_rcvtime); in bbr_log_rtt_sample()
2172 log.u_bbr.flex2 = bbr->r_ctl.rc_bbr_state_time; in bbr_log_rtt_sample()
2173 log.u_bbr.flex3 = bbr->r_ctl.rc_ack_hdwr_delay; in bbr_log_rtt_sample()
2175 log.u_bbr.flex5 = bbr->r_ctl.rc_target_at_state; in bbr_log_rtt_sample()
2213 log.u_bbr.flex2 = bbr->r_ctl.rc_rtt_shrinks; in bbr_log_ack_clear()
2214 log.u_bbr.flex3 = bbr->r_ctl.rc_probertt_int; in bbr_log_ack_clear()
2215 log.u_bbr.flex4 = bbr->r_ctl.rc_went_idle_time; in bbr_log_ack_clear()
2216 log.u_bbr.flex5 = bbr->r_ctl.rc_target_at_state; in bbr_log_ack_clear()
2235 log.u_bbr.flex2 = bbr->r_ctl.rc_lost_bytes; in bbr_log_ack_event()
2263 log.u_bbr.flex4 = bbr->r_ctl.rc_target_at_state; in bbr_log_ack_event()
2283 log.u_bbr.flex3 = bbr->r_ctl.rc_last_delay_val; in bbr_log_doseg_done()
2284 log.u_bbr.flex4 = bbr->r_ctl.rc_hpts_flags; in bbr_log_doseg_done()
2285 log.u_bbr.flex5 = bbr->r_ctl.rc_timer_exp; in bbr_log_doseg_done()
2286 log.u_bbr.flex6 = bbr->r_ctl.rc_lost_bytes; in bbr_log_doseg_done()
2289 log.u_bbr.pkts_out = bbr->r_ctl.highest_hdwr_delay; in bbr_log_doseg_done()
2327 log.u_bbr.flex3 = bbr->r_ctl.rc_timer_exp; in bbr_log_to_processing()
2328 log.u_bbr.flex4 = bbr->r_ctl.rc_hpts_flags; in bbr_log_to_processing()
2330 log.u_bbr.flex6 = bbr->r_ctl.rc_target_at_state; in bbr_log_to_processing()
2350 log.u_bbr.flex3 = bbr->r_ctl.rc_hpts_flags; in bbr_log_to_event()
2351 ar = (uintptr_t)(bbr->r_ctl.rc_resend); in bbr_log_to_event()
2355 ar = (uintptr_t)bbr->r_ctl.rc_resend; in bbr_log_to_event()
2379 log.u_bbr.flex5 = bbr->r_ctl.rc_target_at_state; in bbr_log_startup_event()
2380 log.u_bbr.flex6 = bbr->r_ctl.rc_lost_at_startup; in bbr_log_startup_event()
2382 log.u_bbr.cur_del_rate = bbr->r_ctl.rc_bbr_lastbtlbw; in bbr_log_startup_event()
2487 log.u_bbr.flex3 = bbr->r_ctl.rc_hpts_flags; in bbr_log_to_start()
2510 log.u_bbr.flex3 = bbr->r_ctl.rc_reorder_ts; in bbr_log_thresh_choice()
2514 log.u_bbr.flex7 = bbr->r_ctl.rc_reorder_shift; in bbr_log_thresh_choice()
2533 log.u_bbr.flex3 = bbr->r_ctl.rc_hpts_flags; in bbr_log_to_cancel()
2535 log.u_bbr.flex5 = bbr->r_ctl.rc_target_at_state; in bbr_log_to_cancel()
2553 bbr_fill_in_logging_data(bbr, &log.u_bbr, bbr->r_ctl.rc_rcvtime); in bbr_log_tstmp_validation()
2554 log.u_bbr.flex1 = bbr->r_ctl.bbr_peer_tsratio; in bbr_log_tstmp_validation()
2579 log.u_bbr.flex4 = bbr->r_ctl.bbr_hptsi_bytes_min; in bbr_log_type_tsosize()
2645 log.u_bbr.epoch = bbr->r_ctl.rc_ack_hdwr_delay; in bbr_log_type_bbrupd()
2669 log.u_bbr.flex5 = bbr->r_ctl.rc_lt_lost; in bbr_log_type_ltbw()
2670 log.u_bbr.flex6 = bbr->r_ctl.rc_lt_del; in bbr_log_type_ltbw()
2673 log.u_bbr.bw_inuse = bbr->r_ctl.rc_lt_bw; in bbr_log_type_ltbw()
2675 log.u_bbr.epoch = bbr->r_ctl.rc_pkt_epoch - bbr->r_ctl.rc_lt_epoch; in bbr_log_type_ltbw()
2677 log.u_bbr.epoch = bbr->r_ctl.rc_pkt_epoch - bbr->r_ctl.rc_lt_epoch_use; in bbr_log_type_ltbw()
2692 bbr_fill_in_logging_data(bbr, &log.u_bbr, bbr->r_ctl.rc_rcvtime); in bbr_log_progress_event()
2748 log.u_bbr.flex5 = bbr->r_ctl.rc_last_delay_val; in bbr_log_type_bbrsnd()
2749 log.u_bbr.flex6 = bbr->r_ctl.rc_hptsi_agg_delay; in bbr_log_type_bbrsnd()
2750 log.u_bbr.flex7 = (0x0000ffff & bbr->r_ctl.rc_hpts_flags); in bbr_log_type_bbrsnd()
2767 log.u_bbr.flex1 = bbr->r_ctl.rc_delivered; in bbr_log_type_bbrrttprop()
2769 log.u_bbr.flex3 = bbr->r_ctl.rc_lowest_rtt; in bbr_log_type_bbrrttprop()
2790 log.u_bbr.flex1 = bbr->r_ctl.rc_target_at_state; in bbr_log_exit_gain()
2792 log.u_bbr.flex3 = bbr->r_ctl.gain_epoch; in bbr_log_exit_gain()
2793 log.u_bbr.flex4 = bbr->r_ctl.rc_pace_max_segs; in bbr_log_exit_gain()
2794 log.u_bbr.flex5 = bbr->r_ctl.rc_pace_min_segs; in bbr_log_exit_gain()
2795 log.u_bbr.flex6 = bbr->r_ctl.rc_bbr_state_atflight; in bbr_log_exit_gain()
2812 bbr_fill_in_logging_data(bbr, &log.u_bbr, bbr->r_ctl.rc_rcvtime); in bbr_log_settings_change()
2837 bw = get_filter_value(&bbr->r_ctl.rc_delrate); in bbr_get_full_bw()
2848 if (bbr->r_ctl.rc_lost > bbr->r_ctl.rc_lost_at_pktepoch) in bbr_set_pktepoch()
2849 lost = bbr->r_ctl.rc_lost - bbr->r_ctl.rc_lost_at_pktepoch; in bbr_set_pktepoch()
2852 del = bbr->r_ctl.rc_delivered - bbr->r_ctl.rc_pkt_epoch_del; in bbr_set_pktepoch()
2863 bbr->r_ctl.rc_pkt_epoch_loss_rate = (uint32_t)calclr; in bbr_set_pktepoch()
2865 bbr->r_ctl.recovery_lr += (uint32_t)calclr; in bbr_set_pktepoch()
2866 bbr->r_ctl.rc_pkt_epoch++; in bbr_set_pktepoch()
2868 (bbr->r_ctl.rc_pkt_epoch >= bbr->no_pacing_until)) { in bbr_set_pktepoch()
2872 bbr->r_ctl.rc_pkt_epoch_rtt = bbr_calc_time(cts, bbr->r_ctl.rc_pkt_epoch_time); in bbr_set_pktepoch()
2873 bbr->r_ctl.rc_pkt_epoch_time = cts; in bbr_set_pktepoch()
2876 bbr->r_ctl.rc_pkt_epoch_del = bbr->r_ctl.rc_delivered; in bbr_set_pktepoch()
2877 bbr->r_ctl.rc_lost_at_pktepoch = bbr->r_ctl.rc_lost; in bbr_set_pktepoch()
2886 bbr->r_ctl.rc_rtt_epoch++; in bbr_set_epoch()
2887 epoch_time = cts - bbr->r_ctl.rc_rcv_epoch_start; in bbr_set_epoch()
2889 bbr->r_ctl.rc_rcv_epoch_start = cts; in bbr_set_epoch()
2895 if (SEQ_GEQ(rsm->r_delivered, bbr->r_ctl.rc_pkt_epoch_del)) { in bbr_isit_a_pkt_epoch()
2922 rtt = (uint64_t)get_filter_value_small(&bbr->r_ctl.rc_rttprop); in __bbr_get_bw()
2928 if (min_bw < bbr->r_ctl.rc_initial_hptsi_bw) { in __bbr_get_bw()
2929 min_bw = bbr->r_ctl.rc_initial_hptsi_bw; in __bbr_get_bw()
2937 min_bw = bbr->r_ctl.rc_initial_hptsi_bw; in __bbr_get_bw()
2943 (bbr->r_ctl.rc_delivered > bbr_initial_cwnd(bbr, bbr->rc_tp))) in __bbr_get_bw()
2945 if ((bbr->rc_use_google) && (bbr->r_ctl.r_measurement_count >= 1)) in __bbr_get_bw()
2948 ((bbr->r_ctl.r_measurement_count < bbr_min_measurements_req) || in __bbr_get_bw()
2953 rtt = (uint64_t)get_filter_value_small(&bbr->r_ctl.rc_rttprop); in __bbr_get_bw()
2963 if (bw < bbr->r_ctl.rc_initial_hptsi_bw) { in __bbr_get_bw()
2964 bw = bbr->r_ctl.rc_initial_hptsi_bw; in __bbr_get_bw()
2968 bw = bbr->r_ctl.rc_initial_hptsi_bw; in __bbr_get_bw()
2979 bw = bbr->r_ctl.rc_lt_bw; in __bbr_get_bw()
2981 bw = bbr->r_ctl.red_bw; in __bbr_get_bw()
2983 bw = get_filter_value(&bbr->r_ctl.rc_delrate); in __bbr_get_bw()
3005 bbr->r_ctl.rc_lt_epoch = bbr->r_ctl.rc_pkt_epoch; in bbr_reset_lt_bw_interval()
3006 bbr->r_ctl.rc_lt_time = bbr->r_ctl.rc_del_time; in bbr_reset_lt_bw_interval()
3007 bbr->r_ctl.rc_lt_del = bbr->r_ctl.rc_delivered; in bbr_reset_lt_bw_interval()
3008 bbr->r_ctl.rc_lt_lost = bbr->r_ctl.rc_lost; in bbr_reset_lt_bw_interval()
3016 bbr->r_ctl.rc_lt_bw = 0; in bbr_reset_lt_bw_sampling()
3026 if (bbr->r_ctl.rc_lt_bw) { in bbr_lt_bw_samp_done()
3028 if (bbr->r_ctl.rc_lt_bw > bw) in bbr_lt_bw_samp_done()
3029 diff = bbr->r_ctl.rc_lt_bw - bw; in bbr_lt_bw_samp_done()
3031 diff = bw - bbr->r_ctl.rc_lt_bw; in bbr_lt_bw_samp_done()
3033 (diff <= (bbr->r_ctl.rc_lt_bw / bbr_lt_bw_ratio))) { in bbr_lt_bw_samp_done()
3037 saved_bw = (uint32_t)bbr->r_ctl.rc_lt_bw; in bbr_lt_bw_samp_done()
3038 bbr->r_ctl.rc_lt_bw = (bw + bbr->r_ctl.rc_lt_bw) / 2; /* average of two */ in bbr_lt_bw_samp_done()
3040 bbr->r_ctl.rc_bbr_hptsi_gain = BBR_UNIT; in bbr_lt_bw_samp_done()
3045 bbr->r_ctl.rc_lt_epoch_use = bbr->r_ctl.rc_pkt_epoch; in bbr_lt_bw_samp_done()
3054 bbr->r_ctl.rc_lt_bw = bw; in bbr_lt_bw_samp_done()
3066 deduct = bbr->r_ctl.rc_level_state_extra / ran; in bbr_randomize_extra_state_time()
3067 bbr->r_ctl.rc_level_state_extra -= deduct; in bbr_randomize_extra_state_time()
3081 bbr->r_ctl.rc_exta_time_gd = 0; in bbr_pick_probebw_substate()
3083 bbr->r_ctl.rc_level_state_extra = 0; in bbr_pick_probebw_substate()
3095 if ((cts - bbr->r_ctl.rc_rcv_epoch_start) >= bbr_get_rtt(bbr, BBR_RTT_PROP)) in bbr_pick_probebw_substate()
3098 bbr->r_ctl.bbr_lost_at_state = bbr->r_ctl.rc_lost; in bbr_pick_probebw_substate()
3112 diff = bbr->r_ctl.rc_pkt_epoch - bbr->r_ctl.rc_lt_epoch_use; in bbr_lt_bw_sampling()
3131 bbr->r_ctl.rc_bbr_state_time = cts; in bbr_lt_bw_sampling()
3132 bbr->r_ctl.rc_lost_at_startup = bbr->r_ctl.rc_lost; in bbr_lt_bw_sampling()
3133 bbr->r_ctl.rc_bbr_hptsi_gain = bbr->r_ctl.rc_startup_pg; in bbr_lt_bw_sampling()
3134 bbr->r_ctl.rc_bbr_cwnd_gain = bbr->r_ctl.rc_startup_pg; in bbr_lt_bw_sampling()
3149 bbr->r_ctl.rc_lt_del = bbr->r_ctl.rc_delivered; in bbr_lt_bw_sampling()
3150 bbr->r_ctl.rc_lt_lost = bbr->r_ctl.rc_lost; in bbr_lt_bw_sampling()
3153 lost = bbr->r_ctl.rc_lost - bbr->r_ctl.rc_lt_lost; in bbr_lt_bw_sampling()
3154 delivered = bbr->r_ctl.rc_delivered - bbr->r_ctl.rc_lt_del; in bbr_lt_bw_sampling()
3183 if (TSTMP_GEQ(bbr->r_ctl.rc_del_time, bbr->r_ctl.rc_lt_time)) in bbr_lt_bw_sampling()
3184 d_time = bbr->r_ctl.rc_del_time - bbr->r_ctl.rc_lt_time; in bbr_lt_bw_sampling()
3189 if (bbr->r_ctl.r_app_limited_until) { in bbr_lt_bw_sampling()
3196 diff = bbr->r_ctl.rc_pkt_epoch - bbr->r_ctl.rc_lt_epoch; in bbr_lt_bw_sampling()
3231 lost = bbr->r_ctl.rc_lost - bbr->r_ctl.rc_lt_lost; in bbr_lt_bw_sampling()
3232 delivered = bbr->r_ctl.rc_delivered - bbr->r_ctl.rc_lt_del; in bbr_lt_bw_sampling()
3269 bbr->r_ctl.rc_num_maps_alloced++; in bbr_alloc()
3272 if (bbr->r_ctl.rc_free_cnt) { in bbr_alloc()
3274 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_free); in bbr_alloc()
3275 TAILQ_REMOVE(&bbr->r_ctl.rc_free, rsm, r_next); in bbr_alloc()
3276 bbr->r_ctl.rc_free_cnt--; in bbr_alloc()
3287 (bbr->r_ctl.rc_num_maps_alloced >= V_tcp_map_entries_limit)) { in bbr_alloc_full_limit()
3307 bbr->r_ctl.rc_num_split_allocs >= V_tcp_map_split_limit) { in bbr_alloc_limit()
3321 bbr->r_ctl.rc_num_split_allocs++; in bbr_alloc_limit()
3331 bbr->r_ctl.rc_num_split_allocs--; in bbr_free()
3334 bbr->r_ctl.rc_num_small_maps_alloced--; in bbr_free()
3335 if (bbr->r_ctl.rc_tlp_send == rsm) in bbr_free()
3336 bbr->r_ctl.rc_tlp_send = NULL; in bbr_free()
3337 if (bbr->r_ctl.rc_resend == rsm) { in bbr_free()
3338 bbr->r_ctl.rc_resend = NULL; in bbr_free()
3340 if (bbr->r_ctl.rc_next == rsm) in bbr_free()
3341 bbr->r_ctl.rc_next = NULL; in bbr_free()
3342 if (bbr->r_ctl.rc_sacklast == rsm) in bbr_free()
3343 bbr->r_ctl.rc_sacklast = NULL; in bbr_free()
3344 if (bbr->r_ctl.rc_free_cnt < bbr_min_req_free) { in bbr_free()
3346 TAILQ_INSERT_TAIL(&bbr->r_ctl.rc_free, rsm, r_next); in bbr_free()
3348 bbr->r_ctl.rc_free_cnt++; in bbr_free()
3351 bbr->r_ctl.rc_num_maps_alloced--; in bbr_free()
3414 if ((get_filter_value_small(&bbr->r_ctl.rc_rttprop) == 0xffffffff) || in bbr_get_raw_target_cwnd()
3437 mss = min((bbr->rc_tp->t_maxseg - bbr->rc_last_options), bbr->r_ctl.rc_pace_max_segs); in bbr_get_target_cwnd()
3445 cwnd += (bbr_quanta * bbr->r_ctl.rc_pace_max_segs); in bbr_get_target_cwnd()
3482 if (bbr->r_ctl.rc_inc_tcp_oh) { in bbr_get_header_oh()
3486 if (bbr->r_ctl.rc_inc_ip_oh) { in bbr_get_header_oh()
3500 if (bbr->r_ctl.rc_inc_enet_oh) { in bbr_get_header_oh()
3553 cbw = bw * (uint64_t)(1000 - bbr->r_ctl.bbr_google_discount); in bbr_get_pacing_delay()
3605 time_stamp = max(1, ((bbr->r_ctl.rc_rcvtime - tp->gput_ts) / 1000)); in bbr_ack_received()
3619 ((bbr->r_ctl.bbr_rttprobe_gain_val == 0) || bbr->rc_use_google)) { in bbr_ack_received()
3639 bw = get_filter_value(&bbr->r_ctl.rc_delrate); in bbr_ack_received()
3643 (uint32_t)bbr->r_ctl.rc_bbr_cwnd_gain); in bbr_ack_received()
3653 bbr->r_ctl.rc_recovery_start = bbr->r_ctl.rc_rcvtime; in bbr_ack_received()
3655 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)) + in bbr_ack_received()
3669 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_ack_received()
3675 if (TSTMP_GEQ(bbr->r_ctl.rc_rcvtime, bbr->r_ctl.rc_recovery_start)) in bbr_ack_received()
3676 time_in = bbr->r_ctl.rc_rcvtime - bbr->r_ctl.rc_recovery_start; in bbr_ack_received()
3696 if ((bbr->rc_use_google == 0) && bbr->r_ctl.restrict_growth) { in bbr_ack_received()
3697 bbr->r_ctl.restrict_growth--; in bbr_ack_received()
3744 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)) <= in tcp_bbr_partialack()
3765 tcp_bbr_tso_size_check(bbr, bbr->r_ctl.rc_rcvtime); in bbr_post_recovery()
3779 tp->snd_cwnd = max(tp->snd_cwnd, bbr->r_ctl.rc_cwnd_on_ent); in bbr_post_recovery()
3783 if (bbr->r_ctl.rc_saved_cwnd < bbr->r_ctl.rc_cwnd_on_ent) { in bbr_post_recovery()
3784 bbr->r_ctl.rc_saved_cwnd = bbr->r_ctl.rc_cwnd_on_ent; in bbr_post_recovery()
3789 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_post_recovery()
3804 bbr->r_ctl.recovery_lr, 21, in bbr_post_recovery()
3806 bbr->r_ctl.rc_red_cwnd_pe, in bbr_post_recovery()
3822 cwnd = bbr->r_ctl.rc_saved_cwnd; in bbr_post_recovery()
3823 cwnd_p = &bbr->r_ctl.rc_saved_cwnd; in bbr_post_recovery()
3830 if (bbr->r_ctl.rc_lost == 0) in bbr_post_recovery()
3832 else if (bbr->r_ctl.rc_delivered == 0) in bbr_post_recovery()
3835 lr2use = (uint64_t)bbr->r_ctl.rc_lost * (uint64_t)1000; in bbr_post_recovery()
3836 lr2use /= bbr->r_ctl.rc_delivered; in bbr_post_recovery()
3838 lr2use += bbr->r_ctl.recovery_lr; in bbr_post_recovery()
3845 bbr->r_ctl.restrict_growth += acks_inflight; in bbr_post_recovery()
3884 bbr->r_ctl.rc_red_cwnd_pe = bbr->r_ctl.rc_pkt_epoch; in bbr_post_recovery()
3887 bbr->r_ctl.recovery_lr = 0; in bbr_post_recovery()
3891 tcp_bbr_tso_size_check(bbr, bbr->r_ctl.rc_rcvtime); in bbr_post_recovery()
3897 bbr->r_ctl.red_bw = get_filter_value(&bbr->r_ctl.rc_delrate); in bbr_setup_red_bw()
3899 if (bbr->r_ctl.red_bw > bbr->r_ctl.rc_bbr_cur_del_rate) in bbr_setup_red_bw()
3900 bbr->r_ctl.red_bw = bbr->r_ctl.rc_bbr_cur_del_rate; in bbr_setup_red_bw()
3901 if (bbr->r_ctl.red_bw < (get_filter_value(&bbr->r_ctl.rc_delrate) / 2)) in bbr_setup_red_bw()
3902 bbr->r_ctl.red_bw = get_filter_value(&bbr->r_ctl.rc_delrate) / 2; in bbr_setup_red_bw()
3921 bbr_set_pktepoch(bbr, bbr->r_ctl.rc_rcvtime, __LINE__); in bbr_cong_signal()
3928 bbr->r_ctl.rc_lt_epoch++; in bbr_cong_signal()
3937 bbr->r_ctl.rc_bbr_last_startup_epoch++; in bbr_cong_signal()
3939 bbr->r_ctl.rc_cwnd_on_ent = tp->snd_cwnd; in bbr_cong_signal()
3942 bbr->r_ctl.recovery_lr = bbr->r_ctl.rc_pkt_epoch_loss_rate; in bbr_cong_signal()
3943 tcp_bbr_tso_size_check(bbr, bbr->r_ctl.rc_rcvtime); in bbr_cong_signal()
3945 ((bbr->r_ctl.rc_hpts_flags & PACE_TMR_RACK) == 0)) { in bbr_cong_signal()
3953 bbr_timer_cancel(bbr, __LINE__, bbr->r_ctl.rc_rcvtime); in bbr_cong_signal()
3962 (bbr->r_ctl.bbr_rttprobe_gain_val || in bbr_cong_signal()
3965 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)) + in bbr_cong_signal()
3979 bbr_reset_lt_bw_sampling(bbr, bbr->r_ctl.rc_rcvtime); in bbr_cong_signal()
3984 tp->snd_cwnd = max(tp->snd_cwnd, bbr->r_ctl.rc_cwnd_on_ent); in bbr_cong_signal()
4029 TAILQ_FOREACH(rsm, &bbr->r_ctl.rc_tmap, r_tnext) { in bbr_find_lowest_rsm()
4050 TAILQ_FOREACH_REVERSE_FROM(prsm, &bbr->r_ctl.rc_map, bbr_head, r_next) { in bbr_find_high_nonack()
4088 if (bbr->r_ctl.rc_reorder_ts) { in bbr_calc_thresh_rack()
4089 if (bbr->r_ctl.rc_reorder_fade) { in bbr_calc_thresh_rack()
4090 if (SEQ_GEQ(cts, bbr->r_ctl.rc_reorder_ts)) { in bbr_calc_thresh_rack()
4091 lro = cts - bbr->r_ctl.rc_reorder_ts; in bbr_calc_thresh_rack()
4103 if (lro > bbr->r_ctl.rc_reorder_fade) { in bbr_calc_thresh_rack()
4105 bbr->r_ctl.rc_reorder_ts = 0; in bbr_calc_thresh_rack()
4115 thresh = srtt + bbr->r_ctl.rc_pkt_delay; in bbr_calc_thresh_rack()
4118 if (bbr->r_ctl.rc_reorder_shift) in bbr_calc_thresh_rack()
4119 thresh += (srtt >> bbr->r_ctl.rc_reorder_shift); in bbr_calc_thresh_rack()
4222 f_rtt = get_filter_value_small(&bbr->r_ctl.rc_rttprop); in bbr_get_rtt()
4223 if (get_filter_value_small(&bbr->r_ctl.rc_rttprop) == 0xffffffff) { in bbr_get_rtt()
4241 if (bbr->r_ctl.rc_pkt_epoch_rtt) { in bbr_get_rtt()
4242 srtt = bbr->r_ctl.rc_pkt_epoch_rtt; in bbr_get_rtt()
4248 srtt = bbr->r_ctl.rc_last_rtt; in bbr_get_rtt()
4251 srtt += bbr->r_ctl.rc_ack_hdwr_delay; in bbr_get_rtt()
4293 if (TAILQ_EMPTY(&bbr->r_ctl.rc_map)) { in bbr_check_recovery_mode()
4297 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_tmap); in bbr_check_recovery_mode()
4326 bbr->r_ctl.rc_lost += rsm->r_end - rsm->r_start; in bbr_check_recovery_mode()
4327 bbr->r_ctl.rc_lost_bytes += rsm->r_end - rsm->r_start; in bbr_check_recovery_mode()
4361 if (TSTMP_LT(cts, bbr->r_ctl.rc_timer_exp)) { in bbr_timeout_rack()
4366 lost = bbr->r_ctl.rc_lost; in bbr_timeout_rack()
4370 if (bbr->r_ctl.rc_resend == NULL) { in bbr_timeout_rack()
4372 bbr->r_ctl.rc_resend = bbr_check_recovery_mode(tp, bbr, cts); in bbr_timeout_rack()
4375 bbr_lt_bw_sampling(bbr, cts, (bbr->r_ctl.rc_lost > lost)); in bbr_timeout_rack()
4376 bbr->r_ctl.rc_hpts_flags &= ~PACE_TMR_RACK; in bbr_timeout_rack()
4411 idx = min((bbr->rc_tp->t_maxseg - bbr->rc_last_options), bbr->r_ctl.rc_pace_max_segs); in bbr_clone_rsm()
4416 bbr->r_ctl.rc_num_small_maps_alloced++; in bbr_clone_rsm()
4421 bbr->r_ctl.rc_num_small_maps_alloced++; in bbr_clone_rsm()
4500 TAILQ_REMOVE(&bbr->r_ctl.rc_tmap, r_rsm, r_tnext); in bbr_merge_rsm()
4513 bbr->r_ctl.rc_lost_bytes -= r_rsm->r_end - r_rsm->r_start; in bbr_merge_rsm()
4515 TAILQ_REMOVE(&bbr->r_ctl.rc_map, r_rsm, r_next); in bbr_merge_rsm()
4549 if (TSTMP_LT(cts, bbr->r_ctl.rc_timer_exp)) { in bbr_timeout_tlp()
4592 bbr->r_ctl.rc_tlp_seg_send_cnt = 0; in bbr_timeout_tlp()
4593 bbr->r_ctl.rc_last_tlp_seq = tp->snd_max; in bbr_timeout_tlp()
4594 bbr->r_ctl.rc_tlp_send = NULL; in bbr_timeout_tlp()
4605 rsm = TAILQ_LAST_FAST(&bbr->r_ctl.rc_map, bbr_sendmap, r_next); in bbr_timeout_tlp()
4617 TAILQ_FOREACH_REVERSE(rsm, &bbr->r_ctl.rc_map, bbr_head, r_next) { in bbr_timeout_tlp()
4625 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_timeout_tlp()
4646 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_map, rsm, nrsm, r_next); in bbr_timeout_tlp()
4648 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_tmap, rsm, nrsm, r_tnext); in bbr_timeout_tlp()
4655 bbr->r_ctl.rc_tlp_send = rsm; in bbr_timeout_tlp()
4657 if (rsm->r_start == bbr->r_ctl.rc_last_tlp_seq) { in bbr_timeout_tlp()
4658 bbr->r_ctl.rc_tlp_seg_send_cnt++; in bbr_timeout_tlp()
4661 bbr->r_ctl.rc_last_tlp_seq = rsm->r_start; in bbr_timeout_tlp()
4662 bbr->r_ctl.rc_tlp_seg_send_cnt = 1; in bbr_timeout_tlp()
4665 if (bbr->r_ctl.rc_tlp_seg_send_cnt > bbr_tlp_max_resend) { in bbr_timeout_tlp()
4672 bbr->r_ctl.rc_tlp_send = NULL; in bbr_timeout_tlp()
4680 if (rsm && (rsm->r_start == bbr->r_ctl.rc_last_tlp_seq) && in bbr_timeout_tlp()
4681 (bbr->r_ctl.rc_tlp_seg_send_cnt > bbr_tlp_max_resend)) { in bbr_timeout_tlp()
4689 bbr->r_ctl.rc_hpts_flags &= ~PACE_TMR_TLP; in bbr_timeout_tlp()
4711 bbr->r_ctl.rc_hpts_flags &= ~PACE_TMR_DELACK; in bbr_timeout_delack()
4739 bbr->r_ctl.rc_hpts_flags &= ~PACE_TMR_PERSIT; in bbr_timeout_persist()
4809 bbr->r_ctl.rc_hpts_flags &= ~PACE_TMR_KEEP; in bbr_timeout_keepalive()
4866 lost = bbr->r_ctl.rc_lost; in bbr_remxt_tmr()
4870 TAILQ_FOREACH(rsm, &bbr->r_ctl.rc_map, r_next) { in bbr_remxt_tmr()
4878 TAILQ_INSERT_HEAD(&bbr->r_ctl.rc_tmap, rsm, r_tnext); in bbr_remxt_tmr()
4880 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_tmap, trsm, rsm, r_tnext); in bbr_remxt_tmr()
4899 bbr->r_ctl.rc_lost += rsm->r_end - rsm->r_start; in bbr_remxt_tmr()
4900 bbr->r_ctl.rc_lost_bytes += rsm->r_end - rsm->r_start; in bbr_remxt_tmr()
4924 bbr->r_ctl.rc_resend = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_remxt_tmr()
4928 bbr->r_ctl.rc_tlp_seg_send_cnt = 0; in bbr_remxt_tmr()
4930 bbr->r_ctl.rc_hptsi_agg_delay = 0; in bbr_remxt_tmr()
4932 bbr->r_ctl.rc_agg_early = 0; in bbr_remxt_tmr()
4934 bbr->r_ctl.rc_sacked = 0; in bbr_remxt_tmr()
4935 bbr->r_ctl.rc_sacklast = NULL; in bbr_remxt_tmr()
4937 bbr_lt_bw_sampling(bbr, cts, (bbr->r_ctl.rc_lost > lost)); in bbr_remxt_tmr()
4952 bbr->r_ctl.rc_hpts_flags &= ~PACE_TMR_RXT; in bbr_timeout_rxt()
4971 if ((bbr->r_ctl.rc_resend == NULL) || in bbr_timeout_rxt()
4972 ((bbr->r_ctl.rc_resend->r_flags & BBR_RWND_COLLAPSED) == 0)) { in bbr_timeout_rxt()
5028 MSEC_2_TICKS(bbr->r_ctl.rc_min_rto_ms), in bbr_timeout_rxt()
5167 sack_filter_clear(&bbr->r_ctl.bbr_sf, tp->snd_una); in bbr_timeout_rxt()
5179 int32_t timers = (bbr->r_ctl.rc_hpts_flags & PACE_TMR_MASK); in bbr_process_timers()
5186 if (bbr->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT) in bbr_process_timers()
5190 if (TSTMP_LT(cts, bbr->r_ctl.rc_timer_exp)) { in bbr_process_timers()
5193 if (bbr->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT) { in bbr_process_timers()
5207 left = bbr->r_ctl.rc_timer_exp - cts; in bbr_process_timers()
5214 bbr->r_ctl.rc_hpts_flags &= ~PACE_TMR_MASK; in bbr_process_timers()
5220 bbr->r_ctl.rc_tlp_rxt_last_time = cts; in bbr_process_timers()
5223 bbr->r_ctl.rc_tlp_rxt_last_time = cts; in bbr_process_timers()
5226 bbr->r_ctl.rc_tlp_rxt_last_time = cts; in bbr_process_timers()
5238 if (bbr->r_ctl.rc_hpts_flags & PACE_TMR_MASK) { in bbr_timer_cancel()
5250 if (bbr->r_ctl.rc_last_delay_val) { in bbr_timer_cancel()
5258 if (bbr->r_ctl.rc_last_delay_val > time_since_send) { in bbr_timer_cancel()
5260 bbr->r_ctl.rc_last_delay_val -= time_since_send; in bbr_timer_cancel()
5262 bbr->r_ctl.rc_last_delay_val = 0; in bbr_timer_cancel()
5269 bbr->rc_tmr_stopped = bbr->r_ctl.rc_hpts_flags & PACE_TMR_MASK; in bbr_timer_cancel()
5270 bbr->r_ctl.rc_hpts_flags &= ~(PACE_TMR_MASK); in bbr_timer_cancel()
5292 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_tmap); in bbr_get_earliest_send_outstanding()
5317 bbr->r_ctl.rc_lost_bytes -= rsm->r_end - rsm->r_start; in bbr_update_rsm()
5331 bbr->r_ctl.rc_holes_rxt += (rsm->r_end - rsm->r_start); in bbr_update_rsm()
5337 rsm->r_delivered = bbr->r_ctl.rc_delivered; in bbr_update_rsm()
5340 rsm->r_del_ack_ts = bbr->r_ctl.last_inbound_ts; in bbr_update_rsm()
5341 if (bbr->r_ctl.r_app_limited_until) in bbr_update_rsm()
5356 bbr->r_ctl.rc_sacked -= (rsm->r_end - rsm->r_start); in bbr_update_rsm()
5357 if (bbr->r_ctl.rc_sacked == 0) in bbr_update_rsm()
5358 bbr->r_ctl.rc_sacklast = NULL; in bbr_update_rsm()
5361 TAILQ_REMOVE(&bbr->r_ctl.rc_tmap, rsm, r_tnext); in bbr_update_rsm()
5363 TAILQ_INSERT_TAIL(&bbr->r_ctl.rc_tmap, rsm, r_tnext); in bbr_update_rsm()
5372 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_update_rsm()
5373 bbr->r_ctl.rc_next = TAILQ_NEXT(rsm, r_next); in bbr_update_rsm()
5374 if (bbr->r_ctl.rc_bbr_hptsi_gain > BBR_UNIT) { in bbr_update_rsm()
5377 } else if (bbr->r_ctl.rc_bbr_hptsi_gain < BBR_UNIT) { in bbr_update_rsm()
5384 rsm->r_del_time = bbr->r_ctl.rc_del_time; /* TEMP GOOGLE CODE */ in bbr_update_rsm()
5443 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_map, rsm, nrsm, r_next); in bbr_update_entry()
5446 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_tmap, rsm, nrsm, r_tnext); in bbr_update_entry()
5474 if (get_filter_value(&bbr->r_ctl.rc_delrate) >= act_rate) { in bbr_setup_less_of_rate()
5480 red = get_filter_value(&bbr->r_ctl.rc_delrate) - act_rate; in bbr_setup_less_of_rate()
5482 filter_reduce_by(&bbr->r_ctl.rc_delrate, red, cts); in bbr_setup_less_of_rate()
5496 if (bbr->r_ctl.crte == NULL) in bbr_update_hardware_pacing_rate()
5513 nrte = tcp_chg_pacing_rate(bbr->r_ctl.crte, in bbr_update_hardware_pacing_rate()
5522 if (nrte != bbr->r_ctl.crte) { in bbr_update_hardware_pacing_rate()
5523 bbr->r_ctl.crte = nrte; in bbr_update_hardware_pacing_rate()
5526 if (bbr->r_ctl.crte->rate < rate) { in bbr_update_hardware_pacing_rate()
5529 bbr->r_ctl.crte->rate, rate); in bbr_update_hardware_pacing_rate()
5543 bbr->r_ctl.crte->ptbl->rs_ifp, in bbr_update_hardware_pacing_rate()
5545 bbr->r_ctl.crte->rate, in bbr_update_hardware_pacing_rate()
5565 (bbr->r_ctl.crte == NULL)) in bbr_adjust_for_hw_pacing()
5575 rlp = bbr->r_ctl.crte; in bbr_adjust_for_hw_pacing()
5587 bbr->r_ctl.rc_pace_max_segs, cts, 1); in bbr_adjust_for_hw_pacing()
5588 hdwr_delay = bbr->r_ctl.rc_pace_max_segs / maxseg; in bbr_adjust_for_hw_pacing()
5595 (bbr->r_ctl.rc_pace_max_segs / maxseg), in bbr_adjust_for_hw_pacing()
5599 bbr->r_ctl.bbr_hptsi_segments_delay_tar)))) { in bbr_adjust_for_hw_pacing()
5614 (bbr->r_ctl.rc_pace_max_segs/maxseg)); in bbr_adjust_for_hw_pacing()
5617 (seg_sz < bbr->r_ctl.crte->ptbl->rs_min_seg)) { in bbr_adjust_for_hw_pacing()
5623 seg_sz = bbr->r_ctl.crte->ptbl->rs_min_seg; in bbr_adjust_for_hw_pacing()
5637 seg_sz = bbr->r_ctl.rc_pace_max_segs * bbr_hdwr_pace_adjust; in bbr_adjust_for_hw_pacing()
5639 (seg_sz < bbr->r_ctl.crte->ptbl->rs_min_seg)) { in bbr_adjust_for_hw_pacing()
5645 seg_sz = bbr->r_ctl.crte->ptbl->rs_min_seg; in bbr_adjust_for_hw_pacing()
5659 seg_sz = bbr->r_ctl.rc_pace_max_segs; in bbr_adjust_for_hw_pacing()
5661 if (seg_sz > bbr->r_ctl.rc_pace_max_segs) in bbr_adjust_for_hw_pacing()
5664 new_tso = bbr->r_ctl.rc_pace_max_segs; in bbr_adjust_for_hw_pacing()
5668 if (new_tso != bbr->r_ctl.rc_pace_max_segs) { in bbr_adjust_for_hw_pacing()
5669 bbr_log_type_tsosize(bbr, cts, new_tso, 0, bbr->r_ctl.rc_pace_max_segs, maxseg, 0); in bbr_adjust_for_hw_pacing()
5670 bbr->r_ctl.rc_pace_max_segs = new_tso; in bbr_adjust_for_hw_pacing()
5746 old_tso = bbr->r_ctl.rc_pace_max_segs; in tcp_bbr_tso_size_check()
5754 bbr->r_ctl.rc_pace_max_segs = ((bbr->rc_tp->t_maxseg - bbr->rc_last_options) * 2); in tcp_bbr_tso_size_check()
5756 bbr->r_ctl.rc_pace_max_segs = bbr_initial_cwnd(bbr, bbr->rc_tp); in tcp_bbr_tso_size_check()
5758 bbr->r_ctl.rc_pace_max_segs = bbr->rc_tp->t_maxseg - bbr->rc_last_options; in tcp_bbr_tso_size_check()
5759 if (bbr->r_ctl.rc_pace_min_segs != bbr->rc_tp->t_maxseg) in tcp_bbr_tso_size_check()
5760 bbr->r_ctl.rc_pace_min_segs = bbr->rc_tp->t_maxseg; in tcp_bbr_tso_size_check()
5761 if (bbr->r_ctl.rc_pace_max_segs == 0) { in tcp_bbr_tso_size_check()
5762 bbr->r_ctl.rc_pace_max_segs = maxseg; in tcp_bbr_tso_size_check()
5764 bbr_log_type_tsosize(bbr, cts, bbr->r_ctl.rc_pace_max_segs, tls_seg, old_tso, maxseg, 0); in tcp_bbr_tso_size_check()
5782 if (bbr->r_ctl.rc_bbr_hptsi_gain != BBR_UNIT) { in tcp_bbr_tso_size_check()
5783 bw *= bbr->r_ctl.rc_bbr_hptsi_gain; in tcp_bbr_tso_size_check()
5799 } else if (bw <= bbr->r_ctl.bbr_cross_over) { in tcp_bbr_tso_size_check()
5806 tso_len = bbr_get_pacing_length(bbr, BBR_UNIT, bbr->r_ctl.bbr_hptsi_segments_delay_tar, bw); in tcp_bbr_tso_size_check()
5809 if (new_tso > bbr->r_ctl.bbr_hptsi_segments_max) in tcp_bbr_tso_size_check()
5810 new_tso = bbr->r_ctl.bbr_hptsi_segments_max; in tcp_bbr_tso_size_check()
5843 bw /= bbr->r_ctl.bbr_hptsi_per_second; in tcp_bbr_tso_size_check()
5850 if (new_tso < (bbr->r_ctl.bbr_hptsi_segments_max * maxseg)) in tcp_bbr_tso_size_check()
5851 new_tso = (bbr->r_ctl.bbr_hptsi_segments_max * maxseg); in tcp_bbr_tso_size_check()
5853 …if (bbr->r_ctl.bbr_hptsi_segments_floor && (new_tso < (maxseg * bbr->r_ctl.bbr_hptsi_segments_floo… in tcp_bbr_tso_size_check()
5854 new_tso = maxseg * bbr->r_ctl.bbr_hptsi_segments_floor; in tcp_bbr_tso_size_check()
5858 if (bbr->r_ctl.bbr_utter_max && (new_tso > (bbr->r_ctl.bbr_utter_max * maxseg))) { in tcp_bbr_tso_size_check()
5859 new_tso = bbr->r_ctl.bbr_utter_max * maxseg; in tcp_bbr_tso_size_check()
5864 bbr->r_ctl.rc_pace_max_segs = new_tso; in tcp_bbr_tso_size_check()
5942 pacing_time = bbr_get_pacing_delay(bbr, bbr->r_ctl.rc_bbr_hptsi_gain, len, cts, 1); in bbr_log_output()
5961 rsm->r_delivered = bbr->r_ctl.rc_delivered; in bbr_log_output()
5965 rsm->r_del_ack_ts = bbr->r_ctl.last_inbound_ts; in bbr_log_output()
5966 rsm->r_del_time = bbr->r_ctl.rc_del_time; in bbr_log_output()
5967 if (bbr->r_ctl.r_app_limited_until) in bbr_log_output()
5973 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_log_output()
5979 TAILQ_INSERT_TAIL(&bbr->r_ctl.rc_map, rsm, r_next); in bbr_log_output()
5980 TAILQ_INSERT_TAIL(&bbr->r_ctl.rc_tmap, rsm, r_tnext); in bbr_log_output()
5986 if (bbr->r_ctl.rc_bbr_hptsi_gain > BBR_UNIT) { in bbr_log_output()
5989 } else if (bbr->r_ctl.rc_bbr_hptsi_gain < BBR_UNIT) { in bbr_log_output()
6005 } else if (bbr->r_ctl.rc_next) { in bbr_log_output()
6007 rsm = bbr->r_ctl.rc_next; in bbr_log_output()
6025 TAILQ_FOREACH(rsm, &bbr->r_ctl.rc_map, r_next) { in bbr_log_output()
6028 bbr->r_ctl.rc_next = TAILQ_NEXT(rsm, r_next); in bbr_log_output()
6051 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_map, rsm, nrsm, r_next); in bbr_log_output()
6053 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_tmap, rsm, nrsm, r_tnext); in bbr_log_output()
6074 TAILQ_FOREACH(rsm, &bbr->r_ctl.rc_map, r_next) { in bbr_log_output()
6108 bbr->r_ctl.cur_rtt = rtt_usecs; in tcp_bbr_xmit_timer()
6109 bbr->r_ctl.ts_in = tsin; in tcp_bbr_xmit_timer()
6111 bbr->r_ctl.cur_rtt_send_time = rsm_send_time; in tcp_bbr_xmit_timer()
6155 delta = bbr->r_ctl.cur_rtt_send_time - bbr->r_ctl.bbr_ts_check_our_cts; in bbr_make_timestamp_determination()
6165 peer_delta = bbr->r_ctl.last_inbound_ts - bbr->r_ctl.bbr_ts_check_tstmp; in bbr_make_timestamp_determination()
6189 bbr->r_ctl.bbr_peer_tsratio = 1; in bbr_make_timestamp_determination()
6202 bbr->r_ctl.bbr_peer_tsratio = 1; in bbr_make_timestamp_determination()
6209 bbr->r_ctl.bbr_peer_tsratio = 10; in bbr_make_timestamp_determination()
6216 bbr->r_ctl.bbr_peer_tsratio = 100; in bbr_make_timestamp_determination()
6223 bbr->r_ctl.bbr_peer_tsratio = 1000; in bbr_make_timestamp_determination()
6230 bbr->r_ctl.bbr_peer_tsratio = 10000; in bbr_make_timestamp_determination()
6235 bbr->r_ctl.bbr_peer_tsratio = 0; in bbr_make_timestamp_determination()
6254 rtt = bbr->r_ctl.cur_rtt; in tcp_bbr_xmit_timer_commit()
6255 tsin = bbr->r_ctl.ts_in; in tcp_bbr_xmit_timer_commit()
6271 rtt_prop = get_filter_value_small(&bbr->r_ctl.rc_rttprop); in tcp_bbr_xmit_timer_commit()
6273 filter_increase_by_small(&bbr->r_ctl.rc_rttprop, (rtt - rtt_prop), cts); in tcp_bbr_xmit_timer_commit()
6275 apply_filter_min_small(&bbr->r_ctl.rc_rttprop, rtt, cts); in tcp_bbr_xmit_timer_commit()
6281 rtt += bbr->r_ctl.rc_ack_hdwr_delay; in tcp_bbr_xmit_timer_commit()
6283 if (rtt < bbr->r_ctl.rc_lowest_rtt) in tcp_bbr_xmit_timer_commit()
6284 bbr->r_ctl.rc_lowest_rtt = rtt; in tcp_bbr_xmit_timer_commit()
6308 bbr->r_ctl.bbr_ts_check_tstmp = bbr->r_ctl.last_inbound_ts; in tcp_bbr_xmit_timer_commit()
6309 bbr->r_ctl.bbr_ts_check_our_cts = bbr->r_ctl.cur_rtt_send_time; in tcp_bbr_xmit_timer_commit()
6379 max(MSEC_2_TICKS(bbr->r_ctl.rc_min_rto_ms), rtt_ticks + 2), in tcp_bbr_xmit_timer_commit()
6391 if (bbr->r_ctl.bbr_smallest_srtt_this_state > rtt) in tcp_bbr_xmit_timer_commit()
6392 bbr->r_ctl.bbr_smallest_srtt_this_state = rtt; in tcp_bbr_xmit_timer_commit()
6398 bbr->r_ctl.rc_rtt_shrinks = cts; in bbr_set_reduced_rtt()
6400 (TSTMP_GT(cts, bbr->r_ctl.last_in_probertt)) && in bbr_set_reduced_rtt()
6401 ((cts - bbr->r_ctl.last_in_probertt) > bbr->r_ctl.rc_probertt_int)) { in bbr_set_reduced_rtt()
6416 if (bbr->r_ctl.rc_bbr_cur_del_rate == 0) { in tcp_bbr_commit_bw()
6422 if (bbr->r_ctl.r_measurement_count < 0xffffffff) in tcp_bbr_commit_bw()
6423 bbr->r_ctl.r_measurement_count++; in tcp_bbr_commit_bw()
6424 orig_bw = get_filter_value(&bbr->r_ctl.rc_delrate); in tcp_bbr_commit_bw()
6425 apply_filter_max(&bbr->r_ctl.rc_delrate, bbr->r_ctl.rc_bbr_cur_del_rate, bbr->r_ctl.rc_pkt_epoch); in tcp_bbr_commit_bw()
6427 (uint32_t)get_filter_value(&bbr->r_ctl.rc_delrate), in tcp_bbr_commit_bw()
6430 (orig_bw != get_filter_value(&bbr->r_ctl.rc_delrate))) { in tcp_bbr_commit_bw()
6444 } else if ((orig_bw == 0) && get_filter_value(&bbr->r_ctl.rc_delrate)) in tcp_bbr_commit_bw()
6457 if (TSTMP_GT(bbr->r_ctl.rc_del_time, rsm->r_del_time)) in bbr_nf_measurement()
6458 tim = (uint64_t)(bbr->r_ctl.rc_del_time - rsm->r_del_time); in bbr_nf_measurement()
6466 delivered = (bbr->r_ctl.rc_delivered - rsm->r_delivered); in bbr_nf_measurement()
6483 ts_diff = max((bbr->r_ctl.last_inbound_ts - rsm->r_del_ack_ts), 1); in bbr_nf_measurement()
6484 ts_diff *= bbr->r_ctl.bbr_peer_tsratio; in bbr_nf_measurement()
6490 bbr->r_ctl.last_inbound_ts, in bbr_nf_measurement()
6552 bbr->r_ctl.rc_bbr_cur_del_rate = bw; in bbr_nf_measurement()
6554 (bw > get_filter_value(&bbr->r_ctl.rc_delrate))) { in bbr_nf_measurement()
6557 0, 0, 0, 0, bbr->r_ctl.rc_del_time, rsm->r_del_time); in bbr_nf_measurement()
6572 if (TSTMP_GT(bbr->r_ctl.rc_del_time, rsm->r_del_time)) in bbr_google_measurement()
6573 tim = (uint64_t)(bbr->r_ctl.rc_del_time - rsm->r_del_time); in bbr_google_measurement()
6581 delivered = (bbr->r_ctl.rc_delivered - rsm->r_delivered); in bbr_google_measurement()
6585 if (tim < bbr->r_ctl.rc_lowest_rtt) { in bbr_google_measurement()
6587 tim, bbr->r_ctl.rc_lowest_rtt, 0, 0, 0, 0); in bbr_google_measurement()
6595 bbr->r_ctl.rc_bbr_cur_del_rate = bw; in bbr_google_measurement()
6627 (sti < bbr->r_ctl.rc_lowest_rtt)) { in bbr_google_measurement()
6629 (uint32_t)sti, bbr->r_ctl.rc_lowest_rtt, 0, 0, 0, 0); in bbr_google_measurement()
6634 bbr->r_ctl.rc_bbr_cur_del_rate = bw; in bbr_google_measurement()
6637 (bw > get_filter_value(&bbr->r_ctl.rc_delrate)))) { in bbr_google_measurement()
6640 0, 0, 0, 0, bbr->r_ctl.rc_del_time, rsm->r_del_time); in bbr_google_measurement()
6652 bbr->r_ctl.rc_delivered += (rsm->r_end - rsm->r_start); in bbr_update_bbr_info()
6653 bbr->r_ctl.rc_del_time = cts; in bbr_update_bbr_info()
6706 apply_filter_min_small(&bbr->r_ctl.rc_rttprop, rtt, cts); in bbr_update_bbr_info()
6729 if (bbr->r_ctl.r_app_limited_until && in bbr_update_bbr_info()
6730 (bbr->r_ctl.rc_delivered >= bbr->r_ctl.r_app_limited_until)) { in bbr_update_bbr_info()
6732 bbr->r_ctl.r_app_limited_until = 0; in bbr_update_bbr_info()
6784 bbr->r_ctl.rc_last_rtt = t; in bbr_update_rtt()
6824 bbr->r_ctl.rc_last_rtt = t; in bbr_update_rtt()
6853 if (t < bbr->r_ctl.rc_lowest_rtt) { in bbr_update_rtt()
6915 TAILQ_FOREACH_REVERSE_FROM(nrsm, &bbr->r_ctl.rc_tmap, in bbr_log_sack_passed()
6936 bbr_is_lost(bbr, nrsm, bbr->r_ctl.rc_rcvtime)) { in bbr_log_sack_passed()
6937 bbr->r_ctl.rc_lost += nrsm->r_end - nrsm->r_start; in bbr_log_sack_passed()
6938 bbr->r_ctl.rc_lost_bytes += nrsm->r_end - nrsm->r_start; in bbr_log_sack_passed()
6968 TAILQ_FOREACH_REVERSE_FROM(rsm, &bbr->r_ctl.rc_map, bbr_head, r_next) { in bbr_proc_sack_blk()
6981 TAILQ_FOREACH_FROM(rsm, &bbr->r_ctl.rc_map, r_next) { in bbr_proc_sack_blk()
7000 nrsm = TAILQ_LAST_FAST(&bbr->r_ctl.rc_map, bbr_sendmap, r_next); in bbr_proc_sack_blk()
7038 sack_filter_reject(&bbr->r_ctl.bbr_sf, &blk); in bbr_proc_sack_blk()
7042 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_map, rsm, nrsm, r_next); in bbr_proc_sack_blk()
7044 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_tmap, rsm, nrsm, r_tnext); in bbr_proc_sack_blk()
7058 bbr->r_ctl.rc_sacked += (rsm->r_end - rsm->r_start); in bbr_proc_sack_blk()
7061 bbr->r_ctl.rc_lost_bytes -= rsm->r_end - rsm->r_start; in bbr_proc_sack_blk()
7066 bbr->r_ctl.rc_reorder_ts = cts; in bbr_proc_sack_blk()
7068 bbr->r_ctl.rc_lost -= rsm->r_end - rsm->r_start; in bbr_proc_sack_blk()
7069 if (SEQ_GT(bbr->r_ctl.rc_lt_lost, bbr->r_ctl.rc_lost)) in bbr_proc_sack_blk()
7071 bbr->r_ctl.rc_lt_lost = bbr->r_ctl.rc_lost; in bbr_proc_sack_blk()
7077 TAILQ_REMOVE(&bbr->r_ctl.rc_tmap, rsm, r_tnext); in bbr_proc_sack_blk()
7108 sack_filter_reject(&bbr->r_ctl.bbr_sf, &blk); in bbr_proc_sack_blk()
7115 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_map, rsm, nrsm, r_next); in bbr_proc_sack_blk()
7117 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_tmap, rsm, nrsm, r_tnext); in bbr_proc_sack_blk()
7124 bbr->r_ctl.rc_sacked += (rsm->r_end - rsm->r_start); in bbr_proc_sack_blk()
7128 bbr->r_ctl.rc_lost_bytes -= rsm->r_end - rsm->r_start; in bbr_proc_sack_blk()
7132 bbr->r_ctl.rc_reorder_ts = cts; in bbr_proc_sack_blk()
7134 bbr->r_ctl.rc_lost -= rsm->r_end - rsm->r_start; in bbr_proc_sack_blk()
7135 if (SEQ_GT(bbr->r_ctl.rc_lt_lost, bbr->r_ctl.rc_lost)) in bbr_proc_sack_blk()
7137 bbr->r_ctl.rc_lt_lost = bbr->r_ctl.rc_lost; in bbr_proc_sack_blk()
7143 TAILQ_REMOVE(&bbr->r_ctl.rc_tmap, rsm, r_tnext); in bbr_proc_sack_blk()
7181 bbr->r_ctl.rc_sacklast = TAILQ_NEXT(rsm, r_next); in bbr_proc_sack_blk()
7183 bbr->r_ctl.rc_sacklast = NULL; in bbr_proc_sack_blk()
7198 bbr->r_ctl.rc_sacked -= (rsm->r_end - rsm->r_start); in bbr_peer_reneges()
7207 bbr->r_ctl.rc_lost -= rsm->r_end - rsm->r_start; in bbr_peer_reneges()
7208 bbr->r_ctl.rc_lost_bytes -= rsm->r_end - rsm->r_start; in bbr_peer_reneges()
7209 if (SEQ_GT(bbr->r_ctl.rc_lt_lost, bbr->r_ctl.rc_lost)) in bbr_peer_reneges()
7211 bbr->r_ctl.rc_lt_lost = bbr->r_ctl.rc_lost; in bbr_peer_reneges()
7216 bbr_log_type_rsmclear(bbr, bbr->r_ctl.rc_rcvtime, rsm, oflags, __LINE__); in bbr_peer_reneges()
7219 TAILQ_INSERT_HEAD(&bbr->r_ctl.rc_tmap, rsm, r_tnext); in bbr_peer_reneges()
7222 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_tmap, tmap, rsm, r_tnext); in bbr_peer_reneges()
7240 sack_filter_clear(&bbr->r_ctl.bbr_sf, th_ack); in bbr_peer_reneges()
7251 cts = bbr->r_ctl.rc_rcvtime; in bbr_log_syn()
7252 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_log_syn()
7256 bbr->r_ctl.rc_holes_rxt -= rsm->r_rtr_bytes; in bbr_log_syn()
7258 TAILQ_REMOVE(&bbr->r_ctl.rc_map, rsm, r_next); in bbr_log_syn()
7260 TAILQ_REMOVE(&bbr->r_ctl.rc_tmap, rsm, r_tnext); in bbr_log_syn()
7263 if (bbr->r_ctl.rc_next == rsm) { in bbr_log_syn()
7265 bbr->r_ctl.rc_next = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_log_syn()
7302 cts = bbr->r_ctl.rc_rcvtime; in bbr_log_ack()
7304 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_log_ack()
7307 p_maxseg = min(bbr->r_ctl.rc_pace_max_segs, maxseg); in bbr_log_ack()
7340 apply_filter_min_small(&bbr->r_ctl.rc_rttprop, rtt, cts); in bbr_log_ack()
7402 bbr->r_ctl.rc_sacked -= (rsm->r_end - rsm->r_start); in bbr_log_ack()
7403 if (bbr->r_ctl.rc_sacked == 0) in bbr_log_ack()
7404 bbr->r_ctl.rc_sacklast = NULL; in bbr_log_ack()
7408 bbr->r_ctl.rc_lost_bytes -= rsm->r_end - rsm->r_start; in bbr_log_ack()
7417 bbr->r_ctl.rc_reorder_ts = cts; in bbr_log_ack()
7419 bbr->r_ctl.rc_lost -= rsm->r_end - rsm->r_start; in bbr_log_ack()
7420 if (SEQ_GT(bbr->r_ctl.rc_lt_lost, bbr->r_ctl.rc_lost)) in bbr_log_ack()
7422 bbr->r_ctl.rc_lt_lost = bbr->r_ctl.rc_lost; in bbr_log_ack()
7427 bbr->r_ctl.rc_holes_rxt -= rsm->r_rtr_bytes; in bbr_log_ack()
7429 TAILQ_REMOVE(&bbr->r_ctl.rc_map, rsm, r_next); in bbr_log_ack()
7431 TAILQ_REMOVE(&bbr->r_ctl.rc_tmap, rsm, r_tnext); in bbr_log_ack()
7434 if (bbr->r_ctl.rc_next == rsm) { in bbr_log_ack()
7436 bbr->r_ctl.rc_next = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_log_ack()
7444 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_log_ack()
7455 bbr->r_ctl.rc_sacked -= (th_ack - rsm->r_start); in bbr_log_ack()
7456 if (bbr->r_ctl.rc_sacked == 0) in bbr_log_ack()
7457 bbr->r_ctl.rc_sacklast = NULL; in bbr_log_ack()
7475 bbr->r_ctl.rc_lost_bytes -= th_ack - rsm->r_start; in bbr_log_ack()
7478 bbr->r_ctl.rc_holes_rxt -= rsm->r_rtr_bytes; in bbr_log_ack()
7484 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_log_ack()
7504 rsm = TAILQ_LAST_FAST(&bbr->r_ctl.rc_map, bbr_sendmap, r_next); in bbr_log_ack()
7525 if ((bbr->r_ctl.rc_num_small_maps_alloced > bbr_sack_block_limit) && in bbr_log_ack()
7551 new_sb = sack_filter_blks(tp, &bbr->r_ctl.bbr_sf, sack_blocks, in bbr_log_ack()
7608 rsm = bbr->r_ctl.rc_sacklast; in bbr_log_ack()
7635 if (bbr->r_ctl.rc_resend == NULL) { in bbr_log_ack()
7636 bbr->r_ctl.rc_resend = rsm; in bbr_log_ack()
7646 if (bbr->r_ctl.rc_resend == NULL) { in bbr_log_ack()
7647 bbr->r_ctl.rc_resend = bbr_check_recovery_mode(tp, bbr, cts); in bbr_log_ack()
7663 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_tmap); in bbr_strike_dupack()
7693 lost = bbr->r_ctl.rc_lost; in bbr_process_ack()
7745 bbr_lt_bw_sampling(bbr, bbr->r_ctl.rc_rcvtime, (bbr->r_ctl.rc_lost > lost)); in bbr_process_ack()
7818 …bbr_ack_received(tp, bbr, th, acked, sack_changed, prev_acked, __LINE__, (bbr->r_ctl.rc_lost - los… in bbr_process_ack()
7843 bbr_timer_cancel(bbr, __LINE__, bbr->r_ctl.rc_rcvtime); in bbr_process_ack()
7845 bbr->r_ctl.rc_went_idle_time = bbr->r_ctl.rc_rcvtime; in bbr_process_ack()
7847 sack_filter_clear(&bbr->r_ctl.bbr_sf, tp->snd_una); in bbr_process_ack()
7848 bbr_log_ack_clear(bbr, bbr->r_ctl.rc_rcvtime); in bbr_process_ack()
7883 bbr->r_ctl.rc_last_delay_val = 0; in bbr_enter_persist()
7886 bbr->r_ctl.rc_went_idle_time = cts; in bbr_enter_persist()
7890 if (SEQ_GT(cts, bbr->r_ctl.rc_bbr_state_time)) { in bbr_enter_persist()
7893 time_in = cts - bbr->r_ctl.rc_bbr_state_time; in bbr_enter_persist()
7903 bbr->r_ctl.rc_bbr_state_time = cts; in bbr_enter_persist()
7924 bbr->r_ctl.rc_bbr_hptsi_gain = BBR_UNIT; in bbr_restart_after_idle()
7925 bbr->r_ctl.rc_bbr_cwnd_gain = BBR_UNIT; in bbr_restart_after_idle()
7928 bbr->r_ctl.rc_bbr_hptsi_gain = bbr->r_ctl.rc_startup_pg; in bbr_restart_after_idle()
7929 bbr->r_ctl.rc_bbr_cwnd_gain = bbr->r_ctl.rc_startup_pg; in bbr_restart_after_idle()
7944 idle_time = bbr_calc_time(cts, bbr->r_ctl.rc_went_idle_time); in bbr_exit_persist()
7947 bbr->r_ctl.rc_del_time = cts; in bbr_exit_persist()
7956 bbr->r_ctl.rc_hpts_flags = 0; in bbr_exit_persist()
7957 bbr->r_ctl.rc_last_delay_val = 0; in bbr_exit_persist()
7958 bbr->r_ctl.rc_hptsi_agg_delay = 0; in bbr_exit_persist()
7960 bbr->r_ctl.rc_agg_early = 0; in bbr_exit_persist()
7970 bbr->r_ctl.last_in_probertt = bbr->r_ctl.rc_rtt_shrinks = cts; in bbr_exit_persist()
7983 bbr->r_ctl.bbr_lost_at_state = bbr->r_ctl.rc_lost; in bbr_exit_persist()
7985 bbr->r_ctl.rc_bbr_state_time = cts; in bbr_exit_persist()
8025 TAILQ_FOREACH(rsm, &bbr->r_ctl.rc_map, r_next) { in bbr_collapsed_window()
8059 } else if (bbr->r_ctl.rc_num_small_maps_alloced < bbr_sack_block_limit) { in bbr_collapsed_window()
8086 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_map, rsm, nrsm, r_next); in bbr_collapsed_window()
8088 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_tmap, rsm, nrsm, r_tnext); in bbr_collapsed_window()
8102 TAILQ_FOREACH_FROM(nrsm, &bbr->r_ctl.rc_map, r_next) { in bbr_collapsed_window()
8116 TAILQ_FOREACH_REVERSE(rsm, &bbr->r_ctl.rc_map, bbr_head, r_next) { in bbr_un_collapse_window()
8178 (tp->snd_wnd >= min((bbr->r_ctl.rc_high_rwnd/2), in bbr_process_data()
8184 bbr_exit_persist(tp, bbr, bbr->r_ctl.rc_rcvtime, __LINE__); in bbr_process_data()
8191 (tp->snd_wnd < min((bbr->r_ctl.rc_high_rwnd/2), bbr_minseg(bbr))) && in bbr_process_data()
8197 bbr_enter_persist(tp, bbr, bbr->r_ctl.rc_rcvtime, __LINE__); in bbr_process_data()
8261 bbr_timer_cancel(bbr, __LINE__, bbr->r_ctl.rc_rcvtime); in bbr_process_data()
8368 __LINE__, bbr->r_ctl.rc_rcvtime); in bbr_process_data()
8402 __LINE__, bbr->r_ctl.rc_rcvtime); in bbr_process_data()
8443 if (bbr->r_ctl.rc_resend != NULL) { in bbr_do_fastnewdata()
8540 bbr_timer_cancel(bbr, __LINE__, bbr->r_ctl.rc_rcvtime); in bbr_do_fastnewdata()
8594 if (__predict_false(bbr->r_ctl.rc_resend != NULL)) { in bbr_fastack()
8602 if (bbr->r_ctl.rc_sacked) { in bbr_fastack()
8614 bbr_lt_bw_sampling(bbr, bbr->r_ctl.rc_rcvtime, 0); in bbr_fastack()
8624 (tp->snd_wnd >= min((bbr->r_ctl.rc_high_rwnd/2), in bbr_fastack()
8626 bbr_exit_persist(tp, bbr, bbr->r_ctl.rc_rcvtime, __LINE__); in bbr_fastack()
8631 (tp->snd_wnd < min((bbr->r_ctl.rc_high_rwnd/2), bbr_minseg(bbr))) && in bbr_fastack()
8637 bbr_enter_persist(tp, bbr, bbr->r_ctl.rc_rcvtime, __LINE__); in bbr_fastack()
8646 tp->ts_recent_age = bbr->r_ctl.rc_rcvtime; in bbr_fastack()
8713 bbr_timer_cancel(bbr, __LINE__, bbr->r_ctl.rc_rcvtime); in bbr_fastack()
8715 bbr->r_ctl.rc_went_idle_time = bbr->r_ctl.rc_rcvtime; in bbr_fastack()
8717 sack_filter_clear(&bbr->r_ctl.bbr_sf, tp->snd_una); in bbr_fastack()
8718 bbr_log_ack_clear(bbr, bbr->r_ctl.rc_rcvtime); in bbr_fastack()
8817 bbr_timer_cancel(bbr, __LINE__, bbr->r_ctl.rc_rcvtime); in bbr_do_syn_sent()
8904 apply_filter_min_small(&bbr->r_ctl.rc_rttprop, in bbr_do_syn_sent()
8905 rtt, bbr->r_ctl.rc_rcvtime); in bbr_do_syn_sent()
8984 if ((bbr->r_ctl.rc_hpts_flags & PACE_TMR_RXT) || in bbr_do_syn_recv()
8985 (bbr->r_ctl.rc_hpts_flags & PACE_TMR_TLP) || in bbr_do_syn_recv()
8986 (bbr->r_ctl.rc_hpts_flags & PACE_TMR_RACK)) { in bbr_do_syn_recv()
9078 apply_filter_min_small(&bbr->r_ctl.rc_rttprop, rtt, bbr->r_ctl.rc_rcvtime); in bbr_do_syn_recv()
9194 if (bbr->r_ctl.rc_delivered < (4 * tp->t_maxseg)) { in bbr_do_established()
9200 bbr->r_ctl.rc_init_rwnd = max(tiwin, tp->snd_wnd); in bbr_do_established()
9879 bbr->r_ctl.bbr_google_discount = bbr_google_discount; in bbr_google_mode_on()
9881 bbr->r_ctl.rc_probertt_int = (USECS_IN_SECOND * 10); in bbr_google_mode_on()
9883 bbr->r_ctl.rc_incr_tmrs = 0; in bbr_google_mode_on()
9884 bbr->r_ctl.rc_inc_tcp_oh = 0; in bbr_google_mode_on()
9885 bbr->r_ctl.rc_inc_ip_oh = 0; in bbr_google_mode_on()
9886 bbr->r_ctl.rc_inc_enet_oh = 0; in bbr_google_mode_on()
9887 reset_time(&bbr->r_ctl.rc_delrate, in bbr_google_mode_on()
9889 reset_time_small(&bbr->r_ctl.rc_rttprop, in bbr_google_mode_on()
9898 bbr->r_ctl.bbr_google_discount = 0; in bbr_google_mode_off()
9910 bbr->r_ctl.rc_incr_tmrs = 1; in bbr_google_mode_off()
9912 bbr->r_ctl.rc_incr_tmrs = 0; in bbr_google_mode_off()
9914 bbr->r_ctl.rc_inc_tcp_oh = 1; in bbr_google_mode_off()
9916 bbr->r_ctl.rc_inc_tcp_oh = 0; in bbr_google_mode_off()
9918 bbr->r_ctl.rc_inc_ip_oh = 1; in bbr_google_mode_off()
9920 bbr->r_ctl.rc_inc_ip_oh = 0; in bbr_google_mode_off()
9922 bbr->r_ctl.rc_inc_enet_oh = 1; in bbr_google_mode_off()
9924 bbr->r_ctl.rc_inc_enet_oh = 0; in bbr_google_mode_off()
9925 bbr->r_ctl.rc_probertt_int = bbr_rtt_probe_limit; in bbr_google_mode_off()
9926 reset_time(&bbr->r_ctl.rc_delrate, in bbr_google_mode_off()
9928 reset_time_small(&bbr->r_ctl.rc_rttprop, in bbr_google_mode_off()
9965 TAILQ_INIT(&bbr->r_ctl.rc_map); in bbr_init()
9966 TAILQ_INIT(&bbr->r_ctl.rc_free); in bbr_init()
9967 TAILQ_INIT(&bbr->r_ctl.rc_tmap); in bbr_init()
9973 bbr->r_ctl.rc_reorder_fade = bbr_reorder_fade; in bbr_init()
9975 bbr->r_ctl.rc_reorder_shift = bbr_reorder_thresh; in bbr_init()
9976 bbr->r_ctl.rc_pkt_delay = bbr_pkt_delay; in bbr_init()
9977 bbr->r_ctl.rc_min_to = bbr_min_to; in bbr_init()
9979 bbr->r_ctl.bbr_lost_at_state = 0; in bbr_init()
9980 bbr->r_ctl.rc_lost_at_startup = 0; in bbr_init()
9982 bbr->r_ctl.rc_bbr_lastbtlbw = 0; in bbr_init()
9983 bbr->r_ctl.rc_pkt_epoch_del = 0; in bbr_init()
9984 bbr->r_ctl.rc_pkt_epoch = 0; in bbr_init()
9985 bbr->r_ctl.rc_lowest_rtt = 0xffffffff; in bbr_init()
9986 bbr->r_ctl.rc_bbr_hptsi_gain = bbr_high_gain; in bbr_init()
9987 bbr->r_ctl.rc_bbr_cwnd_gain = bbr_high_gain; in bbr_init()
9988 bbr->r_ctl.rc_went_idle_time = cts; in bbr_init()
9990 bbr->r_ctl.rc_pkt_epoch_time = cts; in bbr_init()
9991 bbr->r_ctl.rc_rcvtime = cts; in bbr_init()
9992 bbr->r_ctl.rc_bbr_state_time = cts; in bbr_init()
9993 bbr->r_ctl.rc_del_time = cts; in bbr_init()
9994 bbr->r_ctl.rc_tlp_rxt_last_time = cts; in bbr_init()
9995 bbr->r_ctl.last_in_probertt = cts; in bbr_init()
10004 bbr->r_ctl.bbr_google_discount = bbr_google_discount; in bbr_init()
10008 bbr->r_ctl.bbr_google_discount = 0; in bbr_init()
10028 bbr->r_ctl.rc_probertt_int = bbr_rtt_probe_limit; in bbr_init()
10030 bbr->r_ctl.rc_probertt_int = (USECS_IN_SECOND * 10); in bbr_init()
10031 bbr->r_ctl.rc_min_rto_ms = bbr_rto_min_ms; in bbr_init()
10036 bbr->r_ctl.rc_pace_max_segs = tp->t_maxseg - bbr->rc_last_options; in bbr_init()
10037 bbr->r_ctl.rc_high_rwnd = tp->snd_wnd; in bbr_init()
10049 bbr->r_ctl.bbr_utter_max = bbr_hptsi_utter_max; in bbr_init()
10050 bbr->r_ctl.rc_drain_pg = bbr_drain_gain; in bbr_init()
10051 bbr->r_ctl.rc_startup_pg = bbr_high_gain; in bbr_init()
10053 bbr->r_ctl.bbr_rttprobe_gain_val = bbr_rttprobe_gain; in bbr_init()
10054 bbr->r_ctl.bbr_hptsi_per_second = bbr_hptsi_per_second; in bbr_init()
10055 bbr->r_ctl.bbr_hptsi_segments_delay_tar = bbr_hptsi_segments_delay_tar; in bbr_init()
10056 bbr->r_ctl.bbr_hptsi_segments_max = bbr_hptsi_segments_max; in bbr_init()
10057 bbr->r_ctl.bbr_hptsi_segments_floor = bbr_hptsi_segments_floor; in bbr_init()
10058 bbr->r_ctl.bbr_hptsi_bytes_min = bbr_hptsi_bytes_min; in bbr_init()
10059 bbr->r_ctl.bbr_cross_over = bbr_cross_over; in bbr_init()
10060 bbr->r_ctl.rc_rtt_shrinks = cts; in bbr_init()
10062 setup_time_filter(&bbr->r_ctl.rc_delrate, in bbr_init()
10065 setup_time_filter_small(&bbr->r_ctl.rc_rttprop, in bbr_init()
10068 setup_time_filter(&bbr->r_ctl.rc_delrate, in bbr_init()
10071 setup_time_filter_small(&bbr->r_ctl.rc_rttprop, in bbr_init()
10079 bbr->r_ctl.rc_bbr_cur_del_rate = 0; in bbr_init()
10080 bbr->r_ctl.rc_initial_hptsi_bw = bbr_initial_bw_bps; in bbr_init()
10100 rsm->r_delivered = bbr->r_ctl.rc_delivered; in bbr_init()
10104 if (bbr->r_ctl.r_app_limited_until) in bbr_init()
10108 TAILQ_INSERT_TAIL(&bbr->r_ctl.rc_map, rsm, r_next); in bbr_init()
10109 TAILQ_INSERT_TAIL(&bbr->r_ctl.rc_tmap, rsm, r_tnext); in bbr_init()
10119 bbr->r_ctl.rc_incr_tmrs = 1; in bbr_init()
10121 bbr->r_ctl.rc_inc_tcp_oh = 1; in bbr_init()
10123 bbr->r_ctl.rc_inc_ip_oh = 1; in bbr_init()
10125 bbr->r_ctl.rc_inc_enet_oh = 1; in bbr_init()
10133 apply_filter_min_small(&bbr->r_ctl.rc_rttprop, rtt, cts); in bbr_init()
10202 if (bbr->r_ctl.crte) in bbr_fini()
10203 tcp_rel_pacing_rate(bbr->r_ctl.crte, bbr->rc_tp); in bbr_fini()
10210 if (bbr->r_ctl.crte != NULL) { in bbr_fini()
10211 tcp_rel_pacing_rate(bbr->r_ctl.crte, tp); in bbr_fini()
10212 bbr->r_ctl.crte = NULL; in bbr_fini()
10214 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_fini()
10216 TAILQ_REMOVE(&bbr->r_ctl.rc_map, rsm, r_next); in bbr_fini()
10218 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_fini()
10220 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_free); in bbr_fini()
10222 TAILQ_REMOVE(&bbr->r_ctl.rc_free, rsm, r_next); in bbr_fini()
10224 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_free); in bbr_fini()
10226 calc = bbr->r_ctl.rc_high_rwnd - bbr->r_ctl.rc_init_rwnd; in bbr_fini()
10227 if (calc > (bbr->r_ctl.rc_init_rwnd / 10)) in bbr_fini()
10231 bbr->r_ctl.rc_free_cnt = 0; in bbr_fini()
10252 bbr->r_ctl.rc_init_rwnd = max(win, bbr->rc_tp->snd_wnd); in bbr_set_state()
10297 if (bbr->r_ctl.bbr_smallest_srtt_this_state != 0xffffffff) in bbr_substate_change()
10298 bbr->r_ctl.bbr_smallest_srtt_state2 = bbr->r_ctl.bbr_smallest_srtt_this_state; in bbr_substate_change()
10312 bbr->r_ctl.rc_bbr_hptsi_gain = bbr_hptsi_gain[BBR_SUB_LEVEL1]; in bbr_substate_change()
10315 bbr->r_ctl.crte) { in bbr_substate_change()
10325 rate = bbr->r_ctl.crte->rate; in bbr_substate_change()
10331 bbr->r_ctl.rc_bbr_hptsi_gain = (uint16_t)gain_calc; in bbr_substate_change()
10333 bbr->r_ctl.rc_bbr_hptsi_gain = bbr_hptsi_gain[BBR_SUB_GAIN]; in bbr_substate_change()
10336 bbr->r_ctl.rc_bbr_hptsi_gain = bbr_hptsi_gain[BBR_SUB_GAIN]; in bbr_substate_change()
10338 bbr->r_ctl.rc_bbr_state_atflight = cts; in bbr_substate_change()
10340 bbr->r_ctl.rc_bbr_state_atflight = 0; in bbr_substate_change()
10343 bbr->r_ctl.rc_exta_time_gd = 0; in bbr_substate_change()
10344 bbr->r_ctl.flightsize_at_drain = ctf_flight_size(bbr->rc_tp, in bbr_substate_change()
10345 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_substate_change()
10347 bbr->r_ctl.rc_bbr_state_atflight = 0; in bbr_substate_change()
10349 bbr->r_ctl.rc_bbr_state_atflight = cts; in bbr_substate_change()
10350 bbr->r_ctl.rc_bbr_hptsi_gain = bbr_hptsi_gain[BBR_SUB_DRAIN]; in bbr_substate_change()
10356 (bbr->rc_tp->snd_cwnd < bbr->r_ctl.rc_saved_cwnd)) { in bbr_substate_change()
10357 bbr->rc_tp->snd_cwnd = bbr->r_ctl.rc_saved_cwnd; in bbr_substate_change()
10360 if ((cts - bbr->r_ctl.rc_bbr_state_time) > bbr_get_rtt(bbr, BBR_RTT_PROP)) in bbr_substate_change()
10361 bbr->r_ctl.rc_exta_time_gd += ((cts - bbr->r_ctl.rc_bbr_state_time) - in bbr_substate_change()
10364 bbr->r_ctl.rc_exta_time_gd = 0; in bbr_substate_change()
10365 if (bbr->r_ctl.rc_exta_time_gd) { in bbr_substate_change()
10366 bbr->r_ctl.rc_level_state_extra = bbr->r_ctl.rc_exta_time_gd; in bbr_substate_change()
10368 bbr->r_ctl.rc_level_state_extra /= 7; in bbr_substate_change()
10369 if (bbr_rand_ot && bbr->r_ctl.rc_level_state_extra) { in bbr_substate_change()
10375 bbr->r_ctl.rc_bbr_state_atflight = max(1, cts); in bbr_substate_change()
10376 bbr->r_ctl.rc_bbr_hptsi_gain = bbr_hptsi_gain[bbr_state_val(bbr)]; in bbr_substate_change()
10379 bbr->r_ctl.rc_bbr_state_atflight = max(1, cts); in bbr_substate_change()
10381 bbr->r_ctl.bbr_lost_at_state = bbr->r_ctl.rc_lost; in bbr_substate_change()
10382 bbr->r_ctl.rc_bbr_cwnd_gain = bbr_cwnd_gain; in bbr_substate_change()
10386 if (SEQ_GT(cts, bbr->r_ctl.rc_bbr_state_time)) { in bbr_substate_change()
10389 time_in = cts - bbr->r_ctl.rc_bbr_state_time; in bbr_substate_change()
10396 bbr->r_ctl.bbr_smallest_srtt_this_state = 0xffffffff; in bbr_substate_change()
10402 bbr->r_ctl.rc_saved_cwnd = bbr->rc_tp->snd_cwnd; in bbr_substate_change()
10403 bbr->rc_tp->snd_cwnd = bbr->r_ctl.rc_target_at_state; in bbr_substate_change()
10406 bbr->r_ctl.r_app_limited_until = (bbr->r_ctl.rc_delivered + in bbr_substate_change()
10408 (bbr->r_ctl.rc_sacked + in bbr_substate_change()
10409 bbr->r_ctl.rc_lost_bytes))); in bbr_substate_change()
10415 bbr->r_ctl.rc_bbr_hptsi_gain = BBR_UNIT; in bbr_substate_change()
10420 bbr->r_ctl.gain_epoch = cts; in bbr_substate_change()
10421 bbr->r_ctl.rc_bbr_state_time = cts; in bbr_substate_change()
10422 bbr->r_ctl.substate_pe = bbr->r_ctl.rc_pkt_epoch; in bbr_substate_change()
10430 (bbr->r_ctl.rc_flight_at_input <= bbr->r_ctl.rc_target_at_state)) { in bbr_set_probebw_google_gains()
10434 if (TSTMP_LT(cts, bbr->r_ctl.rc_bbr_state_time)) { in bbr_set_probebw_google_gains()
10437 if ((cts - bbr->r_ctl.rc_bbr_state_time) < bbr_get_rtt(bbr, BBR_RTT_PROP)) { in bbr_set_probebw_google_gains()
10454 if (bbr->r_ctl.rc_target_at_state > bbr->r_ctl.rc_flight_at_input) { in bbr_set_probebw_google_gains()
10485 if (bbr->r_ctl.rc_bbr_state_atflight == 0) { in bbr_set_probebw_gains()
10488 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_set_probebw_gains()
10491 if (bbr->rc_tp->snd_cwnd > bbr->r_ctl.rc_target_at_state) { in bbr_set_probebw_gains()
10492 bbr->rc_tp->snd_cwnd = bbr->r_ctl.rc_target_at_state; in bbr_set_probebw_gains()
10497 bbr->r_ctl.r_app_limited_until = (bbr->r_ctl.rc_delivered + flight); in bbr_set_probebw_gains()
10500 if (TSTMP_GT(cts, bbr->r_ctl.gain_epoch) && in bbr_set_probebw_gains()
10501 (((cts - bbr->r_ctl.gain_epoch) > bbr_get_rtt(bbr, BBR_RTT_PROP)) || in bbr_set_probebw_gains()
10502 (flight >= bbr->r_ctl.flightsize_at_drain))) { in bbr_set_probebw_gains()
10510 bbr->r_ctl.flightsize_at_drain = flight; in bbr_set_probebw_gains()
10515 bbr->r_ctl.rc_bbr_hptsi_gain *= bbr_drain_drop_mul; in bbr_set_probebw_gains()
10516 bbr->r_ctl.rc_bbr_hptsi_gain /= bbr_drain_drop_div; in bbr_set_probebw_gains()
10519 bbr->r_ctl.rc_bbr_hptsi_gain *= 4; in bbr_set_probebw_gains()
10520 bbr->r_ctl.rc_bbr_hptsi_gain /= 5; in bbr_set_probebw_gains()
10522 if (bbr->r_ctl.rc_bbr_hptsi_gain <= bbr_drain_floor) { in bbr_set_probebw_gains()
10524 bbr->r_ctl.rc_bbr_hptsi_gain = max(bbr_drain_floor, 1); in bbr_set_probebw_gains()
10531 bbr->r_ctl.gain_epoch = cts; in bbr_set_probebw_gains()
10533 if (flight <= bbr->r_ctl.rc_target_at_state) { in bbr_set_probebw_gains()
10536 (bbr->rc_tp->snd_cwnd < bbr->r_ctl.rc_saved_cwnd)) { in bbr_set_probebw_gains()
10537 bbr->rc_tp->snd_cwnd = bbr->r_ctl.rc_saved_cwnd; in bbr_set_probebw_gains()
10540 bbr->r_ctl.rc_bbr_state_atflight = max(cts, 1); in bbr_set_probebw_gains()
10545 if (bbr->r_ctl.rc_lost > bbr->r_ctl.bbr_lost_at_state) { in bbr_set_probebw_gains()
10546 bbr->r_ctl.rc_bbr_state_atflight = max(cts, 1); in bbr_set_probebw_gains()
10549 if ((ctf_outstanding(bbr->rc_tp) >= bbr->r_ctl.rc_target_at_state) || in bbr_set_probebw_gains()
10552 bbr->r_ctl.rc_bbr_state_atflight = max(cts, 1); in bbr_set_probebw_gains()
10568 if (TSTMP_LT(cts, bbr->r_ctl.rc_bbr_state_time)) in bbr_set_probebw_gains()
10570 if ((cts - bbr->r_ctl.rc_bbr_state_time) < bbr_cur_cycle_time) { in bbr_set_probebw_gains()
10574 if (bbr->r_ctl.rc_level_state_extra && in bbr_set_probebw_gains()
10576 ((cts - bbr->r_ctl.rc_bbr_state_time) < in bbr_set_probebw_gains()
10577 (bbr_cur_cycle_time + bbr->r_ctl.rc_level_state_extra))) { in bbr_set_probebw_gains()
10582 bbr->r_ctl.rc_level_state_extra && in bbr_set_probebw_gains()
10584 ((cts - bbr->r_ctl.rc_bbr_state_time) < in bbr_set_probebw_gains()
10585 (bbr_cur_cycle_time + bbr->r_ctl.rc_level_state_extra))) { in bbr_set_probebw_gains()
10602 bbr->r_ctl.rc_pace_max_segs); in bbr_get_a_state_target()
10619 ((bbr->r_ctl.bbr_rttprobe_gain_val == 0) || bbr->rc_use_google)) { in bbr_set_state_target()
10626 (bbr->r_ctl.rc_bbr_hptsi_gain > BBR_UNIT)) { in bbr_set_state_target()
10628 tar = bbr_get_a_state_target(bbr, bbr->r_ctl.rc_bbr_hptsi_gain); in bbr_set_state_target()
10643 if (bbr->r_ctl.rc_bbr_hptsi_gain < bbr_hptsi_gain[BBR_SUB_DRAIN]) { in bbr_set_state_target()
10647 tar = bbr_get_a_state_target(bbr, bbr->r_ctl.rc_bbr_hptsi_gain); in bbr_set_state_target()
10653 bbr->r_ctl.rc_target_at_state = tar; in bbr_set_state_target()
10662 bbr->r_ctl.bbr_lost_at_state = bbr->r_ctl.rc_lost; in bbr_enter_probe_rtt()
10663 bbr->r_ctl.flightsize_at_drain = ctf_flight_size(bbr->rc_tp, in bbr_enter_probe_rtt()
10664 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_enter_probe_rtt()
10665 bbr->r_ctl.r_app_limited_until = (bbr->r_ctl.flightsize_at_drain in bbr_enter_probe_rtt()
10666 + bbr->r_ctl.rc_delivered); in bbr_enter_probe_rtt()
10670 if (SEQ_GT(cts, bbr->r_ctl.rc_bbr_state_time)) { in bbr_enter_probe_rtt()
10671 time_in = cts - bbr->r_ctl.rc_bbr_state_time; in bbr_enter_probe_rtt()
10675 bbr->r_ctl.rc_rtt_shrinks = cts; in bbr_enter_probe_rtt()
10676 bbr->r_ctl.last_in_probertt = cts; in bbr_enter_probe_rtt()
10677 bbr->r_ctl.rc_probertt_srttchktim = cts; in bbr_enter_probe_rtt()
10678 bbr->r_ctl.rc_bbr_state_time = cts; in bbr_enter_probe_rtt()
10686 if (bbr->rc_tp->snd_cwnd > bbr->r_ctl.rc_saved_cwnd) in bbr_enter_probe_rtt()
10687 bbr->r_ctl.rc_saved_cwnd = bbr->rc_tp->snd_cwnd; in bbr_enter_probe_rtt()
10689 bbr->r_ctl.rc_saved_cwnd = bbr->rc_tp->snd_cwnd; in bbr_enter_probe_rtt()
10691 bbr->r_ctl.rc_lost_at_startup = bbr->r_ctl.rc_lost; in bbr_enter_probe_rtt()
10692 if ((bbr->r_ctl.bbr_rttprobe_gain_val == 0) || bbr->rc_use_google){ in bbr_enter_probe_rtt()
10696 bbr->r_ctl.rc_bbr_hptsi_gain = BBR_UNIT; in bbr_enter_probe_rtt()
10697 bbr->r_ctl.rc_bbr_cwnd_gain = BBR_UNIT; in bbr_enter_probe_rtt()
10699 bbr->r_ctl.rc_target_at_state = bbr->rc_tp->snd_cwnd; in bbr_enter_probe_rtt()
10706 bbr->r_ctl.rc_bbr_hptsi_gain = bbr->r_ctl.bbr_rttprobe_gain_val; in bbr_enter_probe_rtt()
10707 bbr->r_ctl.rc_bbr_cwnd_gain = BBR_UNIT; in bbr_enter_probe_rtt()
10710 (bbr->rc_tp->snd_cwnd > bbr->r_ctl.rc_target_at_state)) { in bbr_enter_probe_rtt()
10711 bbr->rc_tp->snd_cwnd = bbr->r_ctl.rc_target_at_state; in bbr_enter_probe_rtt()
10716 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)) <= in bbr_enter_probe_rtt()
10717 bbr->r_ctl.rc_target_at_state) { in bbr_enter_probe_rtt()
10719 bbr->r_ctl.rc_bbr_enters_probertt = cts; in bbr_enter_probe_rtt()
10722 bbr->r_ctl.rc_bbr_enters_probertt = 0; in bbr_enter_probe_rtt()
10724 bbr->r_ctl.rc_pe_of_prtt = bbr->r_ctl.rc_pkt_epoch; in bbr_enter_probe_rtt()
10761 if (cur_rttp > bbr->r_ctl.rc_probertt_int) { in bbr_check_probe_rtt_limits()
10762 bbr->r_ctl.rc_probertt_int = cur_rttp; in bbr_check_probe_rtt_limits()
10763 reset_time_small(&bbr->r_ctl.rc_rttprop, newval); in bbr_check_probe_rtt_limits()
10770 if (bbr->r_ctl.rc_probertt_int > bbr_rtt_probe_limit) { in bbr_check_probe_rtt_limits()
10776 bbr->r_ctl.rc_probertt_int = bbr_rtt_probe_limit; in bbr_check_probe_rtt_limits()
10777 reset_time_small(&bbr->r_ctl.rc_rttprop, in bbr_check_probe_rtt_limits()
10786 if (cur_rttp < bbr->r_ctl.rc_probertt_int) { in bbr_check_probe_rtt_limits()
10788 bbr->r_ctl.rc_probertt_int = cur_rttp; in bbr_check_probe_rtt_limits()
10789 reset_time_small(&bbr->r_ctl.rc_rttprop, newval); in bbr_check_probe_rtt_limits()
10805 if (tp->snd_cwnd < bbr->r_ctl.rc_saved_cwnd) { in bbr_exit_probe_rtt()
10806 tp->snd_cwnd = bbr->r_ctl.rc_saved_cwnd; in bbr_exit_probe_rtt()
10811 bbr->r_ctl.rc_rtt_shrinks = cts; in bbr_exit_probe_rtt()
10812 bbr->r_ctl.last_in_probertt = cts; in bbr_exit_probe_rtt()
10814 bbr->r_ctl.bbr_lost_at_state = bbr->r_ctl.rc_lost; in bbr_exit_probe_rtt()
10815 bbr->r_ctl.r_app_limited_until = (ctf_flight_size(tp, in bbr_exit_probe_rtt()
10816 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)) + in bbr_exit_probe_rtt()
10817 bbr->r_ctl.rc_delivered); in bbr_exit_probe_rtt()
10818 if (SEQ_GT(cts, bbr->r_ctl.rc_bbr_state_time)) { in bbr_exit_probe_rtt()
10821 time_in = cts - bbr->r_ctl.rc_bbr_state_time; in bbr_exit_probe_rtt()
10828 bbr->r_ctl.rc_bbr_cwnd_gain = bbr_cwnd_gain; in bbr_exit_probe_rtt()
10834 bbr->r_ctl.rc_bbr_state_time = cts; in bbr_exit_probe_rtt()
10842 bbr->r_ctl.rc_bbr_last_startup_epoch += (bbr->r_ctl.rc_pkt_epoch - bbr->r_ctl.rc_pe_of_prtt); in bbr_exit_probe_rtt()
10843 bbr->r_ctl.rc_lost_at_startup = bbr->r_ctl.rc_lost; in bbr_exit_probe_rtt()
10845 if (bbr->r_ctl.rc_lost && in bbr_exit_probe_rtt()
10848 bbr->r_ctl.rc_bbr_hptsi_gain = bbr_startup_lower; in bbr_exit_probe_rtt()
10850 bbr->r_ctl.rc_bbr_hptsi_gain = bbr->r_ctl.rc_startup_pg; in bbr_exit_probe_rtt()
10851 bbr->r_ctl.rc_bbr_cwnd_gain = bbr->r_ctl.rc_startup_pg; in bbr_exit_probe_rtt()
10855 bbr_log_startup_event(bbr, cts, bbr->r_ctl.rc_bbr_last_startup_epoch, in bbr_exit_probe_rtt()
10856 bbr->r_ctl.rc_lost_at_startup, bbr_start_exit, 0); in bbr_exit_probe_rtt()
10866 (bbr_calc_time(cts, bbr->r_ctl.rc_rtt_shrinks) >= bbr->r_ctl.rc_probertt_int)) { in bbr_should_enter_probe_rtt()
10871 (TSTMP_GT(cts, bbr->r_ctl.last_in_probertt)) && in bbr_should_enter_probe_rtt()
10872 ((cts - bbr->r_ctl.last_in_probertt) > bbr->r_ctl.rc_probertt_int)) { in bbr_should_enter_probe_rtt()
10889 gain = ((bbr->r_ctl.rc_bbr_lastbtlbw * in bbr_google_startup()
10890 (uint64_t)bbr_start_exit) / (uint64_t)100) + bbr->r_ctl.rc_bbr_lastbtlbw; in bbr_google_startup()
10892 bbr->r_ctl.rc_bbr_last_startup_epoch = bbr->r_ctl.rc_pkt_epoch; in bbr_google_startup()
10893 bbr_log_startup_event(bbr, cts, bbr->r_ctl.rc_bbr_last_startup_epoch, in bbr_google_startup()
10894 bbr->r_ctl.rc_lost_at_startup, bbr_start_exit, 3); in bbr_google_startup()
10895 bbr->r_ctl.rc_bbr_lastbtlbw = btlbw; in bbr_google_startup()
10897 if ((bbr->r_ctl.rc_pkt_epoch - bbr->r_ctl.rc_bbr_last_startup_epoch) >= BBR_STARTUP_EPOCHS) in bbr_google_startup()
10899 bbr_log_startup_event(bbr, cts, bbr->r_ctl.rc_bbr_last_startup_epoch, in bbr_google_startup()
10900 bbr->r_ctl.rc_lost_at_startup, bbr_start_exit, 8); in bbr_google_startup()
10913 (bbr_calc_time(cts, bbr->r_ctl.rc_went_idle_time) >= bbr_rtt_probe_time)) { in bbr_state_startup()
10929 if ((bbr->r_ctl.rc_lost > bbr->r_ctl.rc_lost_at_startup) && in bbr_state_startup()
10932 bbr->r_ctl.rc_bbr_hptsi_gain = bbr_startup_lower; in bbr_state_startup()
10946 if (bbr->r_ctl.rc_pkt_epoch_rtt && in bbr_state_startup()
10947 bbr->r_ctl.startup_last_srtt && in bbr_state_startup()
10948 (bbr->r_ctl.rc_pkt_epoch_rtt > bbr->r_ctl.startup_last_srtt)) { in bbr_state_startup()
10949 delta = bbr->r_ctl.rc_pkt_epoch_rtt - bbr->r_ctl.startup_last_srtt; in bbr_state_startup()
10950 rtt_gain = (delta * 100) / bbr->r_ctl.startup_last_srtt; in bbr_state_startup()
10953 if ((bbr->r_ctl.startup_last_srtt == 0) || in bbr_state_startup()
10954 (bbr->r_ctl.rc_pkt_epoch_rtt < bbr->r_ctl.startup_last_srtt)) in bbr_state_startup()
10956 bbr->r_ctl.startup_last_srtt = bbr->r_ctl.rc_pkt_epoch_rtt; in bbr_state_startup()
10958 if ((bbr->r_ctl.rc_lost == 0) && in bbr_state_startup()
10965 if (bbr->r_ctl.rc_bbr_last_startup_epoch < bbr->r_ctl.rc_pkt_epoch) in bbr_state_startup()
10966 bbr->r_ctl.rc_bbr_last_startup_epoch++; in bbr_state_startup()
10968 delta, bbr->r_ctl.startup_last_srtt, 10); in bbr_state_startup()
10972 if ((bbr->r_ctl.r_measurement_count == bbr->r_ctl.last_startup_measure) && in bbr_state_startup()
10973 (bbr->r_ctl.rc_lost_at_startup == bbr->r_ctl.rc_lost) && in bbr_state_startup()
10981 if (bbr->r_ctl.rc_bbr_last_startup_epoch < bbr->r_ctl.rc_pkt_epoch) in bbr_state_startup()
10982 bbr->r_ctl.rc_bbr_last_startup_epoch++; in bbr_state_startup()
10983 bbr_log_startup_event(bbr, cts, bbr->r_ctl.rc_bbr_last_startup_epoch, in bbr_state_startup()
10984 bbr->r_ctl.rc_lost_at_startup, bbr_start_exit, 9); in bbr_state_startup()
10988 if (bbr->r_ctl.rc_lost_at_startup > bbr->r_ctl.rc_lost) in bbr_state_startup()
10989 bbr->r_ctl.rc_lost_at_startup = bbr->r_ctl.rc_lost; in bbr_state_startup()
10990 bbr->r_ctl.last_startup_measure = bbr->r_ctl.r_measurement_count; in bbr_state_startup()
10992 if (bbr->r_ctl.rc_bbr_hptsi_gain == bbr_startup_lower) in bbr_state_startup()
10993 gain = ((bbr->r_ctl.rc_bbr_lastbtlbw * in bbr_state_startup()
10994 (uint64_t)bbr_low_start_exit) / (uint64_t)100) + bbr->r_ctl.rc_bbr_lastbtlbw; in bbr_state_startup()
10996 gain = ((bbr->r_ctl.rc_bbr_lastbtlbw * in bbr_state_startup()
10997 (uint64_t)bbr_start_exit) / (uint64_t)100) + bbr->r_ctl.rc_bbr_lastbtlbw; in bbr_state_startup()
10999 if (btlbw > bbr->r_ctl.rc_bbr_lastbtlbw) in bbr_state_startup()
11000 bbr->r_ctl.rc_bbr_lastbtlbw = btlbw; in bbr_state_startup()
11002 bbr->r_ctl.rc_bbr_last_startup_epoch = bbr->r_ctl.rc_pkt_epoch; in bbr_state_startup()
11004 bbr->r_ctl.rc_lost_at_startup = bbr->r_ctl.rc_lost; in bbr_state_startup()
11005 bbr_log_startup_event(bbr, cts, bbr->r_ctl.rc_bbr_last_startup_epoch, in bbr_state_startup()
11006 bbr->r_ctl.rc_lost_at_startup, bbr_start_exit, 3); in bbr_state_startup()
11009 (bbr->r_ctl.rc_lost > bbr->r_ctl.rc_lost_at_startup) && in bbr_state_startup()
11010 (bbr->r_ctl.rc_pkt_epoch_loss_rate > bbr_startup_loss_thresh)) && in bbr_state_startup()
11011 ((bbr->r_ctl.rc_pkt_epoch - bbr->r_ctl.rc_bbr_last_startup_epoch) >= BBR_STARTUP_EPOCHS)) { in bbr_state_startup()
11020 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)) + in bbr_state_startup()
11021 (2 * max(bbr->r_ctl.rc_pace_max_segs, bbr->rc_tp->t_maxseg))) <= bbr->rc_tp->snd_wnd) { in bbr_state_startup()
11023 bbr_log_startup_event(bbr, cts, bbr->r_ctl.rc_bbr_last_startup_epoch, in bbr_state_startup()
11024 bbr->r_ctl.rc_lost_at_startup, bbr_start_exit, 4); in bbr_state_startup()
11027 bbr->r_ctl.rc_lost_at_startup = bbr->r_ctl.rc_lost; in bbr_state_startup()
11028 bbr_log_startup_event(bbr, cts, bbr->r_ctl.rc_bbr_last_startup_epoch, in bbr_state_startup()
11029 bbr->r_ctl.rc_lost_at_startup, bbr_start_exit, 5); in bbr_state_startup()
11032 bbr->r_ctl.rc_lost_at_startup = bbr->r_ctl.rc_lost; in bbr_state_startup()
11033 if (((bbr->r_ctl.rc_pkt_epoch - bbr->r_ctl.rc_bbr_last_startup_epoch) >= BBR_STARTUP_EPOCHS) || in bbr_state_startup()
11039 bbr_log_startup_event(bbr, cts, bbr->r_ctl.rc_bbr_last_startup_epoch, in bbr_state_startup()
11040 bbr->r_ctl.rc_lost_at_startup, bbr_start_exit, 8); in bbr_state_startup()
11065 bbr_log_startup_event(bbr, cts, bbr->r_ctl.rc_bbr_last_startup_epoch, in bbr_state_change()
11066 bbr->r_ctl.rc_lost_at_startup, bbr_start_exit, 6); in bbr_state_change()
11068 bbr->r_ctl.bbr_lost_at_state = bbr->r_ctl.rc_lost; in bbr_state_change()
11069 if (SEQ_GT(cts, bbr->r_ctl.rc_bbr_state_time)) { in bbr_state_change()
11070 time_in = cts - bbr->r_ctl.rc_bbr_state_time; in bbr_state_change()
11076 bbr->r_ctl.rc_bbr_state_time = cts; in bbr_state_change()
11077 bbr->r_ctl.rc_bbr_hptsi_gain = bbr->r_ctl.rc_drain_pg; in bbr_state_change()
11083 bbr->r_ctl.rc_saved_cwnd = bbr->rc_tp->snd_cwnd; in bbr_state_change()
11084 bbr->rc_tp->snd_cwnd = bbr->r_ctl.rc_target_at_state; in bbr_state_change()
11087 bbr->r_ctl.rc_bbr_cwnd_gain = bbr_high_gain; in bbr_state_change()
11090 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)) <= in bbr_state_change()
11091 bbr->r_ctl.rc_target_at_state) { in bbr_state_change()
11108 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_state_change()
11109 if (inflight >= bbr->r_ctl.rc_target_at_state) { in bbr_state_change()
11112 bbr->r_ctl.rc_bbr_hptsi_gain = BBR_UNIT; in bbr_state_change()
11113 bbr->r_ctl.rc_bbr_cwnd_gain = BBR_UNIT; in bbr_state_change()
11119 bbr->r_ctl.bbr_smallest_srtt_this_state = 0xffffffff; in bbr_state_change()
11130 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_state_change()
11133 (bbr->rc_tp->snd_cwnd > bbr->r_ctl.rc_target_at_state)) { in bbr_state_change()
11138 bbr->rc_tp->snd_cwnd = bbr->r_ctl.rc_target_at_state; in bbr_state_change()
11141 if (inflight <= bbr->r_ctl.rc_target_at_state) { in bbr_state_change()
11144 bbr->r_ctl.bbr_lost_at_state = bbr->r_ctl.rc_lost; in bbr_state_change()
11145 if (SEQ_GT(cts, bbr->r_ctl.rc_bbr_state_time)) { in bbr_state_change()
11148 time_in = cts - bbr->r_ctl.rc_bbr_state_time; in bbr_state_change()
11153 (tp->snd_cwnd < bbr->r_ctl.rc_saved_cwnd)) { in bbr_state_change()
11155 tp->snd_cwnd = bbr->r_ctl.rc_saved_cwnd; in bbr_state_change()
11159 bbr->r_ctl.rc_rtt_shrinks = cts; in bbr_state_change()
11160 bbr->r_ctl.last_in_probertt = cts; in bbr_state_change()
11171 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_state_change()
11172 bbr->r_ctl.r_app_limited_until = (flight + bbr->r_ctl.rc_delivered); in bbr_state_change()
11173 if (((bbr->r_ctl.bbr_rttprobe_gain_val == 0) || bbr->rc_use_google) && in bbr_state_change()
11174 (bbr->rc_tp->snd_cwnd > bbr->r_ctl.rc_target_at_state)) { in bbr_state_change()
11181 (bbr->rc_tp->snd_cwnd > bbr->r_ctl.rc_target_at_state)) { in bbr_state_change()
11183 bbr->rc_tp->snd_cwnd = bbr->r_ctl.rc_target_at_state; in bbr_state_change()
11186 if (bbr->r_ctl.rc_bbr_enters_probertt == 0) { in bbr_state_change()
11188 if (flight <= bbr->r_ctl.rc_target_at_state) { in bbr_state_change()
11190 bbr->r_ctl.rc_bbr_enters_probertt = cts; in bbr_state_change()
11192 if (bbr->r_ctl.rc_bbr_enters_probertt == 0) in bbr_state_change()
11193 bbr->r_ctl.rc_bbr_enters_probertt = 1; in bbr_state_change()
11199 if (bbr->r_ctl.bbr_rttprobe_gain_val) in bbr_state_change()
11200 bbr->r_ctl.rc_bbr_hptsi_gain = bbr->r_ctl.bbr_rttprobe_gain_val; in bbr_state_change()
11202 bbr->r_ctl.rc_bbr_hptsi_gain = BBR_UNIT; in bbr_state_change()
11205 if ((bbr->r_ctl.rc_bbr_enters_probertt == 0) && in bbr_state_change()
11207 bbr->r_ctl.bbr_rttprobe_gain_val && in bbr_state_change()
11208 (((cts - bbr->r_ctl.rc_probertt_srttchktim) > bbr_get_rtt(bbr, bbr_drain_rtt)) || in bbr_state_change()
11209 (flight >= bbr->r_ctl.flightsize_at_drain))) { in bbr_state_change()
11220 bbr->r_ctl.flightsize_at_drain = flight; in bbr_state_change()
11221 bbr->r_ctl.rc_probertt_srttchktim = cts; in bbr_state_change()
11222 red = max((bbr->r_ctl.bbr_rttprobe_gain_val / 10), 1); in bbr_state_change()
11223 if ((bbr->r_ctl.rc_bbr_hptsi_gain - red) > max(bbr_drain_floor, 1)) { in bbr_state_change()
11225 bbr->r_ctl.rc_bbr_hptsi_gain -= red; in bbr_state_change()
11227 } else if (bbr->r_ctl.rc_bbr_hptsi_gain > max(bbr_drain_floor, 1)) { in bbr_state_change()
11229 bbr->r_ctl.rc_bbr_hptsi_gain = max(bbr_drain_floor, 1); in bbr_state_change()
11233 bbr->r_ctl.rc_bbr_hptsi_gain = max((bbr_drain_floor-1), 1); in bbr_state_change()
11237 if (bbr->r_ctl.rc_bbr_enters_probertt && in bbr_state_change()
11238 (TSTMP_GT(cts, bbr->r_ctl.rc_bbr_enters_probertt)) && in bbr_state_change()
11239 ((cts - bbr->r_ctl.rc_bbr_enters_probertt) >= bbr_rtt_probe_time)) { in bbr_state_change()
11245 (bbr_calc_time(cts, bbr->r_ctl.rc_went_idle_time) >= bbr_rtt_probe_time)) { in bbr_state_change()
11267 if ((cts - bbr->r_ctl.rc_rcv_epoch_start) >= bbr_get_rtt(bbr, BBR_RTT_PROP)) { in bbr_check_bbr_for_state()
11330 bbr->r_ctl.rc_rcvtime = cts = tcp_tv_to_usectick(&bbr->rc_tv); in bbr_do_segment_nounlock()
11338 bbr->r_ctl.rc_rcvtime = cts = tcp_tv_to_usectick(&bbr->rc_tv); in bbr_do_segment_nounlock()
11343 bbr->r_ctl.rc_rcvtime = lcts = cts = tcp_get_usecs(&bbr->rc_tv); in bbr_do_segment_nounlock()
11458 sack_filter_clear(&bbr->r_ctl.bbr_sf, th->th_ack); in bbr_do_segment_nounlock()
11477 if (SEQ_GT(th->th_ack, tp->snd_una) && (rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map)) != NULL) in bbr_do_segment_nounlock()
11481 lost = bbr->r_ctl.rc_lost; in bbr_do_segment_nounlock()
11487 bbr->r_ctl.rc_ack_hdwr_delay = lcts - cts; in bbr_do_segment_nounlock()
11489 if (TSTMP_GT(bbr->r_ctl.rc_ack_hdwr_delay, in bbr_do_segment_nounlock()
11490 bbr->r_ctl.highest_hdwr_delay)) in bbr_do_segment_nounlock()
11491 bbr->r_ctl.highest_hdwr_delay = bbr->r_ctl.rc_ack_hdwr_delay; in bbr_do_segment_nounlock()
11493 bbr->r_ctl.rc_ack_hdwr_delay = 0; in bbr_do_segment_nounlock()
11497 bbr->r_ctl.rc_ack_hdwr_delay = 0; in bbr_do_segment_nounlock()
11516 if (tiwin > bbr->r_ctl.rc_high_rwnd) in bbr_do_segment_nounlock()
11517 bbr->r_ctl.rc_high_rwnd = tiwin; in bbr_do_segment_nounlock()
11518 bbr->r_ctl.rc_flight_at_input = ctf_flight_size(tp, in bbr_do_segment_nounlock()
11519 (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_do_segment_nounlock()
11523 bbr->r_ctl.last_inbound_ts = to.to_tsval; in bbr_do_segment_nounlock()
11526 bbr->r_ctl.last_inbound_ts = 0; in bbr_do_segment_nounlock()
11544 bbr_check_bbr_for_state(bbr, cts, __LINE__, (bbr->r_ctl.rc_lost - lost)); in bbr_do_segment_nounlock()
11557 ((bbr->r_ctl.rc_hpts_flags & PACE_TMR_MASK) == 0) && in bbr_do_segment_nounlock()
11569 (bbr->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT)) { in bbr_do_segment_nounlock()
11578 if ((bbr->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT) && in bbr_do_segment_nounlock()
11583 if (bbr->r_ctl.rc_last_delay_val > del) { in bbr_do_segment_nounlock()
11585 bbr->r_ctl.rc_last_delay_val -= del; in bbr_do_segment_nounlock()
11589 bbr->r_ctl.rc_last_delay_val = 0; in bbr_do_segment_nounlock()
11596 bbr_start_hpts_timer(bbr, tp, cts, 8, bbr->r_ctl.rc_last_delay_val, in bbr_do_segment_nounlock()
11661 flight = ctf_flight_size(tp, (bbr->r_ctl.rc_sacked + bbr->r_ctl.rc_lost_bytes)); in bbr_what_can_we_send()
11889 pace_max_segs = bbr->r_ctl.rc_pace_max_segs; in bbr_output_wtime()
11905 if (((bbr->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT) == 0) && in bbr_output_wtime()
11938 if (bbr->r_ctl.rc_last_delay_val) { in bbr_output_wtime()
11942 if (delay_calc >= bbr->r_ctl.rc_last_delay_val) in bbr_output_wtime()
11943 delay_calc -= bbr->r_ctl.rc_last_delay_val; in bbr_output_wtime()
11954 if ((bbr->r_ctl.rc_last_delay_val) && in bbr_output_wtime()
11955 (bbr->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT) && in bbr_output_wtime()
11964 bbr->r_ctl.rc_last_delay_val = 0; in bbr_output_wtime()
11967 bbr->r_ctl.rc_last_delay_val = 0; in bbr_output_wtime()
11980 if (bbr->r_ctl.rc_last_delay_val) { in bbr_output_wtime()
11986 if (delay_calc >= bbr->r_ctl.rc_last_delay_val) in bbr_output_wtime()
11988 delay_calc -= bbr->r_ctl.rc_last_delay_val; in bbr_output_wtime()
11996 bbr->r_ctl.rc_agg_early += (bbr->r_ctl.rc_last_delay_val - delay_calc); in bbr_output_wtime()
11998 if (bbr->r_ctl.rc_hptsi_agg_delay) { in bbr_output_wtime()
11999 if (bbr->r_ctl.rc_hptsi_agg_delay >= bbr->r_ctl.rc_agg_early) { in bbr_output_wtime()
12001 bbr->r_ctl.rc_hptsi_agg_delay -= bbr->r_ctl.rc_agg_early; in bbr_output_wtime()
12003 bbr->r_ctl.rc_agg_early = 0; in bbr_output_wtime()
12005 bbr->r_ctl.rc_agg_early -= bbr->r_ctl.rc_hptsi_agg_delay; in bbr_output_wtime()
12006 bbr->r_ctl.rc_hptsi_agg_delay = 0; in bbr_output_wtime()
12011 merged_val |= bbr->r_ctl.rc_last_delay_val; in bbr_output_wtime()
12013 bbr->r_ctl.rc_agg_early, cts, delay_calc, merged_val, in bbr_output_wtime()
12015 bbr->r_ctl.rc_last_delay_val = 0; in bbr_output_wtime()
12022 bbr->r_ctl.rc_agg_early = 0; in bbr_output_wtime()
12032 if ((bbr->r_ctl.rc_hptsi_agg_delay + delay_calc) < bbr->r_ctl.rc_hptsi_agg_delay) in bbr_output_wtime()
12033 bbr->r_ctl.rc_hptsi_agg_delay = 0xffffffff; in bbr_output_wtime()
12035 bbr->r_ctl.rc_hptsi_agg_delay += delay_calc; in bbr_output_wtime()
12047 cts, bbr_calc_time(cts, bbr->r_ctl.rc_went_idle_time)); in bbr_output_wtime()
12055 if (bbr->r_ctl.rc_hpts_flags & PACE_TMR_MASK) { in bbr_output_wtime()
12070 (bbr->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT)) { in bbr_output_wtime()
12071 bbr->r_ctl.rc_last_delay_val = 0; in bbr_output_wtime()
12122 while (bbr->r_ctl.rc_free_cnt < bbr_min_req_free) { in bbr_output_wtime()
12134 TAILQ_INSERT_TAIL(&bbr->r_ctl.rc_free, rsm, r_next); in bbr_output_wtime()
12135 bbr->r_ctl.rc_free_cnt++; in bbr_output_wtime()
12139 if (bbr->r_ctl.rc_resend == NULL) { in bbr_output_wtime()
12141 bbr->r_ctl.rc_resend = bbr_check_recovery_mode(tp, bbr, cts); in bbr_output_wtime()
12142 if (bbr->r_ctl.rc_resend) { in bbr_output_wtime()
12146 bbr_cong_signal(tp, NULL, CC_NDUPACK, bbr->r_ctl.rc_resend); in bbr_output_wtime()
12149 if (bbr->r_ctl.rc_resend) { in bbr_output_wtime()
12150 rsm = bbr->r_ctl.rc_resend; in bbr_output_wtime()
12156 bbr->r_ctl.rc_resend = NULL; in bbr_output_wtime()
12207 } else if (bbr->r_ctl.rc_tlp_send) { in bbr_output_wtime()
12212 rsm = bbr->r_ctl.rc_tlp_send; in bbr_output_wtime()
12213 bbr->r_ctl.rc_tlp_send = NULL; in bbr_output_wtime()
12238 (bbr->r_ctl.rc_num_maps_alloced >= V_tcp_map_entries_limit)) { in bbr_output_wtime()
12279 end_rsm = TAILQ_LAST_FAST(&bbr->r_ctl.rc_tmap, bbr_sendmap, r_tnext); in bbr_output_wtime()
12348 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_output_wtime()
12470 (len < bbr->r_ctl.rc_pace_max_segs)) { in bbr_output_wtime()
12476 if ((tp->snd_wnd < min((bbr->r_ctl.rc_high_rwnd/2), bbr_minseg(bbr))) && in bbr_output_wtime()
12489 } else if ((tp->snd_cwnd >= bbr->r_ctl.rc_pace_max_segs) && in bbr_output_wtime()
12490 (ctf_flight_size(tp, (bbr->r_ctl.rc_sacked + in bbr_output_wtime()
12491 bbr->r_ctl.rc_lost_bytes)) > (2 * maxseg)) && in bbr_output_wtime()
12507 min((bbr->r_ctl.rc_high_rwnd/2), bbr_minseg(bbr))) && in bbr_output_wtime()
12508 (ctf_flight_size(tp, (bbr->r_ctl.rc_sacked + in bbr_output_wtime()
12509 bbr->r_ctl.rc_lost_bytes)) > (2 * maxseg)) && in bbr_output_wtime()
12532 (len < min((bbr->r_ctl.rc_high_rwnd/2), bbr->r_ctl.rc_pace_max_segs))) { in bbr_output_wtime()
12543 if (sbleft >= min((bbr->r_ctl.rc_high_rwnd/2), bbr->r_ctl.rc_pace_max_segs)) { in bbr_output_wtime()
12704 slot = bbr_get_pacing_delay(bbr, bbr->r_ctl.rc_bbr_hptsi_gain, tot_len, cts, 0); in bbr_output_wtime()
12708 if ((ctf_outstanding(tp) + min((bbr->r_ctl.rc_high_rwnd/2), bbr_minseg(bbr))) >= in bbr_output_wtime()
12718 bbr_enter_persist(tp, bbr, bbr->r_ctl.rc_rcvtime, __LINE__); in bbr_output_wtime()
12724 } else if ((ctf_flight_size(tp, (bbr->r_ctl.rc_sacked + in bbr_output_wtime()
12725 bbr->r_ctl.rc_lost_bytes)) + p_maxseg) >= tp->snd_cwnd) { in bbr_output_wtime()
12728 bbr_cwnd_limiting(tp, bbr, ctf_flight_size(tp, (bbr->r_ctl.rc_sacked + in bbr_output_wtime()
12729 bbr->r_ctl.rc_lost_bytes))); in bbr_output_wtime()
12736 bbr->r_ctl.rc_hptsi_agg_delay = 0; in bbr_output_wtime()
12738 bbr->r_ctl.rc_agg_early = 0; in bbr_output_wtime()
12739 bbr->r_ctl.rc_last_delay_val = 0; in bbr_output_wtime()
12748 bbr->r_ctl.r_app_limited_until = (ctf_flight_size(tp, (bbr->r_ctl.rc_sacked + in bbr_output_wtime()
12749 bbr->r_ctl.rc_lost_bytes)) + bbr->r_ctl.rc_delivered); in bbr_output_wtime()
12754 bbr->r_ctl.rc_last_delay_val = 0; in bbr_output_wtime()
12812 (bbr_calc_time(cts, bbr->r_ctl.rc_went_idle_time) >= bbr_rtt_probe_time)) { in bbr_output_wtime()
13117 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map); in bbr_output_wtime()
13494 log.u_bbr.flex1 = bbr->r_ctl.rc_hptsi_agg_delay; in bbr_output_wtime()
13503 log.u_bbr.flex6 = bbr->r_ctl.rc_pace_max_segs; in bbr_output_wtime()
13638 bbr->r_ctl.rc_del_time = cts; in bbr_output_wtime()
13665 bbr->r_ctl.rc_tlp_rxt_last_time = cts; in bbr_output_wtime()
13749 bbr->r_ctl.rc_hptsi_agg_delay = 0; in bbr_output_wtime()
13750 bbr->r_ctl.rc_agg_early = 0; in bbr_output_wtime()
13767 tp->snd_cwnd = ctf_flight_size(tp, (bbr->r_ctl.rc_sacked + in bbr_output_wtime()
13768 bbr->r_ctl.rc_lost_bytes)) - maxseg; in bbr_output_wtime()
13825 bbr->r_ctl.rc_bbr_hptsi_gain, in bbr_output_wtime()
13872 (get_filter_value(&bbr->r_ctl.rc_delrate)) && in bbr_output_wtime()
13887 bbr->r_ctl.crte = tcp_set_pacing_rate(bbr->rc_tp, in bbr_output_wtime()
13892 if (bbr->r_ctl.crte) { in bbr_output_wtime()
13894 bbr->r_ctl.crte->ptbl->rs_ifp, in bbr_output_wtime()
13896 bbr->r_ctl.crte->rate, in bbr_output_wtime()
13903 if (bbr->r_ctl.crte->rate < rate_wanted) { in bbr_output_wtime()
13906 bbr->r_ctl.crte->rate, rate_wanted); in bbr_output_wtime()
13942 tcp_rel_pacing_rate(bbr->r_ctl.crte, bbr->rc_tp); in bbr_output_wtime()
13956 (bbr->r_ctl.rc_pace_max_segs > tp->t_maxseg) && in bbr_output_wtime()
13964 (tot_len < bbr->r_ctl.rc_pace_max_segs)) { in bbr_output_wtime()
13993 slot = bbr_get_pacing_delay(bbr, bbr->r_ctl.rc_bbr_hptsi_gain, tot_len, cts, 0); in bbr_output_wtime()
14001 bbr_cwnd_limiting(tp, bbr, ctf_flight_size(tp, (bbr->r_ctl.rc_sacked + in bbr_output_wtime()
14002 bbr->r_ctl.rc_lost_bytes))); in bbr_output_wtime()
14006 ((bbr->r_ctl.rc_resend = bbr_check_recovery_mode(tp, bbr, cts)) != NULL))) { in bbr_output_wtime()
14017 bbr->r_ctl.bbr_hdwr_cnt_noset_snt++; in bbr_output_wtime()
14018 if (bbr->r_ctl.bbr_hdwr_cnt_noset_snt >= bbr_hdwr_pacing_delay_cnt) { in bbr_output_wtime()
14063 sack_filter_clear(&bbr->r_ctl.bbr_sf, tp->snd_una); in bbr_mtu_chg()
14064 TAILQ_FOREACH(rsm, &bbr->r_ctl.rc_map, r_next) { in bbr_mtu_chg()
14075 bbr_is_lost(bbr, rsm, bbr->r_ctl.rc_rcvtime)) { in bbr_mtu_chg()
14076 bbr->r_ctl.rc_lost_bytes += rsm->r_end - rsm->r_start; in bbr_mtu_chg()
14077 bbr->r_ctl.rc_lost += rsm->r_end - rsm->r_start; in bbr_mtu_chg()
14085 bbr->r_ctl.rc_resend = frsm; in bbr_mtu_chg()
14125 if (bbr->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT) { in bbr_switch_failed()
14132 } else if (bbr->r_ctl.rc_hpts_flags & PACE_TMR_MASK) { in bbr_switch_failed()
14133 if (TSTMP_GT(bbr->r_ctl.rc_timer_exp, cts)) { in bbr_switch_failed()
14134 toval = bbr->r_ctl.rc_timer_exp - cts; in bbr_switch_failed()
14245 bbr->r_ctl.bbr_hptsi_per_second = optval; in bbr_set_sockopt()
14249 bbr->r_ctl.bbr_hptsi_segments_delay_tar = optval; in bbr_set_sockopt()
14253 bbr->r_ctl.bbr_hptsi_segments_max = optval; in bbr_set_sockopt()
14257 bbr->r_ctl.bbr_hptsi_bytes_min = optval; in bbr_set_sockopt()
14261 bbr->r_ctl.bbr_cross_over = optval; in bbr_set_sockopt()
14273 bbr->r_ctl.bbr_google_discount = optval; in bbr_set_sockopt()
14307 bbr->r_ctl.rc_startup_pg = optval; in bbr_set_sockopt()
14309 bbr->r_ctl.rc_bbr_hptsi_gain = optval; in bbr_set_sockopt()
14317 bbr->r_ctl.rc_drain_pg = optval; in bbr_set_sockopt()
14324 reset_time_small(&bbr->r_ctl.rc_rttprop, (optval * USECS_IN_SECOND)); in bbr_set_sockopt()
14331 bbr->r_ctl.bbr_rttprobe_gain_val = optval; in bbr_set_sockopt()
14338 bbr->r_ctl.rc_probertt_int = optval; in bbr_set_sockopt()
14349 if ((bbr->r_ctl.rc_pkt_epoch < bbr->no_pacing_until) && in bbr_set_sockopt()
14366 bbr->r_ctl.rc_min_rto_ms = optval; in bbr_set_sockopt()
14375 bbr->r_ctl.rc_min_to = optval; in bbr_set_sockopt()
14381 bbr->r_ctl.rc_reorder_shift = optval; in bbr_set_sockopt()
14388 bbr->r_ctl.rc_reorder_fade = optval; in bbr_set_sockopt()
14413 bbr->r_ctl.bbr_hptsi_segments_floor = optval; in bbr_set_sockopt()
14420 bbr->r_ctl.bbr_utter_max = optval; in bbr_set_sockopt()
14452 if (bbr->r_ctl.crte != NULL) { in bbr_set_sockopt()
14453 tcp_rel_pacing_rate(bbr->r_ctl.crte, tp); in bbr_set_sockopt()
14454 bbr->r_ctl.crte = NULL; in bbr_set_sockopt()
14482 bbr->r_ctl.rc_pkt_delay = optval; in bbr_set_sockopt()
14522 bbr->r_ctl.rc_incr_tmrs = 1; in bbr_set_sockopt()
14524 bbr->r_ctl.rc_incr_tmrs = 0; in bbr_set_sockopt()
14539 bbr->r_ctl.rc_inc_tcp_oh = 1; in bbr_set_sockopt()
14541 bbr->r_ctl.rc_inc_tcp_oh = 0; in bbr_set_sockopt()
14543 bbr->r_ctl.rc_inc_ip_oh = 1; in bbr_set_sockopt()
14545 bbr->r_ctl.rc_inc_ip_oh = 0; in bbr_set_sockopt()
14547 bbr->r_ctl.rc_inc_enet_oh = 1; in bbr_set_sockopt()
14549 bbr->r_ctl.rc_inc_enet_oh = 0; in bbr_set_sockopt()
14585 optval = bbr->r_ctl.bbr_hptsi_per_second; in bbr_get_sockopt()
14588 optval = bbr->r_ctl.bbr_hptsi_segments_delay_tar; in bbr_get_sockopt()
14591 optval = bbr->r_ctl.bbr_hptsi_segments_max; in bbr_get_sockopt()
14597 optval = bbr->r_ctl.bbr_hptsi_bytes_min; in bbr_get_sockopt()
14600 optval = bbr->r_ctl.bbr_cross_over; in bbr_get_sockopt()
14612 optval = bbr->r_ctl.rc_startup_pg; in bbr_get_sockopt()
14615 optval = bbr->r_ctl.rc_drain_pg; in bbr_get_sockopt()
14618 optval = bbr->r_ctl.rc_probertt_int; in bbr_get_sockopt()
14621 optval = (bbr->r_ctl.rc_rttprop.cur_time_limit / USECS_IN_SECOND); in bbr_get_sockopt()
14624 optval = bbr->r_ctl.bbr_rttprobe_gain_val; in bbr_get_sockopt()
14630 loptval = get_filter_value(&bbr->r_ctl.rc_delrate); in bbr_get_sockopt()
14633 optval = bbr->r_ctl.rc_min_rto_ms; in bbr_get_sockopt()
14640 optval = bbr->r_ctl.rc_pace_max_segs; in bbr_get_sockopt()
14644 optval = bbr->r_ctl.rc_min_to; in bbr_get_sockopt()
14648 optval = bbr->r_ctl.rc_reorder_shift; in bbr_get_sockopt()
14652 optval = bbr->r_ctl.rc_reorder_fade; in bbr_get_sockopt()
14659 optval = bbr->r_ctl.bbr_hptsi_segments_floor; in bbr_get_sockopt()
14662 optval = bbr->r_ctl.bbr_utter_max; in bbr_get_sockopt()
14677 optval = bbr->r_ctl.rc_pkt_delay; in bbr_get_sockopt()
14698 optval = bbr->r_ctl.rc_incr_tmrs; in bbr_get_sockopt()
14702 if (bbr->r_ctl.rc_inc_tcp_oh) in bbr_get_sockopt()
14704 if (bbr->r_ctl.rc_inc_ip_oh) in bbr_get_sockopt()
14706 if (bbr->r_ctl.rc_inc_enet_oh) in bbr_get_sockopt()