Lines Matching +full:over +full:- +full:sampling
21 * +---> STARTUP ----+
24 * | DRAIN ----+
27 * +---> PROBE_BW ----+
30 * | +----+ |
32 * +---- PROBE_RTT <--+
37 * A long-lived BBR flow spends the vast majority of its time remaining
42 * it briefly enters PROBE_RTT to cut inflight to a minimum value to re-probe
43 * the path's two-way propagation delay (min_rtt). When exiting PROBE_RTT, if
48 * "BBR: Congestion-Based Congestion Control",
50 * Van Jacobson. ACM Queue, Vol. 14 No. 5, September-October 2016.
52 * There is a public e-mail list for discussing BBR development and testing:
53 * https://groups.google.com/forum/#!forum/bbr-dev
55 * NOTE: BBR might be used with the fq qdisc ("man tc-fq") with pacing enabled,
94 u32 rtt_cnt; /* count of packet-timed rounds elapsed */
95 u32 next_rtt_delivered; /* scb->tx.delivered at end of round */
100 round_start:1, /* start of packet-timed tx->ack round? */
104 lt_is_sampling:1, /* taking long-term ("LT") samples now? */
105 lt_rtt_cnt:7, /* round trips in long-term interval */
108 u32 lt_last_delivered; /* LT intvl start: tp->delivered */
109 u32 lt_last_stamp; /* LT intvl start: tp->delivered_mstamp */
110 u32 lt_last_lost; /* LT intvl start: tp->lost */
122 u64 ack_epoch_mstamp; /* start of ACK sampling epoch */
124 u32 ack_epoch_acked:20, /* packets (S)ACKed in sampling epoch */
151 * and send the same number of packets per RTT that an un-paced, slow-starting
159 /* The gain for deriving steady-state cwnd tolerates delayed/stretched ACKs: */
168 /* Randomize the starting gain cycling phase over N phases: */
183 /* "long-term" ("LT") bandwidth estimator parameters... */
184 /* The minimum number of rounds in an LT bw sampling interval: */
199 /* Max allowed val for ack_epoch_acked, after which sampling epoch is reset */
211 return bbr->full_bw_reached; in bbr_full_bw_reached()
219 return minmax_get(&bbr->bw); in bbr_max_bw()
227 return bbr->lt_use_bw ? bbr->lt_bw : bbr_max_bw(sk); in bbr_bw()
230 /* Return maximum extra acked in past k-2k round trips,
237 return max(bbr->extra_acked[0], bbr->extra_acked[1]); in bbr_extra_acked()
246 unsigned int mss = tcp_sk(sk)->mss_cache; in bbr_rate_bytes_per_sec()
251 rate *= USEC_PER_SEC / 100 * (100 - bbr_pacing_margin_percent); in bbr_rate_bytes_per_sec()
261 rate = min_t(u64, rate, READ_ONCE(sk->sk_max_pacing_rate)); in bbr_bw_to_pacing_rate()
273 if (tp->srtt_us) { /* any RTT sample yet? */ in bbr_init_pacing_rate_from_rtt()
274 rtt_us = max(tp->srtt_us >> 3, 1U); in bbr_init_pacing_rate_from_rtt()
275 bbr->has_seen_rtt = 1; in bbr_init_pacing_rate_from_rtt()
281 WRITE_ONCE(sk->sk_pacing_rate, in bbr_init_pacing_rate_from_rtt()
292 if (unlikely(!bbr->has_seen_rtt && tp->srtt_us)) in bbr_set_pacing_rate()
294 if (bbr_full_bw_reached(sk) || rate > READ_ONCE(sk->sk_pacing_rate)) in bbr_set_pacing_rate()
295 WRITE_ONCE(sk->sk_pacing_rate, rate); in bbr_set_pacing_rate()
301 return READ_ONCE(sk->sk_pacing_rate) < (bbr_min_tso_rate >> 3) ? 1 : 2; in bbr_min_tso_segs()
313 READ_ONCE(sk->sk_pacing_rate) >> READ_ONCE(sk->sk_pacing_shift), in bbr_tso_segs_goal()
314 GSO_LEGACY_MAX_SIZE - 1 - MAX_TCP_HEADER); in bbr_tso_segs_goal()
315 segs = max_t(u32, bytes / tp->mss_cache, bbr_min_tso_segs(sk)); in bbr_tso_segs_goal()
326 if (bbr->prev_ca_state < TCP_CA_Recovery && bbr->mode != BBR_PROBE_RTT) in bbr_save_cwnd()
327 bbr->prior_cwnd = tcp_snd_cwnd(tp); /* this cwnd is good enough */ in bbr_save_cwnd()
329 bbr->prior_cwnd = max(bbr->prior_cwnd, tcp_snd_cwnd(tp)); in bbr_save_cwnd()
337 if (event == CA_EVENT_TX_START && tp->app_limited) { in bbr_cwnd_event()
338 bbr->idle_restart = 1; in bbr_cwnd_event()
339 bbr->ack_epoch_mstamp = tp->tcp_mstamp; in bbr_cwnd_event()
340 bbr->ack_epoch_acked = 0; in bbr_cwnd_event()
342 * need more speed (we're restarting from idle and app-limited). in bbr_cwnd_event()
344 if (bbr->mode == BBR_PROBE_BW) in bbr_cwnd_event()
346 else if (bbr->mode == BBR_PROBE_RTT) in bbr_cwnd_event()
358 * noise may cause BBR to under-estimate the rate.
370 * case we need to slow-start up toward something safe: TCP_INIT_CWND. in bbr_bdp()
372 if (unlikely(bbr->min_rtt_us == ~0U)) /* no valid RTT samples yet? */ in bbr_bdp()
375 w = (u64)bw * bbr->min_rtt_us; in bbr_bdp()
380 bdp = (((w * gain) >> BBR_SCALE) + BW_UNIT - 1) / BW_UNIT; in bbr_bdp()
385 /* To achieve full performance in high-speed paths, we budget enough cwnd to
386 * fit full-sized skbs in-flight on both end hosts to fully utilize the path:
387 * - one skb in sending host Qdisc,
388 * - one skb in sending host TSO/GSO engine
389 * - one skb being received by receiver host LRO/GRO/delayed-ACK engine
392 * which allows 2 outstanding 2-packet sequences, to try to keep pipe
393 * full even with ACK-every-other-packet delayed ACKs.
399 /* Allow enough full-sized skbs in flight to utilize end systems. */ in bbr_quantization_budget()
406 if (bbr->mode == BBR_PROBE_BW && bbr->cycle_idx == 0) in bbr_quantization_budget()
425 * we often have several skbs queued in the pacing layer with a pre-scheduled
431 * in_network_at_edt = inflight_at_edt - (EDT - now) * bw
444 now_ns = tp->tcp_clock_cache; in bbr_packets_in_net_at_edt()
445 edt_ns = max(tp->tcp_wstamp_ns, now_ns); in bbr_packets_in_net_at_edt()
446 interval_us = div_u64(edt_ns - now_ns, NSEC_PER_USEC); in bbr_packets_in_net_at_edt()
449 if (bbr->pacing_gain > BBR_UNIT) /* increasing inflight */ in bbr_packets_in_net_at_edt()
453 return inflight_at_edt - interval_delivered; in bbr_packets_in_net_at_edt()
474 * After that, we slow-start and send at most 2*P packets per P packets acked.
478 * TODO(ycheng/ncardwell): implement a rate-based approach.
485 u8 prev_state = bbr->prev_ca_state, state = inet_csk(sk)->icsk_ca_state; in bbr_set_cwnd_to_recover_or_restore()
492 if (rs->losses > 0) in bbr_set_cwnd_to_recover_or_restore()
493 cwnd = max_t(s32, cwnd - rs->losses, 1); in bbr_set_cwnd_to_recover_or_restore()
497 bbr->packet_conservation = 1; in bbr_set_cwnd_to_recover_or_restore()
498 bbr->next_rtt_delivered = tp->delivered; /* start round now */ in bbr_set_cwnd_to_recover_or_restore()
503 cwnd = max(cwnd, bbr->prior_cwnd); in bbr_set_cwnd_to_recover_or_restore()
504 bbr->packet_conservation = 0; in bbr_set_cwnd_to_recover_or_restore()
506 bbr->prev_ca_state = state; in bbr_set_cwnd_to_recover_or_restore()
508 if (bbr->packet_conservation) { in bbr_set_cwnd_to_recover_or_restore()
516 /* Slow-start up toward target cwnd (if bw estimate is growing, or packet loss
543 else if (cwnd < target_cwnd || tp->delivered < TCP_INIT_CWND) in bbr_set_cwnd()
548 tcp_snd_cwnd_set(tp, min(cwnd, tp->snd_cwnd_clamp)); /* apply global cap */ in bbr_set_cwnd()
549 if (bbr->mode == BBR_PROBE_RTT) /* drain queue, refresh min_rtt */ in bbr_set_cwnd()
553 /* End cycle phase if it's time and/or we hit the phase's in-flight target. */
560 tcp_stamp_us_delta(tp->delivered_mstamp, bbr->cycle_mstamp) > in bbr_is_next_cycle_phase()
561 bbr->min_rtt_us; in bbr_is_next_cycle_phase()
567 if (bbr->pacing_gain == BBR_UNIT) in bbr_is_next_cycle_phase()
570 inflight = bbr_packets_in_net_at_edt(sk, rs->prior_in_flight); in bbr_is_next_cycle_phase()
578 if (bbr->pacing_gain > BBR_UNIT) in bbr_is_next_cycle_phase()
580 (rs->losses || /* perhaps pacing_gain*BDP won't fit */ in bbr_is_next_cycle_phase()
581 inflight >= bbr_inflight(sk, bw, bbr->pacing_gain)); in bbr_is_next_cycle_phase()
596 bbr->cycle_idx = (bbr->cycle_idx + 1) & (CYCLE_LEN - 1); in bbr_advance_cycle_phase()
597 bbr->cycle_mstamp = tp->delivered_mstamp; in bbr_advance_cycle_phase()
606 if (bbr->mode == BBR_PROBE_BW && bbr_is_next_cycle_phase(sk, rs)) in bbr_update_cycle_phase()
614 bbr->mode = BBR_STARTUP; in bbr_reset_startup_mode()
621 bbr->mode = BBR_PROBE_BW; in bbr_reset_probe_bw_mode()
622 bbr->cycle_idx = CYCLE_LEN - 1 - get_random_u32_below(bbr_cycle_rand); in bbr_reset_probe_bw_mode()
634 /* Start a new long-term sampling interval. */
640 bbr->lt_last_stamp = div_u64(tp->delivered_mstamp, USEC_PER_MSEC); in bbr_reset_lt_bw_sampling_interval()
641 bbr->lt_last_delivered = tp->delivered; in bbr_reset_lt_bw_sampling_interval()
642 bbr->lt_last_lost = tp->lost; in bbr_reset_lt_bw_sampling_interval()
643 bbr->lt_rtt_cnt = 0; in bbr_reset_lt_bw_sampling_interval()
646 /* Completely reset long-term bandwidth sampling. */
651 bbr->lt_bw = 0; in bbr_reset_lt_bw_sampling()
652 bbr->lt_use_bw = 0; in bbr_reset_lt_bw_sampling()
653 bbr->lt_is_sampling = false; in bbr_reset_lt_bw_sampling()
657 /* Long-term bw sampling interval is done. Estimate whether we're policed. */
663 if (bbr->lt_bw) { /* do we have bw from a previous interval? */ in bbr_lt_bw_interval_done()
665 diff = abs(bw - bbr->lt_bw); in bbr_lt_bw_interval_done()
666 if ((diff * BBR_UNIT <= bbr_lt_bw_ratio * bbr->lt_bw) || in bbr_lt_bw_interval_done()
670 bbr->lt_bw = (bw + bbr->lt_bw) >> 1; /* avg 2 intvls */ in bbr_lt_bw_interval_done()
671 bbr->lt_use_bw = 1; in bbr_lt_bw_interval_done()
672 bbr->pacing_gain = BBR_UNIT; /* try to avoid drops */ in bbr_lt_bw_interval_done()
673 bbr->lt_rtt_cnt = 0; in bbr_lt_bw_interval_done()
677 bbr->lt_bw = bw; in bbr_lt_bw_interval_done()
681 /* Token-bucket traffic policers are common (see "An Internet-Wide Analysis of
682 * Traffic Policing", SIGCOMM 2016). BBR detects token-bucket policers and
684 * estimate that we're policed if we see 2 consecutive sampling intervals with
686 * set lt_bw to the "long-term" average delivery rate from those 2 intervals.
696 if (bbr->lt_use_bw) { /* already using long-term rate, lt_bw? */ in bbr_lt_bw_sampling()
697 if (bbr->mode == BBR_PROBE_BW && bbr->round_start && in bbr_lt_bw_sampling()
698 ++bbr->lt_rtt_cnt >= bbr_lt_bw_max_rtts) { in bbr_lt_bw_sampling()
705 /* Wait for the first loss before sampling, to let the policer exhaust in bbr_lt_bw_sampling()
706 * its tokens and estimate the steady-state rate allowed by the policer. in bbr_lt_bw_sampling()
707 * Starting samples earlier includes bursts that over-estimate the bw. in bbr_lt_bw_sampling()
709 if (!bbr->lt_is_sampling) { in bbr_lt_bw_sampling()
710 if (!rs->losses) in bbr_lt_bw_sampling()
713 bbr->lt_is_sampling = true; in bbr_lt_bw_sampling()
716 /* To avoid underestimates, reset sampling if we run out of data. */ in bbr_lt_bw_sampling()
717 if (rs->is_app_limited) { in bbr_lt_bw_sampling()
722 if (bbr->round_start) in bbr_lt_bw_sampling()
723 bbr->lt_rtt_cnt++; /* count round trips in this interval */ in bbr_lt_bw_sampling()
724 if (bbr->lt_rtt_cnt < bbr_lt_intvl_min_rtts) in bbr_lt_bw_sampling()
725 return; /* sampling interval needs to be longer */ in bbr_lt_bw_sampling()
726 if (bbr->lt_rtt_cnt > 4 * bbr_lt_intvl_min_rtts) { in bbr_lt_bw_sampling()
731 /* End sampling interval when a packet is lost, so we estimate the in bbr_lt_bw_sampling()
732 * policer tokens were exhausted. Stopping the sampling before the in bbr_lt_bw_sampling()
733 * tokens are exhausted under-estimates the policed rate. in bbr_lt_bw_sampling()
735 if (!rs->losses) in bbr_lt_bw_sampling()
738 /* Calculate packets lost and delivered in sampling interval. */ in bbr_lt_bw_sampling()
739 lost = tp->lost - bbr->lt_last_lost; in bbr_lt_bw_sampling()
740 delivered = tp->delivered - bbr->lt_last_delivered; in bbr_lt_bw_sampling()
745 /* Find average delivery rate in this sampling interval. */ in bbr_lt_bw_sampling()
746 t = div_u64(tp->delivered_mstamp, USEC_PER_MSEC) - bbr->lt_last_stamp; in bbr_lt_bw_sampling()
767 bbr->round_start = 0; in bbr_update_bw()
768 if (rs->delivered < 0 || rs->interval_us <= 0) in bbr_update_bw()
772 if (!before(rs->prior_delivered, bbr->next_rtt_delivered)) { in bbr_update_bw()
773 bbr->next_rtt_delivered = tp->delivered; in bbr_update_bw()
774 bbr->rtt_cnt++; in bbr_update_bw()
775 bbr->round_start = 1; in bbr_update_bw()
776 bbr->packet_conservation = 0; in bbr_update_bw()
785 bw = div64_long((u64)rs->delivered * BW_UNIT, rs->interval_us); in bbr_update_bw()
787 /* If this sample is application-limited, it is likely to have a very in bbr_update_bw()
790 * bw, causing needless slow-down. Thus, to continue to send at the in bbr_update_bw()
791 * last measured network rate, we filter out app-limited samples unless in bbr_update_bw()
794 * So the goal during app-limited phase is to proceed with the best in bbr_update_bw()
798 if (!rs->is_app_limited || bw >= bbr_max_bw(sk)) { in bbr_update_bw()
800 minmax_running_max(&bbr->bw, bbr_bw_rtts, bbr->rtt_cnt, bw); in bbr_update_bw()
805 * This is used to provision extra in-flight data to keep sending during
806 * inter-ACK silences.
814 * Max filter is an approximate sliding window of 5-10 (packet timed) round
824 if (!bbr_extra_acked_gain || rs->acked_sacked <= 0 || in bbr_update_ack_aggregation()
825 rs->delivered < 0 || rs->interval_us <= 0) in bbr_update_ack_aggregation()
828 if (bbr->round_start) { in bbr_update_ack_aggregation()
829 bbr->extra_acked_win_rtts = min(0x1F, in bbr_update_ack_aggregation()
830 bbr->extra_acked_win_rtts + 1); in bbr_update_ack_aggregation()
831 if (bbr->extra_acked_win_rtts >= bbr_extra_acked_win_rtts) { in bbr_update_ack_aggregation()
832 bbr->extra_acked_win_rtts = 0; in bbr_update_ack_aggregation()
833 bbr->extra_acked_win_idx = bbr->extra_acked_win_idx ? in bbr_update_ack_aggregation()
835 bbr->extra_acked[bbr->extra_acked_win_idx] = 0; in bbr_update_ack_aggregation()
839 /* Compute how many packets we expected to be delivered over epoch. */ in bbr_update_ack_aggregation()
840 epoch_us = tcp_stamp_us_delta(tp->delivered_mstamp, in bbr_update_ack_aggregation()
841 bbr->ack_epoch_mstamp); in bbr_update_ack_aggregation()
848 if (bbr->ack_epoch_acked <= expected_acked || in bbr_update_ack_aggregation()
849 (bbr->ack_epoch_acked + rs->acked_sacked >= in bbr_update_ack_aggregation()
851 bbr->ack_epoch_acked = 0; in bbr_update_ack_aggregation()
852 bbr->ack_epoch_mstamp = tp->delivered_mstamp; in bbr_update_ack_aggregation()
857 bbr->ack_epoch_acked = min_t(u32, 0xFFFFF, in bbr_update_ack_aggregation()
858 bbr->ack_epoch_acked + rs->acked_sacked); in bbr_update_ack_aggregation()
859 extra_acked = bbr->ack_epoch_acked - expected_acked; in bbr_update_ack_aggregation()
861 if (extra_acked > bbr->extra_acked[bbr->extra_acked_win_idx]) in bbr_update_ack_aggregation()
862 bbr->extra_acked[bbr->extra_acked_win_idx] = extra_acked; in bbr_update_ack_aggregation()
867 * at least bbr_full_bw_thresh (25%) after bbr_full_bw_cnt (3) non-app-limited
870 * cross-traffic or radio noise can go away. CUBIC Hystart shares a similar
871 * design goal, but uses delay and inter-ACK spacing instead of bandwidth.
879 if (bbr_full_bw_reached(sk) || !bbr->round_start || rs->is_app_limited) in bbr_check_full_bw_reached()
882 bw_thresh = (u64)bbr->full_bw * bbr_full_bw_thresh >> BBR_SCALE; in bbr_check_full_bw_reached()
884 bbr->full_bw = bbr_max_bw(sk); in bbr_check_full_bw_reached()
885 bbr->full_bw_cnt = 0; in bbr_check_full_bw_reached()
888 ++bbr->full_bw_cnt; in bbr_check_full_bw_reached()
889 bbr->full_bw_reached = bbr->full_bw_cnt >= bbr_full_bw_cnt; in bbr_check_full_bw_reached()
892 /* If pipe is probably full, drain the queue and then enter steady-state. */
897 if (bbr->mode == BBR_STARTUP && bbr_full_bw_reached(sk)) { in bbr_check_drain()
898 bbr->mode = BBR_DRAIN; /* drain queue we created */ in bbr_check_drain()
899 tcp_sk(sk)->snd_ssthresh = in bbr_check_drain()
901 } /* fall through to check if in-flight is already small: */ in bbr_check_drain()
902 if (bbr->mode == BBR_DRAIN && in bbr_check_drain()
913 if (!(bbr->probe_rtt_done_stamp && in bbr_check_probe_rtt_done()
914 after(tcp_jiffies32, bbr->probe_rtt_done_stamp))) in bbr_check_probe_rtt_done()
917 bbr->min_rtt_stamp = tcp_jiffies32; /* wait a while until PROBE_RTT */ in bbr_check_probe_rtt_done()
918 tcp_snd_cwnd_set(tp, max(tcp_snd_cwnd(tp), bbr->prior_cwnd)); in bbr_check_probe_rtt_done()
930 * After at least bbr_probe_rtt_mode_ms=200ms and at least one packet-timed
932 * re-enter the previous mode. BBR uses 200ms to approximately bound the
935 * Note that flows need only pay 2% if they are busy sending over the last 10
937 * natural silences or low-rate periods within 10 seconds where the rate is low
939 * these min RTT measurements opportunistically with our min_rtt filter. :-)
949 bbr->min_rtt_stamp + bbr_min_rtt_win_sec * HZ); in bbr_update_min_rtt()
950 if (rs->rtt_us >= 0 && in bbr_update_min_rtt()
951 (rs->rtt_us < bbr->min_rtt_us || in bbr_update_min_rtt()
952 (filter_expired && !rs->is_ack_delayed))) { in bbr_update_min_rtt()
953 bbr->min_rtt_us = rs->rtt_us; in bbr_update_min_rtt()
954 bbr->min_rtt_stamp = tcp_jiffies32; in bbr_update_min_rtt()
958 !bbr->idle_restart && bbr->mode != BBR_PROBE_RTT) { in bbr_update_min_rtt()
959 bbr->mode = BBR_PROBE_RTT; /* dip, drain queue */ in bbr_update_min_rtt()
961 bbr->probe_rtt_done_stamp = 0; in bbr_update_min_rtt()
964 if (bbr->mode == BBR_PROBE_RTT) { in bbr_update_min_rtt()
966 tp->app_limited = in bbr_update_min_rtt()
967 (tp->delivered + tcp_packets_in_flight(tp)) ? : 1; in bbr_update_min_rtt()
969 if (!bbr->probe_rtt_done_stamp && in bbr_update_min_rtt()
971 bbr->probe_rtt_done_stamp = tcp_jiffies32 + in bbr_update_min_rtt()
973 bbr->probe_rtt_round_done = 0; in bbr_update_min_rtt()
974 bbr->next_rtt_delivered = tp->delivered; in bbr_update_min_rtt()
975 } else if (bbr->probe_rtt_done_stamp) { in bbr_update_min_rtt()
976 if (bbr->round_start) in bbr_update_min_rtt()
977 bbr->probe_rtt_round_done = 1; in bbr_update_min_rtt()
978 if (bbr->probe_rtt_round_done) in bbr_update_min_rtt()
983 if (rs->delivered > 0) in bbr_update_min_rtt()
984 bbr->idle_restart = 0; in bbr_update_min_rtt()
991 switch (bbr->mode) { in bbr_update_gains()
993 bbr->pacing_gain = bbr_high_gain; in bbr_update_gains()
994 bbr->cwnd_gain = bbr_high_gain; in bbr_update_gains()
997 bbr->pacing_gain = bbr_drain_gain; /* slow, to drain */ in bbr_update_gains()
998 bbr->cwnd_gain = bbr_high_gain; /* keep cwnd */ in bbr_update_gains()
1001 bbr->pacing_gain = (bbr->lt_use_bw ? in bbr_update_gains()
1003 bbr_pacing_gain[bbr->cycle_idx]); in bbr_update_gains()
1004 bbr->cwnd_gain = bbr_cwnd_gain; in bbr_update_gains()
1007 bbr->pacing_gain = BBR_UNIT; in bbr_update_gains()
1008 bbr->cwnd_gain = BBR_UNIT; in bbr_update_gains()
1011 WARN_ONCE(1, "BBR bad mode: %u\n", bbr->mode); in bbr_update_gains()
1035 bbr_set_pacing_rate(sk, bw, bbr->pacing_gain); in bbr_main()
1036 bbr_set_cwnd(sk, rs, rs->acked_sacked, bw, bbr->cwnd_gain); in bbr_main()
1044 bbr->prior_cwnd = 0; in bbr_init()
1045 tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; in bbr_init()
1046 bbr->rtt_cnt = 0; in bbr_init()
1047 bbr->next_rtt_delivered = tp->delivered; in bbr_init()
1048 bbr->prev_ca_state = TCP_CA_Open; in bbr_init()
1049 bbr->packet_conservation = 0; in bbr_init()
1051 bbr->probe_rtt_done_stamp = 0; in bbr_init()
1052 bbr->probe_rtt_round_done = 0; in bbr_init()
1053 bbr->min_rtt_us = tcp_min_rtt(tp); in bbr_init()
1054 bbr->min_rtt_stamp = tcp_jiffies32; in bbr_init()
1056 minmax_reset(&bbr->bw, bbr->rtt_cnt, 0); /* init max bw to 0 */ in bbr_init()
1058 bbr->has_seen_rtt = 0; in bbr_init()
1061 bbr->round_start = 0; in bbr_init()
1062 bbr->idle_restart = 0; in bbr_init()
1063 bbr->full_bw_reached = 0; in bbr_init()
1064 bbr->full_bw = 0; in bbr_init()
1065 bbr->full_bw_cnt = 0; in bbr_init()
1066 bbr->cycle_mstamp = 0; in bbr_init()
1067 bbr->cycle_idx = 0; in bbr_init()
1071 bbr->ack_epoch_mstamp = tp->tcp_mstamp; in bbr_init()
1072 bbr->ack_epoch_acked = 0; in bbr_init()
1073 bbr->extra_acked_win_rtts = 0; in bbr_init()
1074 bbr->extra_acked_win_idx = 0; in bbr_init()
1075 bbr->extra_acked[0] = 0; in bbr_init()
1076 bbr->extra_acked[1] = 0; in bbr_init()
1078 cmpxchg(&sk->sk_pacing_status, SK_PACING_NONE, SK_PACING_NEEDED); in bbr_init()
1083 /* Provision 3 * cwnd since BBR may slow-start even during recovery. */ in bbr_sndbuf_expand()
1094 bbr->full_bw = 0; /* spurious slow-down; reset full pipe detection */ in bbr_undo_cwnd()
1095 bbr->full_bw_cnt = 0; in bbr_undo_cwnd()
1104 return tcp_sk(sk)->snd_ssthresh; in bbr_ssthresh()
1110 if (ext & (1 << (INET_DIAG_BBRINFO - 1)) || in bbr_get_info()
1111 ext & (1 << (INET_DIAG_VEGASINFO - 1))) { in bbr_get_info()
1116 bw = bw * tp->mss_cache * USEC_PER_SEC >> BW_SCALE; in bbr_get_info()
1117 memset(&info->bbr, 0, sizeof(info->bbr)); in bbr_get_info()
1118 info->bbr.bbr_bw_lo = (u32)bw; in bbr_get_info()
1119 info->bbr.bbr_bw_hi = (u32)(bw >> 32); in bbr_get_info()
1120 info->bbr.bbr_min_rtt = bbr->min_rtt_us; in bbr_get_info()
1121 info->bbr.bbr_pacing_gain = bbr->pacing_gain; in bbr_get_info()
1122 info->bbr.bbr_cwnd_gain = bbr->cwnd_gain; in bbr_get_info()
1124 return sizeof(info->bbr); in bbr_get_info()
1136 bbr->prev_ca_state = TCP_CA_Loss; in bbr_set_state()
1137 bbr->full_bw = 0; in bbr_set_state()
1138 bbr->round_start = 1; /* treat RTO like end of a round */ in bbr_set_state()