diff options
author | bms <bms@FreeBSD.org> | 2007-02-02 18:34:18 +0000 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2007-02-02 18:34:18 +0000 |
commit | e9ca37568e53aa11d50a3ad06c564a60657e8696 (patch) | |
tree | 0ae1360fb35941307f57c06705ebfa1191ce32c5 /sys/netinet/tcp_usrreq.c | |
parent | 1c6bb0fe159297bcaaca160eae20feea65708abc (diff) | |
download | FreeBSD-src-e9ca37568e53aa11d50a3ad06c564a60657e8696.zip FreeBSD-src-e9ca37568e53aa11d50a3ad06c564a60657e8696.tar.gz |
Expose smoothed RTT and RTT variance measurements to userland via
socket option TCP_INFO.
Note that the units used in the original Linux API are in microseconds,
so use a 64-bit mantissa to convert FreeBSD's internal measurements
from struct tcpcb from ticks.
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 1618143..85f3222 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1245,6 +1245,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; |