MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bbr_state_startup

Function bbr_state_startup

freebsd/netinet/tcp_stacks/bbr.c:11021–11159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11019}
11020
11021static int32_t inline
11022bbr_state_startup(struct tcp_bbr *bbr, uint32_t cts, int32_t epoch, int32_t pkt_epoch)
11023{
11024 /* Have we gained 25% in the last 3 packet based epoch's? */
11025 uint64_t btlbw, gain;
11026 int do_exit;
11027 int delta, rtt_gain;
11028
11029 if ((bbr->rc_tp->snd_una == bbr->rc_tp->snd_max) &&
11030 (bbr_calc_time(cts, bbr->r_ctl.rc_went_idle_time) >= bbr_rtt_probe_time)) {
11031 /*
11032 * This qualifies as a RTT_PROBE session since we drop the
11033 * data outstanding to nothing and waited more than
11034 * bbr_rtt_probe_time.
11035 */
11036 bbr_log_rtt_shrinks(bbr, cts, 0, 0, __LINE__, BBR_RTTS_WASIDLE, 0);
11037 bbr_set_reduced_rtt(bbr, cts, __LINE__);
11038 }
11039 if (bbr_should_enter_probe_rtt(bbr, cts)) {
11040 bbr_enter_probe_rtt(bbr, cts, __LINE__);
11041 return (0);
11042 }
11043 if (bbr->rc_use_google)
11044 return (bbr_google_startup(bbr, cts, pkt_epoch));
11045
11046 if ((bbr->r_ctl.rc_lost > bbr->r_ctl.rc_lost_at_startup) &&
11047 (bbr_use_lower_gain_in_startup)) {
11048 /* Drop to a lower gain 1.5 x since we saw loss */
11049 bbr->r_ctl.rc_bbr_hptsi_gain = bbr_startup_lower;
11050 }
11051 if (pkt_epoch == 0) {
11052 /*
11053 * Need to be on a pkt-epoch to continue.
11054 */
11055 return (0);
11056 }
11057 if (bbr_rtt_gain_thresh) {
11058 /*
11059 * Do we allow a flow to stay
11060 * in startup with no loss and no
11061 * gain in rtt over a set threshold?
11062 */
11063 if (bbr->r_ctl.rc_pkt_epoch_rtt &&
11064 bbr->r_ctl.startup_last_srtt &&
11065 (bbr->r_ctl.rc_pkt_epoch_rtt > bbr->r_ctl.startup_last_srtt)) {
11066 delta = bbr->r_ctl.rc_pkt_epoch_rtt - bbr->r_ctl.startup_last_srtt;
11067 rtt_gain = (delta * 100) / bbr->r_ctl.startup_last_srtt;
11068 } else
11069 rtt_gain = 0;
11070 if ((bbr->r_ctl.startup_last_srtt == 0) ||
11071 (bbr->r_ctl.rc_pkt_epoch_rtt < bbr->r_ctl.startup_last_srtt))
11072 /* First time or new lower value */
11073 bbr->r_ctl.startup_last_srtt = bbr->r_ctl.rc_pkt_epoch_rtt;
11074
11075 if ((bbr->r_ctl.rc_lost == 0) &&
11076 (rtt_gain < bbr_rtt_gain_thresh)) {
11077 /*
11078 * No loss, and we are under

Callers 1

bbr_state_changeFunction · 0.85

Calls 10

bbr_calc_timeFunction · 0.85
bbr_log_rtt_shrinksFunction · 0.85
bbr_set_reduced_rttFunction · 0.85
bbr_enter_probe_rttFunction · 0.85
bbr_google_startupFunction · 0.85
bbr_log_startup_eventFunction · 0.85
bbr_get_full_bwFunction · 0.85
ctf_flight_sizeFunction · 0.85
maxFunction · 0.85

Tested by

no test coverage detected