Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_stacks/bbr.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 6,360 Lines • ▼ Show 20 Lines | if (tp->t_srtt != 0) { | ||||
* No rtt measurement yet - use the unsmoothed rtt. Set the | * No rtt measurement yet - use the unsmoothed rtt. Set the | ||||
* variance to half the rtt (so our first retransmit happens | * variance to half the rtt (so our first retransmit happens | ||||
* at 3*rtt). | * at 3*rtt). | ||||
*/ | */ | ||||
tp->t_srtt = rtt_ticks << TCP_RTT_SHIFT; | tp->t_srtt = rtt_ticks << TCP_RTT_SHIFT; | ||||
tp->t_rttvar = rtt_ticks << (TCP_RTTVAR_SHIFT - 1); | tp->t_rttvar = rtt_ticks << (TCP_RTTVAR_SHIFT - 1); | ||||
} | } | ||||
KMOD_TCPSTAT_INC(tcps_rttupdated); | KMOD_TCPSTAT_INC(tcps_rttupdated); | ||||
if (tp->t_rttupdated < UCHAR_MAX) | |||||
tp->t_rttupdated++; | tp->t_rttupdated++; | ||||
#ifdef STATS | #ifdef STATS | ||||
stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RTT, imax(0, rtt_ticks)); | stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RTT, imax(0, rtt_ticks)); | ||||
#endif | #endif | ||||
/* | /* | ||||
* the retransmit should happen at rtt + 4 * rttvar. Because of the | * the retransmit should happen at rtt + 4 * rttvar. Because of the | ||||
* way we do the smoothing, srtt and rttvar will each average +1/2 | * way we do the smoothing, srtt and rttvar will each average +1/2 | ||||
* tick of bias. When we compute the retransmit timer, we want 1/2 | * tick of bias. When we compute the retransmit timer, we want 1/2 | ||||
* tick of rounding and 1 extra tick because of +-1/2 tick | * tick of rounding and 1 extra tick because of +-1/2 tick | ||||
▲ Show 20 Lines • Show All 8,393 Lines • Show Last 20 Lines |