diff mbox series

[iproute2,1/1] ss: add missing path MTU parameter

Message ID 1513279438-15045-1-git-send-email-mrv@mojatatu.com
State Superseded, archived
Delegated to: stephen hemminger
Headers show
Series [iproute2,1/1] ss: add missing path MTU parameter | expand

Commit Message

Roman Mashak Dec. 14, 2017, 7:23 p.m. UTC
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
---
 man/man8/ss.8 | 4 ++++
 misc/ss.c     | 4 ++++
 2 files changed, 8 insertions(+)

Comments

Neal Cardwell Dec. 14, 2017, 7:32 p.m. UTC | #1
On Thu, Dec 14, 2017 at 2:23 PM, Roman Mashak <mrv@mojatatu.com> wrote:
>
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
> ---
...
> @@ -1967,6 +1968,8 @@ static void tcp_stats_print(struct tcpstat *s)
>                 printf(" cwnd:%u", s->cwnd);
>         if (s->ssthresh)
>                 printf(" ssthresh:%d", s->ssthresh);
> +       if (s->pmtu)
> +               printf(" pmtu:%u", s->pmtu);

Would it be possible to print the pmtu immediately after the mss? IMHO
having related parameters next to each other this way would make this
easier to parse for humans.

Thanks for adding this!

cheers,
neal
Roman Mashak Dec. 14, 2017, 7:51 p.m. UTC | #2
Neal Cardwell <ncardwell@google.com> writes:

> On Thu, Dec 14, 2017 at 2:23 PM, Roman Mashak <mrv@mojatatu.com> wrote:
>>
>> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
>> ---
> ...
>> @@ -1967,6 +1968,8 @@ static void tcp_stats_print(struct tcpstat *s)
>>                 printf(" cwnd:%u", s->cwnd);
>>         if (s->ssthresh)
>>                 printf(" ssthresh:%d", s->ssthresh);
>> +       if (s->pmtu)
>> +               printf(" pmtu:%u", s->pmtu);
>
> Would it be possible to print the pmtu immediately after the mss? IMHO
> having related parameters next to each other this way would make this
> easier to parse for humans.
>
> Thanks for adding this!

Sure, I will send v2 with change.
diff mbox series

Patch

diff --git a/man/man8/ss.8 b/man/man8/ss.8
index 6d06383..0d52673 100644
--- a/man/man8/ss.8
+++ b/man/man8/ss.8
@@ -184,6 +184,10 @@  max segment size
 congestion window size
 .P
 .TP
+.B pmtu:<pmtu>
+path MTU value
+.P
+.TP
 .B ssthresh:<ssthresh>
 tcp congestion window slow start threshold
 .P
diff --git a/misc/ss.c b/misc/ss.c
index da52d5e..b93f6cc 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -727,6 +727,7 @@  struct tcpstat {
 	int		    mss;
 	int		    rcv_mss;
 	int		    advmss;
+	unsigned int	    pmtu;
 	unsigned int	    cwnd;
 	unsigned int	    lastsnd;
 	unsigned int	    lastrcv;
@@ -1967,6 +1968,8 @@  static void tcp_stats_print(struct tcpstat *s)
 		printf(" cwnd:%u", s->cwnd);
 	if (s->ssthresh)
 		printf(" ssthresh:%d", s->ssthresh);
+	if (s->pmtu)
+		printf(" pmtu:%u", s->pmtu);
 
 	if (s->bytes_acked)
 		printf(" bytes_acked:%llu", s->bytes_acked);
@@ -2308,6 +2311,7 @@  static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
 		s.reordering	 = info->tcpi_reordering;
 		s.rcv_ssthresh   = info->tcpi_rcv_ssthresh;
 		s.cwnd		 = info->tcpi_snd_cwnd;
+		s.pmtu		 = info->tcpi_pmtu;
 
 		if (info->tcpi_snd_ssthresh < 0xFFFF)
 			s.ssthresh = info->tcpi_snd_ssthresh;