From b2ec8f431402f621ed0a2435d895df55eb1354af Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Mon, 26 Nov 2018 18:58:31 +0100 Subject: [PATCH 1/8] man: rdma: Add reference to rdma-resource.8 All rdma-related man pages list each other in SEE ALSO section, only rdma-resource.8 is missing. Add it for the sake of consistency. Signed-off-by: Phil Sutter Signed-off-by: Stephen Hemminger --- man/man8/rdma-dev.8 | 1 + man/man8/rdma-link.8 | 1 + man/man8/rdma.8 | 1 + 3 files changed, 3 insertions(+) diff --git a/man/man8/rdma-dev.8 b/man/man8/rdma-dev.8 index 461681b6..b7abfe10 100644 --- a/man/man8/rdma-dev.8 +++ b/man/man8/rdma-dev.8 @@ -49,6 +49,7 @@ Shows the state of specified RDMA device. .SH SEE ALSO .BR rdma (8), .BR rdma-link (8), +.BR rdma-resource (8), .br .SH AUTHOR diff --git a/man/man8/rdma-link.8 b/man/man8/rdma-link.8 index 97dd8bb9..bddf3474 100644 --- a/man/man8/rdma-link.8 +++ b/man/man8/rdma-link.8 @@ -49,6 +49,7 @@ Shows the state of specified rdma link. .SH SEE ALSO .BR rdma (8), .BR rdma-dev (8), +.BR rdma-resource (8), .br .SH AUTHOR diff --git a/man/man8/rdma.8 b/man/man8/rdma.8 index 12aa149b..b2b5aef8 100644 --- a/man/man8/rdma.8 +++ b/man/man8/rdma.8 @@ -106,6 +106,7 @@ Exit status is 0 if command was successful or a positive integer upon failure. .SH SEE ALSO .BR rdma-dev (8), .BR rdma-link (8), +.BR rdma-resource (8), .br .SH REPORTING BUGS From 2f4d834b99ed40419ddf3724120ad3259deb658e Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Mon, 26 Nov 2018 14:29:53 -0800 Subject: [PATCH 2/8] ss: add support for delivered and delivered_ce fields Kernel support was added in linux-4.18 in commit feb5f2ec6464 ("tcp: export packets delivery info") Tested: ss -ti ... ESTAB 0 2270520 [2607:f8b0:8099:e16::]:47646 [2607:f8b0:8099:e18::]:38953 ts sack cubic wscale:8,8 rto:7 rtt:2.824/0.278 mss:1428 pmtu:1500 rcvmss:536 advmss:1428 cwnd:89 ssthresh:62 bytes_acked:2097871945 segs_out:1469144 segs_in:65221 data_segs_out:1469142 send 360.0Mbps lastsnd:2 lastrcv:99231 lastack:2 pacing_rate 431.9Mbps delivery_rate 246.4Mbps (*) delivered:1469099 delivered_ce:424799 busy:99231ms unacked:44 rcv_space:14280 rcv_ssthresh:65535 notsent:2207688 minrtt:0.228 Signed-off-by: Eric Dumazet Acked-by: Yuchung Cheng Signed-off-by: Stephen Hemminger --- misc/ss.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc/ss.c b/misc/ss.c index e4d6ae48..3aa94f23 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -817,6 +817,8 @@ struct tcpstat { unsigned int fackets; unsigned int reordering; unsigned int not_sent; + unsigned int delivered; + unsigned int delivered_ce; double rcv_rtt; double min_rtt; int rcv_space; @@ -2483,6 +2485,10 @@ static void tcp_stats_print(struct tcpstat *s) if (s->delivery_rate) out(" delivery_rate %sbps", sprint_bw(b1, s->delivery_rate)); + if (s->delivered) + out(" delivered:%u", s->delivered); + if (s->delivered_ce) + out(" delivered_ce:%u", s->delivered_ce); if (s->app_limited) out(" app_limited"); @@ -2829,6 +2835,8 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, s.busy_time = info->tcpi_busy_time; s.rwnd_limited = info->tcpi_rwnd_limited; s.sndbuf_limited = info->tcpi_sndbuf_limited; + s.delivered = info->tcpi_delivered; + s.delivered_ce = info->tcpi_delivered_ce; tcp_stats_print(&s); free(s.dctcp); free(s.bbr_info); From f38e278b8446e0ebe10e8e889387bcc9b110c05d Mon Sep 17 00:00:00 2001 From: Roopa Prabhu Date: Tue, 27 Nov 2018 18:02:52 -0800 Subject: [PATCH 3/8] bridge: make -c match -compressvlans first instead of -color commit c7c1a1ef51ae ("bridge: colorize output and use JSON print library") broke previous use of -c to represent compressvlans. This restores previous use of -c to represent compressvlans. Understand the original motivation to use -c to represent color consistently everywhere but there are apps and network interface managers out there that are already using -c to prepresent compressed vlans. Fixes: c7c1a1ef51ae ("bridge: colorize output and use JSON print library") Signed-off-by: Roopa Prabhu Reviewed-by: David Ahern Signed-off-by: Stephen Hemminger --- bridge/bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge/bridge.c b/bridge/bridge.c index 389f1bd5..a3d8154b 100644 --- a/bridge/bridge.c +++ b/bridge/bridge.c @@ -171,9 +171,9 @@ main(int argc, char **argv) NEXT_ARG(); if (netns_switch(argv[1])) exit(-1); - } else if (matches_color(opt, &color)) { } else if (matches(opt, "-compressvlans") == 0) { ++compress_vlans; + } else if (matches_color(opt, &color)) { } else if (matches(opt, "-force") == 0) { ++force; } else if (matches(opt, "-json") == 0) { From 7ab8f249aad9808f86ad639cd4799f1ba10c5f43 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 28 Nov 2018 12:12:32 +0100 Subject: [PATCH 4/8] man: ip-route.8: Fix ENCAP references in synopsis The different encapsulation types are described in ENCAP_* non-terminals, but ENCAP definition lists them without the ENCAP_ prefix. Fix this for consistency. Signed-off-by: Phil Sutter Signed-off-by: Stephen Hemminger --- man/man8/ip-route.8.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man/man8/ip-route.8.in b/man/man8/ip-route.8.in index 11dd4ca7..26dfe0b0 100644 --- a/man/man8/ip-route.8.in +++ b/man/man8/ip-route.8.in @@ -187,7 +187,8 @@ throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]" .ti -8 .IR ENCAP " := [ " -.IR MPLS " | " IP " | " BPF " | " SEG6 " | " SEG6LOCAL " ] " +.IR ENCAP_MPLS " | " ENCAP_IP " | " ENCAP_BPF " | " +.IR ENCAP_SEG6 " | " ENCAP_SEG6LOCAL " ] " .ti -8 .IR ENCAP_MPLS " := " From 5eead6270a19f00464052d4084f32182cfe027ff Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Thu, 29 Nov 2018 02:27:54 -0800 Subject: [PATCH 5/8] ss: add support for bytes_sent, bytes_retrans, dsack_dups and reord_seen 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 Cc: Wei Wang Cc: Yuchung Cheng Cc: Neal Cardwell Cc: Soheil Hassas Yeganeh Acked-by: Wei Wang Signed-off-by: Stephen Hemminger --- misc/ss.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/misc/ss.c b/misc/ss.c index 3aa94f23..3589ebed 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); From 6495bca92e08000b1a5ad95f9db4ef62b746bebf Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 29 Nov 2018 13:20:37 +0100 Subject: [PATCH 6/8] ssfilter: Fix for inverted last expression When fixing for shift/reduce conflicts, possibility to invert the last expression by prefixing with '!' or 'not' was accidentally removed. Fix this by allowing for expr to be an inverted expr so that any reference to it in exprlist accepts the inverted prefix. Reported-by: Eric Dumazet Fixes: b2038cc0b2403 ("ssfilter: Eliminate shift/reduce conflicts") Signed-off-by: Phil Sutter Acked-by: Eric Dumazet Signed-off-by: Stephen Hemminger --- misc/ssfilter.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/ssfilter.y b/misc/ssfilter.y index 0413ddda..a901ae75 100644 --- a/misc/ssfilter.y +++ b/misc/ssfilter.y @@ -54,10 +54,6 @@ null: /* NOTHING */ { $$ = NULL; } ; exprlist: expr - | '!' expr - { - $$ = alloc_node(SSF_NOT, $2); - } | exprlist '|' expr { $$ = alloc_node(SSF_OR, $1); @@ -83,6 +79,10 @@ expr: '(' exprlist ')' { $$ = $2; } + | '!' expr + { + $$ = alloc_node(SSF_NOT, $2); + } | DCOND eq HOSTCOND { $$ = alloc_node(SSF_DCOND, $3); From 3adcbf3757b8ad7f5cac86985ef6335b7981d725 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 30 Nov 2018 05:57:02 -0800 Subject: [PATCH 7/8] tc: add a missing space between rate estimator and backlog When a rate estimator is active, "tc -s qd" displays something like : rate 12616bit 11ppsbacklog 0b 0p requeues 2 instead of : rate 12616bit 11pps backlog 0b 0p requeues 2 Fixes: 4fcec7f3665b ("tc: jsonify stats2") Signed-off-by: Eric Dumazet Cc: Jiri Pirko Reviewed-by: Jiri Pirko Signed-off-by: Stephen Hemminger --- tc/tc_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tc/tc_util.c b/tc/tc_util.c index 82856a85..ab717890 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -838,8 +838,9 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat memcpy(&q, RTA_DATA(tbs[TCA_STATS_QUEUE]), MIN(RTA_PAYLOAD(tbs[TCA_STATS_QUEUE]), sizeof(q))); if (!tbs[TCA_STATS_RATE_EST]) - print_string(PRINT_FP, NULL, "\n%s", prefix); + print_string(PRINT_FP, NULL, "\n", ""); print_uint(PRINT_JSON, "backlog", NULL, q.backlog); + print_string(PRINT_FP, NULL, "%s", prefix); print_string(PRINT_FP, NULL, "backlog %s", sprint_size(q.backlog, b1)); print_uint(PRINT_ANY, "qlen", " %up", q.qlen); From b876b7e2b492fa14ce1f3db6c18bf22b2df10132 Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Fri, 30 Nov 2018 15:34:24 +0100 Subject: [PATCH 8/8] l2tp: Fix printing of cookie and peer_cookie values print_cookie() invocations miss %s format specifier. While at it, align printout to the previous lines. Fixes: 98453b65800f7 ("ip/l2tp: add JSON support") Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- ip/ipl2tp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c index 4308b591..f699b258 100644 --- a/ip/ipl2tp.c +++ b/ip/ipl2tp.c @@ -302,10 +302,11 @@ static void print_session(struct l2tp_data *data) print_uint(PRINT_FP, "peer_offset", " peer offset %u\n", 0); if (p->cookie_len > 0) - print_cookie("cookie", "cookie", + print_cookie("cookie", " cookie %s", p->cookie, p->cookie_len); + if (p->peer_cookie_len > 0) - print_cookie("peer_cookie", "peer cookie", + print_cookie("peer_cookie", " peer cookie %s", p->peer_cookie, p->peer_cookie_len); if (p->reorder_timeout != 0)