All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] ss: add support for bytes_sent, bytes_retrans, dsack_dups and reord_seen
@ 2018-11-29 10:27 Eric Dumazet
  2018-11-29 17:47 ` Wei Wang
  2018-11-29 18:50 ` Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Dumazet @ 2018-11-29 10:27 UTC (permalink / raw)
  To: David Ahern, Stephen Hemminger
  Cc: netdev, Eric Dumazet, Eric Dumazet, Wei Wang, Yuchung Cheng,
	Neal Cardwell, Soheil Hassas Yeganeh

Wei Wang added these fields in linux-4.19

Tested:

ss -ti ...

	ts sack cubic wscale:8,8 rto:7 rtt:2.678/0.267 mss:1428 pmtu:1500
    rcvmss:536 advmss:1428 cwnd:91 ssthresh:65
(*) bytes_sent:17470606104 bytes_retrans:2856
    bytes_acked:17470483297
    segs_out:12234320 segs_in:622983
    data_segs_out:12234318 send 388.2Mbps lastrcv:986784 lastack:1
    pacing_rate 465.8Mbps delivery_rate 162.7Mbps
    delivered:12234235 delivered_ce:3669056
    busy:986784ms unacked:84 retrans:0/2
(*) dsack_dups:2
    rcv_space:14280 rcv_ssthresh:65535 notsent:2016336 minrtt:0.183

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Wei Wang <weiwan@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
---
 misc/ss.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/misc/ss.c b/misc/ss.c
