Skip to content

Commit e8bd8fc

Browse files
yousukseungdavem330
authored andcommitted
tcp: add SRTT to SCM_TIMESTAMPING_OPT_STATS
Add TCP_NLA_SRTT to SCM_TIMESTAMPING_OPT_STATS that reports the smoothed round trip time in microseconds (tcp_sock.srtt_us >> 3). Signed-off-by: Yousuk Seung <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Acked-by: Neal Cardwell <[email protected]> Acked-by: Yuchung Cheng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 54e8cb7 commit e8bd8fc

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

include/uapi/linux/tcp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ enum {
266266
TCP_NLA_BYTES_RETRANS, /* Data bytes retransmitted */
267267
TCP_NLA_DSACK_DUPS, /* DSACK blocks received */
268268
TCP_NLA_REORD_SEEN, /* reordering events seen */
269+
TCP_NLA_SRTT, /* smoothed RTT in usecs */
269270
};
270271

271272
/* for TCP_MD5SIG socket option */

net/ipv4/tcp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3242,6 +3242,7 @@ static size_t tcp_opt_stats_get_size(void)
32423242
nla_total_size_64bit(sizeof(u64)) + /* TCP_NLA_BYTES_RETRANS */
32433243
nla_total_size(sizeof(u32)) + /* TCP_NLA_DSACK_DUPS */
32443244
nla_total_size(sizeof(u32)) + /* TCP_NLA_REORD_SEEN */
3245+
nla_total_size(sizeof(u32)) + /* TCP_NLA_SRTT */
32453246
0;
32463247
}
32473248

@@ -3295,6 +3296,7 @@ struct sk_buff *tcp_get_timestamping_opt_stats(const struct sock *sk)
32953296
TCP_NLA_PAD);
32963297
nla_put_u32(stats, TCP_NLA_DSACK_DUPS, tp->dsack_dups);
32973298
nla_put_u32(stats, TCP_NLA_REORD_SEEN, tp->reord_seen);
3299+
nla_put_u32(stats, TCP_NLA_SRTT, tp->srtt_us >> 3);
32983300

32993301
return stats;
33003302
}

0 commit comments

Comments
 (0)