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, 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 sk->sk_pacing_rate = bbr_bw_to_pacing_rate(sk, bw, bbr_high_gain); in bbr_init_pacing_rate_from_rtt()
291 if (unlikely(!bbr->has_seen_rtt && tp->srtt_us)) in bbr_set_pacing_rate()
293 if (bbr_full_bw_reached(sk) || rate > sk->sk_pacing_rate) in bbr_set_pacing_rate()
294 sk->sk_pacing_rate = rate; in bbr_set_pacing_rate()
300 return sk->sk_pacing_rate < (bbr_min_tso_rate >> 3) ? 1 : 2; in bbr_min_tso_segs()
312 sk->sk_pacing_rate >> READ_ONCE(sk->sk_pacing_shift), in bbr_tso_segs_goal()
313 GSO_LEGACY_MAX_SIZE - 1 - MAX_TCP_HEADER); in bbr_tso_segs_goal()
314 segs = max_t(u32, bytes / tp->mss_cache, bbr_min_tso_segs(sk)); in bbr_tso_segs_goal()
325 if (bbr->prev_ca_state < TCP_CA_Recovery && bbr->mode != BBR_PROBE_RTT) in bbr_save_cwnd()
326 bbr->prior_cwnd = tcp_snd_cwnd(tp); /* this cwnd is good enough */ in bbr_save_cwnd()
328 bbr->prior_cwnd = max(bbr->prior_cwnd, tcp_snd_cwnd(tp)); in bbr_save_cwnd()
336 if (event == CA_EVENT_TX_START && tp->app_limited) { in bbr_cwnd_event()
337 bbr->idle_restart = 1; in bbr_cwnd_event()
338 bbr->ack_epoch_mstamp = tp->tcp_mstamp; in bbr_cwnd_event()
339 bbr->ack_epoch_acked = 0; in bbr_cwnd_event()
341 * need more speed (we're restarting from idle and app-limited). in bbr_cwnd_event()
343 if (bbr->mode == BBR_PROBE_BW) in bbr_cwnd_event()
345 else if (bbr->mode == BBR_PROBE_RTT) in bbr_cwnd_event()
357 * noise may cause BBR to under-estimate the rate.
369 * case we need to slow-start up toward something safe: TCP_INIT_CWND. in bbr_bdp()
371 if (unlikely(bbr->min_rtt_us == ~0U)) /* no valid RTT samples yet? */ in bbr_bdp()
374 w = (u64)bw * bbr->min_rtt_us; in bbr_bdp()
379 bdp = (((w * gain) >> BBR_SCALE) + BW_UNIT - 1) / BW_UNIT; in bbr_bdp()
384 /* To achieve full performance in high-speed paths, we budget enough cwnd to
385 * fit full-sized skbs in-flight on both end hosts to fully utilize the path:
386 * - one skb in sending host Qdisc,
387 * - one skb in sending host TSO/GSO engine
388 * - one skb being received by receiver host LRO/GRO/delayed-ACK engine
391 * which allows 2 outstanding 2-packet sequences, to try to keep pipe
392 * full even with ACK-every-other-packet delayed ACKs.
398 /* Allow enough full-sized skbs in flight to utilize end systems. */ in bbr_quantization_budget()
405 if (bbr->mode == BBR_PROBE_BW && bbr->cycle_idx == 0) in bbr_quantization_budget()
424 * we often have several skbs queued in the pacing layer with a pre-scheduled
430 * in_network_at_edt = inflight_at_edt - (EDT - now) * bw
443 now_ns = tp->tcp_clock_cache; in bbr_packets_in_net_at_edt()
444 edt_ns = max(tp->tcp_wstamp_ns, now_ns); in bbr_packets_in_net_at_edt()
445 interval_us = div_u64(edt_ns - now_ns, NSEC_PER_USEC); in bbr_packets_in_net_at_edt()
448 if (bbr->pacing_gain > BBR_UNIT) /* increasing inflight */ in bbr_packets_in_net_at_edt()
452 return inflight_at_edt - interval_delivered; in bbr_packets_in_net_at_edt()
473 * After that, we slow-start and send at most 2*P packets per P packets acked.
477 * TODO(ycheng/ncardwell): implement a rate-based approach.
484 u8 prev_state = bbr->prev_ca_state, state = inet_csk(sk)->icsk_ca_state; in bbr_set_cwnd_to_recover_or_restore()
491 if (rs->losses > 0) in bbr_set_cwnd_to_recover_or_restore()
492 cwnd = max_t(s32, cwnd - rs->losses, 1); in bbr_set_cwnd_to_recover_or_restore()
496 bbr->packet_conservation = 1; in bbr_set_cwnd_to_recover_or_restore()
497 bbr->next_rtt_delivered = tp->delivered; /* start round now */ in bbr_set_cwnd_to_recover_or_restore()
502 cwnd = max(cwnd, bbr->prior_cwnd); in bbr_set_cwnd_to_recover_or_restore()
503 bbr->packet_conservation = 0; in bbr_set_cwnd_to_recover_or_restore()
505 bbr->prev_ca_state = state; in bbr_set_cwnd_to_recover_or_restore()
507 if (bbr->packet_conservation) { in bbr_set_cwnd_to_recover_or_restore()
515 /* Slow-start up toward target cwnd (if bw estimate is growing, or packet loss
542 else if (cwnd < target_cwnd || tp->delivered < TCP_INIT_CWND) in bbr_set_cwnd()
547 tcp_snd_cwnd_set(tp, min(cwnd, tp->snd_cwnd_clamp)); /* apply global cap */ in bbr_set_cwnd()
548 if (bbr->mode == BBR_PROBE_RTT) /* drain queue, refresh min_rtt */ in bbr_set_cwnd()
552 /* End cycle phase if it's time and/or we hit the phase's in-flight target. */
559 tcp_stamp_us_delta(tp->delivered_mstamp, bbr->cycle_mstamp) > in bbr_is_next_cycle_phase()
560 bbr->min_rtt_us; in bbr_is_next_cycle_phase()
566 if (bbr->pacing_gain == BBR_UNIT) in bbr_is_next_cycle_phase()
569 inflight = bbr_packets_in_net_at_edt(sk, rs->prior_in_flight); in bbr_is_next_cycle_phase()
577 if (bbr->pacing_gain > BBR_UNIT) in bbr_is_next_cycle_phase()
579 (rs->losses || /* perhaps pacing_gain*BDP won't fit */ in bbr_is_next_cycle_phase()
580 inflight >= bbr_inflight(sk, bw, bbr->pacing_gain)); in bbr_is_next_cycle_phase()
595 bbr->cycle_idx = (bbr->cycle_idx + 1) & (CYCLE_LEN - 1); in bbr_advance_cycle_phase()
596 bbr->cycle_mstamp = tp->delivered_mstamp; in bbr_advance_cycle_phase()
605 if (bbr->mode == BBR_PROBE_BW && bbr_is_next_cycle_phase(sk, rs)) in bbr_update_cycle_phase()
613 bbr->mode = BBR_STARTUP; in bbr_reset_startup_mode()
620 bbr->mode = BBR_PROBE_BW; in bbr_reset_probe_bw_mode()
621 bbr->cycle_idx = CYCLE_LEN - 1 - get_random_u32_below(bbr_cycle_rand); in bbr_reset_probe_bw_mode()
633 /* Start a new long-term sampling interval. */
639 bbr->lt_last_stamp = div_u64(tp->delivered_mstamp, USEC_PER_MSEC); in bbr_reset_lt_bw_sampling_interval()
640 bbr->lt_last_delivered = tp->delivered; in bbr_reset_lt_bw_sampling_interval()
641 bbr->lt_last_lost = tp->lost; in bbr_reset_lt_bw_sampling_interval()
642 bbr->lt_rtt_cnt = 0; in bbr_reset_lt_bw_sampling_interval()
645 /* Completely reset long-term bandwidth sampling. */
650 bbr->lt_bw = 0; in bbr_reset_lt_bw_sampling()
651 bbr->lt_use_bw = 0; in bbr_reset_lt_bw_sampling()
652 bbr->lt_is_sampling = false; in bbr_reset_lt_bw_sampling()
656 /* Long-term bw sampling interval is done. Estimate whether we're policed. */
662 if (bbr->lt_bw) { /* do we have bw from a previous interval? */ in bbr_lt_bw_interval_done()
664 diff = abs(bw - bbr->lt_bw); in bbr_lt_bw_interval_done()
665 if ((diff * BBR_UNIT <= bbr_lt_bw_ratio * bbr->lt_bw) || in bbr_lt_bw_interval_done()
669 bbr->lt_bw = (bw + bbr->lt_bw) >> 1; /* avg 2 intvls */ in bbr_lt_bw_interval_done()
670 bbr->lt_use_bw = 1; in bbr_lt_bw_interval_done()
671 bbr->pacing_gain = BBR_UNIT; /* try to avoid drops */ in bbr_lt_bw_interval_done()
672 bbr->lt_rtt_cnt = 0; in bbr_lt_bw_interval_done()
676 bbr->lt_bw = bw; in bbr_lt_bw_interval_done()
680 /* Token-bucket traffic policers are common (see "An Internet-Wide Analysis of
681 * Traffic Policing", SIGCOMM 2016). BBR detects token-bucket policers and
683 * estimate that we're policed if we see 2 consecutive sampling intervals with
685 * set lt_bw to the "long-term" average delivery rate from those 2 intervals.
695 if (bbr->lt_use_bw) { /* already using long-term rate, lt_bw? */ in bbr_lt_bw_sampling()
696 if (bbr->mode == BBR_PROBE_BW && bbr->round_start && in bbr_lt_bw_sampling()
697 ++bbr->lt_rtt_cnt >= bbr_lt_bw_max_rtts) { in bbr_lt_bw_sampling()
704 /* Wait for the first loss before sampling, to let the policer exhaust in bbr_lt_bw_sampling()
705 * its tokens and estimate the steady-state rate allowed by the policer. in bbr_lt_bw_sampling()
706 * Starting samples earlier includes bursts that over-estimate the bw. in bbr_lt_bw_sampling()
708 if (!bbr->lt_is_sampling) { in bbr_lt_bw_sampling()
709 if (!rs->losses) in bbr_lt_bw_sampling()
712 bbr->lt_is_sampling = true; in bbr_lt_bw_sampling()
715 /* To avoid underestimates, reset sampling if we run out of data. */ in bbr_lt_bw_sampling()
716 if (rs->is_app_limited) { in bbr_lt_bw_sampling()
721 if (bbr->round_start) in bbr_lt_bw_sampling()
722 bbr->lt_rtt_cnt++; /* count round trips in this interval */ in bbr_lt_bw_sampling()
723 if (bbr->lt_rtt_cnt < bbr_lt_intvl_min_rtts) in bbr_lt_bw_sampling()
724 return; /* sampling interval needs to be longer */ in bbr_lt_bw_sampling()
725 if (bbr->lt_rtt_cnt > 4 * bbr_lt_intvl_min_rtts) { in bbr_lt_bw_sampling()
730 /* End sampling interval when a packet is lost, so we estimate the in bbr_lt_bw_sampling()
731 * policer tokens were exhausted. Stopping the sampling before the in bbr_lt_bw_sampling()
732 * tokens are exhausted under-estimates the policed rate. in bbr_lt_bw_sampling()
734 if (!rs->losses) in bbr_lt_bw_sampling()
737 /* Calculate packets lost and delivered in sampling interval. */ in bbr_lt_bw_sampling()
738 lost = tp->lost - bbr->lt_last_lost; in bbr_lt_bw_sampling()
739 delivered = tp->delivered - bbr->lt_last_delivered; in bbr_lt_bw_sampling()
744 /* Find average delivery rate in this sampling interval. */ in bbr_lt_bw_sampling()
745 t = div_u64(tp->delivered_mstamp, USEC_PER_MSEC) - bbr->lt_last_stamp; in bbr_lt_bw_sampling()
766 bbr->round_start = 0; in bbr_update_bw()
767 if (rs->delivered < 0 || rs->interval_us <= 0) in bbr_update_bw()
771 if (!before(rs->prior_delivered, bbr->next_rtt_delivered)) { in bbr_update_bw()
772 bbr->next_rtt_delivered = tp->delivered; in bbr_update_bw()
773 bbr->rtt_cnt++; in bbr_update_bw()
774 bbr->round_start = 1; in bbr_update_bw()
775 bbr->packet_conservation = 0; in bbr_update_bw()
784 bw = div64_long((u64)rs->delivered * BW_UNIT, rs->interval_us); in bbr_update_bw()
786 /* If this sample is application-limited, it is likely to have a very in bbr_update_bw()
789 * bw, causing needless slow-down. Thus, to continue to send at the in bbr_update_bw()
790 * last measured network rate, we filter out app-limited samples unless in bbr_update_bw()
793 * So the goal during app-limited phase is to proceed with the best in bbr_update_bw()
797 if (!rs->is_app_limited || bw >= bbr_max_bw(sk)) { in bbr_update_bw()
799 minmax_running_max(&bbr->bw, bbr_bw_rtts, bbr->rtt_cnt, bw); in bbr_update_bw()
804 * This is used to provision extra in-flight data to keep sending during
805 * inter-ACK silences.
813 * Max filter is an approximate sliding window of 5-10 (packet timed) round
823 if (!bbr_extra_acked_gain || rs->acked_sacked <= 0 || in bbr_update_ack_aggregation()
824 rs->delivered < 0 || rs->interval_us <= 0) in bbr_update_ack_aggregation()
827 if (bbr->round_start) { in bbr_update_ack_aggregation()
828 bbr->extra_acked_win_rtts = min(0x1F, in bbr_update_ack_aggregation()
829 bbr->extra_acked_win_rtts + 1); in bbr_update_ack_aggregation()
830 if (bbr->extra_acked_win_rtts >= bbr_extra_acked_win_rtts) { in bbr_update_ack_aggregation()
831 bbr->extra_acked_win_rtts = 0; in bbr_update_ack_aggregation()
832 bbr->extra_acked_win_idx = bbr->extra_acked_win_idx ? in bbr_update_ack_aggregation()
834 bbr->extra_acked[bbr->extra_acked_win_idx] = 0; in bbr_update_ack_aggregation()
838 /* Compute how many packets we expected to be delivered over epoch. */ in bbr_update_ack_aggregation()
839 epoch_us = tcp_stamp_us_delta(tp->delivered_mstamp, in bbr_update_ack_aggregation()
840 bbr->ack_epoch_mstamp); in bbr_update_ack_aggregation()
847 if (bbr->ack_epoch_acked <= expected_acked || in bbr_update_ack_aggregation()
848 (bbr->ack_epoch_acked + rs->acked_sacked >= in bbr_update_ack_aggregation()
850 bbr->ack_epoch_acked = 0; in bbr_update_ack_aggregation()
851 bbr->ack_epoch_mstamp = tp->delivered_mstamp; in bbr_update_ack_aggregation()
856 bbr->ack_epoch_acked = min_t(u32, 0xFFFFF, in bbr_update_ack_aggregation()
857 bbr->ack_epoch_acked + rs->acked_sacked); in bbr_update_ack_aggregation()
858 extra_acked = bbr->ack_epoch_acked - expected_acked; in bbr_update_ack_aggregation()
860 if (extra_acked > bbr->extra_acked[bbr->extra_acked_win_idx]) in bbr_update_ack_aggregation()
861 bbr->extra_acked[bbr->extra_acked_win_idx] = extra_acked; in bbr_update_ack_aggregation()
866 * at least bbr_full_bw_thresh (25%) after bbr_full_bw_cnt (3) non-app-limited
869 * cross-traffic or radio noise can go away. CUBIC Hystart shares a similar
870 * design goal, but uses delay and inter-ACK spacing instead of bandwidth.
878 if (bbr_full_bw_reached(sk) || !bbr->round_start || rs->is_app_limited) in bbr_check_full_bw_reached()
881 bw_thresh = (u64)bbr->full_bw * bbr_full_bw_thresh >> BBR_SCALE; in bbr_check_full_bw_reached()
883 bbr->full_bw = bbr_max_bw(sk); in bbr_check_full_bw_reached()
884 bbr->full_bw_cnt = 0; in bbr_check_full_bw_reached()
887 ++bbr->full_bw_cnt; in bbr_check_full_bw_reached()
888 bbr->full_bw_reached = bbr->full_bw_cnt >= bbr_full_bw_cnt; in bbr_check_full_bw_reached()
891 /* If pipe is probably full, drain the queue and then enter steady-state. */
896 if (bbr->mode == BBR_STARTUP && bbr_full_bw_reached(sk)) { in bbr_check_drain()
897 bbr->mode = BBR_DRAIN; /* drain queue we created */ in bbr_check_drain()
898 tcp_sk(sk)->snd_ssthresh = in bbr_check_drain()
900 } /* fall through to check if in-flight is already small: */ in bbr_check_drain()
901 if (bbr->mode == BBR_DRAIN && in bbr_check_drain()
912 if (!(bbr->probe_rtt_done_stamp && in bbr_check_probe_rtt_done()
913 after(tcp_jiffies32, bbr->probe_rtt_done_stamp))) in bbr_check_probe_rtt_done()
916 bbr->min_rtt_stamp = tcp_jiffies32; /* wait a while until PROBE_RTT */ in bbr_check_probe_rtt_done()
917 tcp_snd_cwnd_set(tp, max(tcp_snd_cwnd(tp), bbr->prior_cwnd)); in bbr_check_probe_rtt_done()
929 * After at least bbr_probe_rtt_mode_ms=200ms and at least one packet-timed
931 * re-enter the previous mode. BBR uses 200ms to approximately bound the
934 * Note that flows need only pay 2% if they are busy sending over the last 10
936 * natural silences or low-rate periods within 10 seconds where the rate is low
938 * these min RTT measurements opportunistically with our min_rtt filter. :-)
948 bbr->min_rtt_stamp + bbr_min_rtt_win_sec * HZ); in bbr_update_min_rtt()
949 if (rs->rtt_us >= 0 && in bbr_update_min_rtt()
950 (rs->rtt_us < bbr->min_rtt_us || in bbr_update_min_rtt()
951 (filter_expired && !rs->is_ack_delayed))) { in bbr_update_min_rtt()
952 bbr->min_rtt_us = rs->rtt_us; in bbr_update_min_rtt()
953 bbr->min_rtt_stamp = tcp_jiffies32; in bbr_update_min_rtt()
957 !bbr->idle_restart && bbr->mode != BBR_PROBE_RTT) { in bbr_update_min_rtt()
958 bbr->mode = BBR_PROBE_RTT; /* dip, drain queue */ in bbr_update_min_rtt()
960 bbr->probe_rtt_done_stamp = 0; in bbr_update_min_rtt()
963 if (bbr->mode == BBR_PROBE_RTT) { in bbr_update_min_rtt()
965 tp->app_limited = in bbr_update_min_rtt()
966 (tp->delivered + tcp_packets_in_flight(tp)) ? : 1; in bbr_update_min_rtt()
968 if (!bbr->probe_rtt_done_stamp && in bbr_update_min_rtt()
970 bbr->probe_rtt_done_stamp = tcp_jiffies32 + in bbr_update_min_rtt()
972 bbr->probe_rtt_round_done = 0; in bbr_update_min_rtt()
973 bbr->next_rtt_delivered = tp->delivered; in bbr_update_min_rtt()
974 } else if (bbr->probe_rtt_done_stamp) { in bbr_update_min_rtt()
975 if (bbr->round_start) in bbr_update_min_rtt()
976 bbr->probe_rtt_round_done = 1; in bbr_update_min_rtt()
977 if (bbr->probe_rtt_round_done) in bbr_update_min_rtt()
982 if (rs->delivered > 0) in bbr_update_min_rtt()
983 bbr->idle_restart = 0; in bbr_update_min_rtt()
990 switch (bbr->mode) { in bbr_update_gains()
992 bbr->pacing_gain = bbr_high_gain; in bbr_update_gains()
993 bbr->cwnd_gain = bbr_high_gain; in bbr_update_gains()
996 bbr->pacing_gain = bbr_drain_gain; /* slow, to drain */ in bbr_update_gains()
997 bbr->cwnd_gain = bbr_high_gain; /* keep cwnd */ in bbr_update_gains()
1000 bbr->pacing_gain = (bbr->lt_use_bw ? in bbr_update_gains()
1002 bbr_pacing_gain[bbr->cycle_idx]); in bbr_update_gains()
1003 bbr->cwnd_gain = bbr_cwnd_gain; in bbr_update_gains()
1006 bbr->pacing_gain = BBR_UNIT; in bbr_update_gains()
1007 bbr->cwnd_gain = BBR_UNIT; in bbr_update_gains()
1010 WARN_ONCE(1, "BBR bad mode: %u\n", bbr->mode); in bbr_update_gains()
1034 bbr_set_pacing_rate(sk, bw, bbr->pacing_gain); in bbr_main()
1035 bbr_set_cwnd(sk, rs, rs->acked_sacked, bw, bbr->cwnd_gain); in bbr_main()
1043 bbr->prior_cwnd = 0; in bbr_init()
1044 tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; in bbr_init()
1045 bbr->rtt_cnt = 0; in bbr_init()
1046 bbr->next_rtt_delivered = tp->delivered; in bbr_init()
1047 bbr->prev_ca_state = TCP_CA_Open; in bbr_init()
1048 bbr->packet_conservation = 0; in bbr_init()
1050 bbr->probe_rtt_done_stamp = 0; in bbr_init()
1051 bbr->probe_rtt_round_done = 0; in bbr_init()
1052 bbr->min_rtt_us = tcp_min_rtt(tp); in bbr_init()
1053 bbr->min_rtt_stamp = tcp_jiffies32; in bbr_init()
1055 minmax_reset(&bbr->bw, bbr->rtt_cnt, 0); /* init max bw to 0 */ in bbr_init()
1057 bbr->has_seen_rtt = 0; in bbr_init()
1060 bbr->round_start = 0; in bbr_init()
1061 bbr->idle_restart = 0; in bbr_init()
1062 bbr->full_bw_reached = 0; in bbr_init()
1063 bbr->full_bw = 0; in bbr_init()
1064 bbr->full_bw_cnt = 0; in bbr_init()
1065 bbr->cycle_mstamp = 0; in bbr_init()
1066 bbr->cycle_idx = 0; in bbr_init()
1070 bbr->ack_epoch_mstamp = tp->tcp_mstamp; in bbr_init()
1071 bbr->ack_epoch_acked = 0; in bbr_init()
1072 bbr->extra_acked_win_rtts = 0; in bbr_init()
1073 bbr->extra_acked_win_idx = 0; in bbr_init()
1074 bbr->extra_acked[0] = 0; in bbr_init()
1075 bbr->extra_acked[1] = 0; in bbr_init()
1077 cmpxchg(&sk->sk_pacing_status, SK_PACING_NONE, SK_PACING_NEEDED); in bbr_init()
1082 /* Provision 3 * cwnd since BBR may slow-start even during recovery. */ in bbr_sndbuf_expand()
1093 bbr->full_bw = 0; /* spurious slow-down; reset full pipe detection */ in bbr_undo_cwnd()
1094 bbr->full_bw_cnt = 0; in bbr_undo_cwnd()
1103 return tcp_sk(sk)->snd_ssthresh; in bbr_ssthresh()
1109 if (ext & (1 << (INET_DIAG_BBRINFO - 1)) || in bbr_get_info()
1110 ext & (1 << (INET_DIAG_VEGASINFO - 1))) { in bbr_get_info()
1115 bw = bw * tp->mss_cache * USEC_PER_SEC >> BW_SCALE; in bbr_get_info()
1116 memset(&info->bbr, 0, sizeof(info->bbr)); in bbr_get_info()
1117 info->bbr.bbr_bw_lo = (u32)bw; in bbr_get_info()
1118 info->bbr.bbr_bw_hi = (u32)(bw >> 32); in bbr_get_info()
1119 info->bbr.bbr_min_rtt = bbr->min_rtt_us; in bbr_get_info()
1120 info->bbr.bbr_pacing_gain = bbr->pacing_gain; in bbr_get_info()
1121 info->bbr.bbr_cwnd_gain = bbr->cwnd_gain; in bbr_get_info()
1123 return sizeof(info->bbr); in bbr_get_info()
1135 bbr->prev_ca_state = TCP_CA_Loss; in bbr_set_state()
1136 bbr->full_bw = 0; in bbr_set_state()
1137 bbr->round_start = 1; /* treat RTO like end of a round */ in bbr_set_state()