netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] ss: add support for segs_in and segs_out
@ 2015-05-26 18:54 Craig Gallek
  2015-05-26 19:01 ` Marcelo Ricardo Leitner
  2015-06-26  3:52 ` Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: Craig Gallek @ 2015-05-26 18:54 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: edumazet, mleitner, netdev, Craig Gallek

Two new tcp_info fields: tcpi_segs_in and tcpi_segs_out.
(2efd055c53c06b7e89c167c98069bab9afce7e59)

~: ss -ti src :22
	 cubic wscale:7,6 rto:201 rtt:0.244/0.012 ato:40 mss:1418 cwnd:21 bytes_acked:80605 bytes_received:20491 segs_out:414 segs_in:600 send 976.3Mbps lastsnd:23 lastrcv:23 lastack:22 pacing_rate 1952.7Mbps rcv_rtt:98 rcv_space:28960

Signed-off-by: Craig Gallek <kraig@google.com>
---
 include/linux/tcp.h | 4 +++-
 misc/ss.c           | 8 ++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 8b17cff..1e9b4a6 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -192,8 +192,10 @@ struct tcp_info {
 
 	__u64	tcpi_pacing_rate;
 	__u64	tcpi_max_pacing_rate;
-	__u64	tcpi_bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked */
+	__u64	tcpi_bytes_acked;    /* RFC4898 tcpEStatsAppHCThruOctetsAcked */
 	__u64	tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */
+	__u32	tcpi_segs_out;	     /* RFC4898 tcpEStatsPerfSegsOut */
+	__u32	tcpi_segs_in;	     /* RFC4898 tcpEStatsPerfSegsIn */
 };
 
 /* for TCP_MD5SIG socket option */
diff --git a/misc/ss.c b/misc/ss.c
index dba0901..3e01f88 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -769,6 +769,8 @@ struct tcpstat
 	double		    pacing_rate_max;
 	unsigned long long  bytes_acked;
 	unsigned long long  bytes_received;
+	unsigned int	    segs_out;
+	unsigned int	    segs_in;
 	unsigned int	    unacked;
 	unsigned int	    retrans;
 	unsigned int	    retrans_total;
@@ -1695,6 +1697,10 @@ static void tcp_stats_print(struct tcpstat *s)
 		printf(" bytes_acked:%llu", s->bytes_acked);
 	if (s->bytes_received)
 		printf(" bytes_received:%llu", s->bytes_received);
+	if (s->segs_out)
+		printf(" segs_out:%u", s->segs_out);
+	if (s->segs_in)
+		printf(" segs_in:%u", s->segs_in);
 
 	if (s->dctcp && s->dctcp->enabled) {
 		struct dctcpstat *dctcp = s->dctcp;
@@ -1990,6 +1996,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
 		}
 		s.bytes_acked = info->tcpi_bytes_acked;
 		s.bytes_received = info->tcpi_bytes_received;
+		s.segs_out = info->tcpi_segs_out;
+		s.segs_in = info->tcpi_segs_in;
 		tcp_stats_print(&s);
 		if (s.dctcp)
 			free(s.dctcp);
-- 
2.2.0.rc0.207.ga3a616c

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2] ss: add support for segs_in and segs_out
  2015-05-26 18:54 [PATCH iproute2] ss: add support for segs_in and segs_out Craig Gallek