index 3aa94f235085512510dca9fd597e8e37aaaf0fd3..3589ebedc5a0ab0615ba56f3df10d49198bed0d9 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -819,6 +819,8 @@ struct tcpstat {
 	unsigned int	    not_sent;
 	unsigned int	    delivered;
 	unsigned int	    delivered_ce;
+	unsigned int	    dsack_dups;
+	unsigned int	    reord_seen;
 	double		    rcv_rtt;
 	double		    min_rtt;
 	int		    rcv_space;
@@ -826,6 +828,8 @@ struct tcpstat {
 	unsigned long long  busy_time;
 	unsigned long long  rwnd_limited;
 	unsigned long long  sndbuf_limited;
+	unsigned long long  bytes_sent;
+	unsigned long long  bytes_retrans;
 	bool		    has_ts_opt;
 	bool		    has_sack_opt;
 	bool		    has_ecn_opt;
@@ -2426,6 +2430,10 @@ static void tcp_stats_print(struct tcpstat *s)
 	if (s->ssthresh)
 		out(" ssthresh:%d", s->ssthresh);
 
+	if (s->bytes_sent)
+		out(" bytes_sent:%llu", s->bytes_sent);
+	if (s->bytes_retrans)
+		out(" bytes_retrans:%llu", s->bytes_retrans);
 	if (s->bytes_acked)
 		out(" bytes_acked:%llu", s->bytes_acked);
 	if (s->bytes_received)
@@ -2512,10 +2520,14 @@ static void tcp_stats_print(struct tcpstat *s)
 		out(" lost:%u", s->lost);
 	if (s->sacked && s->ss.state != SS_LISTEN)
 		out(" sacked:%u", s->sacked);
+	if (s->dsack_dups)
+		out(" dsack_dups:%u", s->dsack_dups);
 	if (s->fackets)
 		out(" fackets:%u", s->fackets);
 	if (s->reordering != 3)
 		out(" reordering:%d", s->reordering);
+	if (s->reord_seen)
+		out(" reord_seen:%d", s->reord_seen);
 	if (s->rcv_rtt)
 		out(" rcv_rtt:%g", s->rcv_rtt);
 	if (s->rcv_space)
@@ -2837,6 +2849,10 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
 		s.sndbuf_limited = info->tcpi_sndbuf_limited;
 		s.delivered = info->tcpi_delivered;
 		s.delivered_ce = info->tcpi_delivered_ce;
+		s.dsack_dups = info->tcpi_dsack_dups;
+		s.reord_seen = info->tcpi_reord_seen;
+		s.bytes_sent = info->tcpi_bytes_sent;
+		s.bytes_retrans = info->tcpi_bytes_retrans;
 		tcp_stats_print(&s);
 		free(s.dctcp);
 		free(s.bbr_info);
-- 
2.20.0.rc0.387.gc7a69e6b6c-goog

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

* Re: [PATCH iproute2] ss: add support for bytes_sent, bytes_retrans, dsack_dups and reord_seen
  2018-11-29 10:27 [PATCH iproute2] ss: add support for bytes_sent, bytes_retrans, dsack_dups and reord_seen Eric Dumazet
@ 2018-11-29 17:47 ` Wei Wang
  2018-11-29 18:50 ` Stephen Hemminger
  1 sibling, 0 replies; 5+ messages in thread
From: Wei Wang @ 2018-11-29 17:47 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David Ahern, Stephen Hemminger, Linux Kernel Network Developers,
	Eric Dumazet, Yuchung Cheng, Neal Cardwell,
	Soheil Hassas Yeganeh

On Thu, Nov 29, 2018 at 2:28 AM Eric Dumazet <edumazet@google.com> wrote:
>
> Wei Wang added these fields in linux-4.19
>
> Tested:
>
> ss -ti ...
>
>         ts sack cubic wscale:8,8 rto:7 rtt:2.678/0.267 mss:1428 pmtu:1500
>     rcvmss:536 advmss:1428 cwnd:91 ssthresh:65
> (*) bytes_sent:17470606104 bytes_retrans:2856
>     bytes_acked:17470483297
>     segs_out:12234320 segs_in:622983
>     data_segs_out:12234318 send 388.2Mbps lastrcv:986784 lastack:1
>     pacing_rate 465.8Mbps delivery_rate 162.7Mbps
>     delivered:12234235 delivered_ce:3669056
>     busy:986784ms unacked:84 retrans:0/2
> (*) dsack_dups:2
>     rcv_space:14280 rcv_ssthresh:65535 notsent:2016336 minrtt:0.183
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Wei Wang <weiwan@google.com>
> Cc: Yuchung Cheng <ycheng@google.com>
> Cc: Neal Cardwell <ncardwell@google.com>
> Cc: Soheil Hassas Yeganeh <soheil@google.com>
> ---

Acked-by: Wei Wang <weiwan@google.com>

Thanks Eric.

>
>  misc/ss.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/misc/ss.c b/misc/ss.c
> index 3aa94f235085512510dca9fd597e8e37aaaf0fd3..3589ebedc5a0ab0615ba56f3df10d49198bed0d9 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -819,6 +819,8 @@ struct tcpstat {
>         unsigned int        not_sent;
>         unsigned int        delivered;
>         unsigned int        delivered_ce;
> +       unsigned int        dsack_dups;
> +       unsigned int        reord_seen;
>         double              rcv_rtt;
>         double              min_rtt;
>         int                 rcv_space;
> @@ -826,6 +828,8 @@ struct tcpstat {
>         unsigned long long  busy_time;
>         unsigned long long  rwnd_limited;
>         unsigned long long  sndbuf_limited;
> +       unsigned long long  bytes_sent;
> +       unsigned long long  bytes_retrans;
>         bool                has_ts_opt;
>         bool                has_sack_opt;
>         bool                has_ecn_opt;
> @@ -2426,6 +2430,10 @@ static void tcp_stats_print(struct tcpstat *s)
>         if (s->ssthresh)
>                 out(" ssthresh:%d", s->ssthresh);
>
> +       if (s->bytes_sent)
> +               out(" bytes_sent:%llu", s->bytes_sent);
> +       if (s->bytes_retrans)
> +               out(" bytes_retrans:%llu", s->bytes_retrans);
>         if (s->bytes_acked)
>                 out(" bytes_acked:%llu", s->bytes_acked);
>         if (s->bytes_received)
> @@ -2512,10 +2520,14 @@ static void tcp_stats_print(struct tcpstat *s)
>                 out(" lost:%u", s->lost);
>         if (s->sacked && s->ss.state != SS_LISTEN)
>                 out(" sacked:%u", s->sacked);
> +       if (s->dsack_dups)
> +               out(" dsack_dups:%u", s->dsack_dups);
>         if (s->fackets)
>                 out(" fackets:%u", s->fackets);
>         if (s->reordering != 3)
>                 out(" reordering:%d", s->reordering);
> +       if (s->reord_seen)
> +               out(" reord_seen:%d", s->reord_seen);
>         if (s->rcv_rtt)
>                 out(" rcv_rtt:%g", s->rcv_rtt);
>         if (s->rcv_space)
> @@ -2837,6 +2849,10 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
>                 s.sndbuf_limited = info->tcpi_sndbuf_limited;
>                 s.delivered = info->tcpi_delivered;
>                 s.delivered_ce = info->tcpi_delivered_ce;
> +               s.dsack_dups = info->tcpi_dsack_dups;
> +               s.reord_seen = info->tcpi_reord_seen;
> +               s.bytes_sent = info->tcpi_bytes_sent;
> +               s.bytes_retrans = info->tcpi_bytes_retrans;
>                 tcp_stats_print(&s);
>                 free(s.dctcp);
>                 free(s.bbr_info);
> --
> 2.20.0.rc0.387.gc7a69e6b6c-goog
>

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

* Re: [PATCH iproute2] ss: add support for bytes_sent, bytes_retrans, dsack_dups and reord_seen
  2018-11-29 10:27 [PATCH iproute2] ss: add support for bytes_sent, bytes_retrans, dsack_dups and reord_seen Eric Dumazet
  2018-11-29 17:47 ` Wei Wang
@ 2018-11-29 18:50 ` Stephen Hemminger
  2018-11-29 18:51   ` David Ahern
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2018-11-29 18:50 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David Ahern, netdev, Eric Dumazet, Wei Wang, Yuchung Cheng,
	Neal Cardwell, Soheil Hassas Yeganeh

On Thu, 29 Nov 2018 02:27:54 -0800
Eric Dumazet <edumazet@google.com> wrote:

> Wei Wang added these fields in linux-4.19
> 
> Tested:
> 
> ss -ti ...
> 
> 	ts sack cubic wscale:8,8 rto:7 rtt:2.678/0.267 mss:1428 pmtu:1500
>     rcvmss:536 advmss:1428 cwnd:91 ssthresh:65
> (*) bytes_sent:17470606104 bytes_retrans:2856
>     bytes_acked:17470483297
>     segs_out:12234320 segs_in:622983
>     data_segs_out:12234318 send 388.2Mbps lastrcv:986784 lastack:1
>     pacing_rate 465.8Mbps delivery_rate 162.7Mbps
>     delivered:12234235 delivered_ce:3669056
>     busy:986784ms unacked:84 retrans:0/2
> (*) dsack_dups:2
>     rcv_space:14280 rcv_ssthresh:65535 notsent:2016336 minrtt:0.183
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Wei Wang <weiwan@google.com>
> Cc: Yuchung Cheng <ycheng@google.com>
> Cc: Neal Cardwell <ncardwell@google.com>
> Cc: Soheil Hassas Yeganeh <soheil@google.com>

Applied.

PS: ss still doesn't support JSON output, given the volume of output it would be good.

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

* Re: [PATCH iproute2] ss: add support for bytes_sent, bytes_retrans, dsack_dups and reord_seen
  2018-11-29 18:50 ` Stephen Hemminger
@ 2018-11-29 18:51   ` David Ahern
  2018-11-30 19:40     ` Stefano Brivio
  0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2018-11-29 18:51 UTC (permalink / raw)
  To: Stephen Hemminger, Eric Dumazet
  Cc: netdev, Eric Dumazet, Wei Wang, Yuchung Cheng, Neal Cardwell,
	Soheil Hassas Yeganeh, Stefano Brivio

On 11/29/18 11:50 AM, Stephen Hemminger wrote:
> PS: ss still doesn't support JSON output, given the volume of output it would be good.

I thought Stefano was investigating it as an alternative to the 'display
selected columns' patches.

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

* Re: [PATCH iproute2] ss: add support for bytes_sent, bytes_retrans, dsack_dups and reord_seen
  2018-11-29 18:51   ` David Ahern
@ 2018-11-30 19:40     ` Stefano Brivio
  0 siblings, 0 replies; 5+ messages in thread
From: Stefano Brivio @ 2018-11-30 19:40 UTC (permalink / raw)
  To: David Ahern
  Cc: Stephen Hemminger, Eric Dumazet, netdev, Eric Dumazet, Wei Wang,
	Yuchung Cheng, Neal Cardwell, Soheil Hassas Yeganeh

Hi David,

On Thu, 29 Nov 2018 11:51:48 -0700
David Ahern <dsahern@gmail.com> wrote:

> On 11/29/18 11:50 AM, Stephen Hemminger wrote:
> > PS: ss still doesn't support JSON output, given the volume of output it would be good.  
> 
> I thought Stefano was investigating it as an alternative to the 'display
> selected columns' patches.

Thanks for Cc'ing me, I missed this.

I'm not really investigating it at the moment, I'm convinced it's not
complicated, it's on my to-do list, but I'm not working on it right now
(and maybe also not in a very near future).

I would still say the "display selected columns" patches could be a
stopgap for now (even though it's not related to this one patch).

-- 
Stefano

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

end of thread, other threads:[~2018-12-01  6:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29 10:27 [PATCH iproute2] ss: add support for bytes_sent, bytes_retrans, dsack_dups and reord_seen Eric Dumazet
2018-11-29 17:47 ` Wei Wang
2018-11-29 18:50 ` Stephen Hemminger
2018-11-29 18:51   ` David Ahern
2018-11-30 19:40     ` Stefano Brivio

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.