MFC: Expose smoothed RTT and RTT variance measurements to userland via
socket option TCP_INFO.
This commit is contained in:
parent
8534933fd6
commit
681ef96d1c
@ -208,8 +208,8 @@ struct tcp_info {
|
||||
/* Metrics; variable units. */
|
||||
u_int32_t __tcpi_pmtu;
|
||||
u_int32_t __tcpi_rcv_ssthresh;
|
||||
u_int32_t __tcpi_rtt;
|
||||
u_int32_t __tcpi_rttvar;
|
||||
u_int32_t tcpi_rtt; /* Smoothed RTT in usecs. */
|
||||
u_int32_t tcpi_rttvar; /* RTT variance in usecs. */
|
||||
u_int32_t tcpi_snd_ssthresh; /* Slow start threshold. */
|
||||
u_int32_t tcpi_snd_cwnd; /* Send congestion window. */
|
||||
u_int32_t __tcpi_advmss;
|
||||
|
@ -988,6 +988,10 @@ tcp_fill_info(tp, ti)
|
||||
ti->tcpi_snd_wscale = tp->snd_scale;
|
||||
ti->tcpi_rcv_wscale = tp->rcv_scale;
|
||||
}
|
||||
|
||||
ti->tcpi_rtt = ((u_int64_t)tp->t_srtt * tick) >> TCP_RTT_SHIFT;
|
||||
ti->tcpi_rttvar = ((u_int64_t)tp->t_rttvar * tick) >> TCP_RTTVAR_SHIFT;
|
||||
|
||||
ti->tcpi_snd_ssthresh = tp->snd_ssthresh;
|
||||
ti->tcpi_snd_cwnd = tp->snd_cwnd;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user