@ 2015-05-26 19:01 ` Marcelo Ricardo Leitner
  2015-06-26  3:52 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-05-26 19:01 UTC (permalink / raw)
  To: Craig Gallek; +Cc: Stephen Hemminger, edumazet, netdev

On Tue, May 26, 2015 at 02:54:41PM -0400, Craig Gallek wrote:
> Two new tcp_info fields: tcpi_segs_in and tcpi_segs_out.
> (2efd055c53c06b7e89c167c98069bab9afce7e59)
> 
> ~: ss -ti src :22
> 	 cubic wscale:7,6 rto:201 rtt:0.244/0.012 ato:40 mss:1418 cwnd:21 bytes_acked:80605 bytes_received:20491 segs_out:414 segs_in:600 send 976.3Mbps lastsnd:23 lastrcv:23 lastack:22 pacing_rate 1952.7Mbps rcv_rtt:98 rcv_space:28960
> 
> Signed-off-by: Craig Gallek <kraig@google.com>

Cool, thanks Craig.

Reviewed-by: Marcelo Ricardo Leitner <mleitner@redhat.com>

> ---
>  include/linux/tcp.h | 4 +++-
>  misc/ss.c           | 8 ++++++++
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
> index 8b17cff..1e9b4a6 100644
> --- a/include/linux/tcp.h
> +++ b/include/linux/tcp.h
> @@ -192,8 +192,10 @@ struct tcp_info {
>  
>  	__u64	tcpi_pacing_rate;
>  	__u64	tcpi_max_pacing_rate;
> -	__u64	tcpi_bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked */
> +	__u64	tcpi_bytes_acked;    /* RFC4898 tcpEStatsAppHCThruOctetsAcked */
>  	__u64	tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */
> +	__u32	tcpi_segs_out;	     /* RFC4898 tcpEStatsPerfSegsOut */
> +	__u32	tcpi_segs_in;	     /* RFC4898 tcpEStatsPerfSegsIn */
>  };
>  
>  /* for TCP_MD5SIG socket option */
> diff --git a/misc/ss.c b/misc/ss.c
> index dba0901..3e01f88 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -769,6 +769,8 @@ struct tcpstat
>  	double		    pacing_rate_max;
>  	unsigned long long  bytes_acked;
>  	unsigned long long  bytes_received;
> +	unsigned int	    segs_out;
> +	unsigned int	    segs_in;
>  	unsigned int	    unacked;
>  	unsigned int	    retrans;
>  	unsigned int	    retrans_total;
> @@ -1695,6 +1697,10 @@ static void tcp_stats_print(struct tcpstat *s)
>  		printf(" bytes_acked:%llu", s->bytes_acked);
>  	if (s->bytes_received)
>  		printf(" bytes_received:%llu", s->bytes_received);
> +	if (s->segs_out)
> +		printf(" segs_out:%u", s->segs_out);
> +	if (s->segs_in)
> +		printf(" segs_in:%u", s->segs_in);
>  
>  	if (s->dctcp && s->dctcp->enabled) {
>  		struct dctcpstat *dctcp = s->dctcp;
> @@ -1990,6 +1996,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
>  		}
>  		s.bytes_acked = info->tcpi_bytes_acked;
>  		s.bytes_received = info->tcpi_bytes_received;
> +		s.segs_out = info->tcpi_segs_out;
> +		s.segs_in = info->tcpi_segs_in;
>  		tcp_stats_print(&s);
>  		if (s.dctcp)
>  			free(s.dctcp);
> -- 
> 2.2.0.rc0.207.ga3a616c
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2] ss: add support for segs_in and segs_out
  2015-05-26 18:54 [PATCH iproute2] ss: add support for segs_in and segs_out Craig Gallek
  2015-05-26 19:01 ` Marcelo Ricardo Leitner
@ 2015-06-26  3:52 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2015-06-26  3:52 UTC (permalink / raw)
  To: Craig Gallek; +Cc: edumazet, mleitner, netdev

On Tue, 26 May 2015 14:54:41 -0400
Craig Gallek <kraig@google.com> wrote:

> Two new tcp_info fields: tcpi_segs_in and tcpi_segs_out.
> (2efd055c53c06b7e89c167c98069bab9afce7e59)
> 
> ~: ss -ti src :22
> 	 cubic wscale:7,6 rto:201 rtt:0.244/0.012 ato:40 mss:1418 cwnd:21 bytes_acked:80605 bytes_received:20491 segs_out:414 segs_in:600 send 976.3Mbps lastsnd:23 lastrcv:23 lastack:22 pacing_rate 1952.7Mbps rcv_rtt:98 rcv_space:28960
> 
> Signed-off-by: Craig Gallek <kraig@google.com>

Applied to net-next branch

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-26  3:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-26 18:54 [PATCH iproute2] ss: add support for segs_in and segs_out Craig Gallek
2015-05-26 19:01 ` Marcelo Ricardo Leitner
2015-06-26  3:52 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).