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

Function bbr_get_rtt

freebsd/netinet/tcp_stacks/bbr.c:4239–4285  ·  view source on GitHub ↗

* Return one of three RTTs to use (in microseconds). */

Source from the content-addressed store, hash-verified

4237 * Return one of three RTTs to use (in microseconds).
4238 */
4239static __inline uint32_t
4240bbr_get_rtt(struct tcp_bbr *bbr, int32_t rtt_type)
4241{
4242 uint32_t f_rtt;
4243 uint32_t srtt;
4244
4245 f_rtt = get_filter_value_small(&bbr->r_ctl.rc_rttprop);
4246 if (get_filter_value_small(&bbr->r_ctl.rc_rttprop) == 0xffffffff) {
4247 /* We have no rtt at all */
4248 if (bbr->rc_tp->t_srtt == 0)
4249 f_rtt = BBR_INITIAL_RTO;
4250 else
4251 f_rtt = (TICKS_2_USEC(bbr->rc_tp->t_srtt) >> TCP_RTT_SHIFT);
4252 /*
4253 * Since we don't know how good the rtt is apply a
4254 * delayed-ack min
4255 */
4256 if (f_rtt < bbr_delayed_ack_time) {
4257 f_rtt = bbr_delayed_ack_time;
4258 }
4259 }
4260 /* Take the filter version or last measured pkt-rtt */
4261 if (rtt_type == BBR_RTT_PROP) {
4262 srtt = f_rtt;
4263 } else if (rtt_type == BBR_RTT_PKTRTT) {
4264 if (bbr->r_ctl.rc_pkt_epoch_rtt) {
4265 srtt = bbr->r_ctl.rc_pkt_epoch_rtt;
4266 } else {
4267 /* No pkt rtt yet */
4268 srtt = f_rtt;
4269 }
4270 } else if (rtt_type == BBR_RTT_RACK) {
4271 srtt = bbr->r_ctl.rc_last_rtt;
4272 /* We need to add in any internal delay for our timer */
4273 if (bbr->rc_ack_was_delayed)
4274 srtt += bbr->r_ctl.rc_ack_hdwr_delay;
4275 } else if (rtt_type == BBR_SRTT) {
4276 srtt = (TICKS_2_USEC(bbr->rc_tp->t_srtt) >> TCP_RTT_SHIFT);
4277 } else {
4278 /* TSNH */
4279 srtt = f_rtt;
4280#ifdef BBR_INVARIANTS
4281 panic("Unknown rtt request type %d", rtt_type);
4282#endif
4283 }
4284 return (srtt);
4285}
4286
4287static int
4288bbr_is_lost(struct tcp_bbr *bbr, struct bbr_sendmap *rsm, uint32_t cts)

Callers 15

get_min_cwndFunction · 0.85
bbr_timer_startFunction · 0.85
bbr_log_type_statechangeFunction · 0.85
__bbr_get_bwFunction · 0.85
bbr_get_raw_target_cwndFunction · 0.85
bbr_get_pacing_delayFunction · 0.85
bbr_ack_receivedFunction · 0.85
bbr_post_recoveryFunction · 0.85
bbr_is_lostFunction · 0.85
bbr_update_bbr_infoFunction · 0.85
bbr_substate_changeFunction · 0.85

Calls 2

get_filter_value_smallFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected