From: Stephen Hemminger Date: Thu, 18 Feb 2016 01:43:59 +0000 (-0800) Subject: ss: display not_sent and min_rtt info X-Git-Tag: v4.6.0~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e99e49528d4dde8e0ba30b493a553b563925f76;p=thirdparty%2Fiproute2.git ss: display not_sent and min_rtt info Display new info from net-next kernel. Signed-off-by: Stephen Hemminger --- diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h index 8a1d5006e..e79209260 100644 --- a/include/linux/genetlink.h +++ b/include/linux/genetlink.h @@ -21,6 +21,7 @@ struct genlmsghdr { #define GENL_CMD_CAP_DO 0x02 #define GENL_CMD_CAP_DUMP 0x04 #define GENL_CMD_CAP_HASPOL 0x08 +#define GENL_UNS_ADMIN_PERM 0x10 /* * List of reserved static generic netlink identifiers: diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 1e9b4a627..55d656756 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -196,6 +196,9 @@ struct tcp_info { __u64 tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */ __u32 tcpi_segs_out; /* RFC4898 tcpEStatsPerfSegsOut */ __u32 tcpi_segs_in; /* RFC4898 tcpEStatsPerfSegsIn */ + + __u32 tcpi_notsent_bytes; + __u32 tcpi_min_rtt; }; /* for TCP_MD5SIG socket option */ diff --git a/misc/ss.c b/misc/ss.c index 13fcc8f66..f0f590263 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -778,7 +778,9 @@ struct tcpstat unsigned int sacked; unsigned int fackets; unsigned int reordering; + unsigned int not_sent; double rcv_rtt; + double min_rtt; int rcv_space; bool has_ts_opt; bool has_sack_opt; @@ -1737,6 +1739,10 @@ static void tcp_stats_print(struct tcpstat *s) printf(" rcv_rtt:%g", s->rcv_rtt); if (s->rcv_space) printf(" rcv_space:%d", s->rcv_space); + if (s->not_sent) + printf(" notsent:%u", s->not_sent); + if (s->min_rtt) + printf(" minrtt:%g", s->min_rtt); } static void tcp_timer_print(struct tcpstat *s) @@ -1990,6 +1996,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, s.bytes_received = info->tcpi_bytes_received; s.segs_out = info->tcpi_segs_out; s.segs_in = info->tcpi_segs_in; + s.not_sent = info->tcpi_notsent_bytes; + s.min_rtt = (double) info->tcpi_min_rtt / 1000; tcp_stats_print(&s); free(s.dctcp); }