All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] ss: take care of unknown min_rtt
@ 2016-04-13 22:18 Eric Dumazet
  2016-04-19 14:57 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2016-04-13 22:18 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

Kernel sets info->tcpi_min_rtt to ~0U when no RTT sample was ever
taken for the session, thus min_rtt is unknown.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 misc/ss.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/misc/ss.c b/misc/ss.c
index 38cf331..51ff5ac 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2018,7 +2018,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
 		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;
+		if (info->tcpi_min_rtt && info->tcpi_min_rtt != ~0U)
+			s.min_rtt = (double) info->tcpi_min_rtt / 1000;
 		tcp_stats_print(&s);
 		free(s.dctcp);
 	}

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

* Re: [PATCH iproute2] ss: take care of unknown min_rtt
  2016-04-13 22:18 [PATCH iproute2] ss: take care of unknown min_rtt Eric Dumazet
@ 2016-04-19 14:57 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2016-04-19 14:57 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev

On Wed, 13 Apr 2016 15:18:38 -0700
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> From: Eric Dumazet <edumazet@google.com>
> 
> Kernel sets info->tcpi_min_rtt to ~0U when no RTT sample was ever
> taken for the session, thus min_rtt is unknown.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  misc/ss.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 


Applied

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

end of thread, other threads:[~2016-04-19 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-13 22:18 [PATCH iproute2] ss: take care of unknown min_rtt Eric Dumazet
2016-04-19 14:57 ` Stephen Hemminger

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.