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

Function bbr_set_state_target

freebsd/netinet/tcp_stacks/bbr.c:10730–10771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10728}
10729
10730static void
10731bbr_set_state_target(struct tcp_bbr *bbr, int line)
10732{
10733 uint32_t tar, meth;
10734
10735 if ((bbr->rc_bbr_state == BBR_STATE_PROBE_RTT) &&
10736 ((bbr->r_ctl.bbr_rttprobe_gain_val == 0) || bbr->rc_use_google)) {
10737 /* Special case using old probe-rtt method */
10738 tar = bbr_rtt_probe_cwndtarg * (bbr->rc_tp->t_maxseg - bbr->rc_last_options);
10739 meth = 1;
10740 } else {
10741 /* Non-probe-rtt case and reduced probe-rtt */
10742 if ((bbr->rc_bbr_state == BBR_STATE_PROBE_BW) &&
10743 (bbr->r_ctl.rc_bbr_hptsi_gain > BBR_UNIT)) {
10744 /* For gain cycle we use the hptsi gain */
10745 tar = bbr_get_a_state_target(bbr, bbr->r_ctl.rc_bbr_hptsi_gain);
10746 meth = 2;
10747 } else if ((bbr_target_is_bbunit) || bbr->rc_use_google) {
10748 /*
10749 * If configured, or for google all other states
10750 * get BBR_UNIT.
10751 */
10752 tar = bbr_get_a_state_target(bbr, BBR_UNIT);
10753 meth = 3;
10754 } else {
10755 /*
10756 * Or we set a target based on the pacing gain
10757 * for non-google mode and default (non-configured).
10758 * Note we don't set a target goal below drain (192).
10759 */
10760 if (bbr->r_ctl.rc_bbr_hptsi_gain < bbr_hptsi_gain[BBR_SUB_DRAIN]) {
10761 tar = bbr_get_a_state_target(bbr, bbr_hptsi_gain[BBR_SUB_DRAIN]);
10762 meth = 4;
10763 } else {
10764 tar = bbr_get_a_state_target(bbr, bbr->r_ctl.rc_bbr_hptsi_gain);
10765 meth = 5;
10766 }
10767 }
10768 }
10769 bbr_log_set_of_state_target(bbr, tar, line, meth);
10770 bbr->r_ctl.rc_target_at_state = tar;
10771}
10772
10773static void
10774bbr_enter_probe_rtt(struct tcp_bbr *bbr, uint32_t cts, int32_t line)

Callers 8

bbr_lt_bw_samplingFunction · 0.85
tcp_bbr_commit_bwFunction · 0.85
bbr_update_bbr_infoFunction · 0.85
bbr_restart_after_idleFunction · 0.85
bbr_substate_changeFunction · 0.85
bbr_enter_probe_rttFunction · 0.85
bbr_exit_probe_rttFunction · 0.85
bbr_state_changeFunction · 0.85

Calls 2

bbr_get_a_state_targetFunction · 0.85

Tested by

no test coverage detected