From 214299be7b501a055db14df71fdbebab8c6ed259 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 4 Dec 2019 10:42:32 -0800 Subject: [PATCH 1/8] uapi: update to magic.h Signed-off-by: Stephen Hemminger --- include/uapi/linux/magic.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h index 903cc2d2..3ac43637 100644 --- a/include/uapi/linux/magic.h +++ b/include/uapi/linux/magic.h @@ -94,5 +94,6 @@ #define ZSMALLOC_MAGIC 0x58295829 #define DMA_BUF_MAGIC 0x444d4142 /* "DMAB" */ #define Z3FOLD_MAGIC 0x33 +#define PPC_CMM_MAGIC 0xc7571590 #endif /* __LINUX_MAGIC_H__ */ From 81b365eb50e682cdcf7cd518100061d58eb5fb04 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 3 Dec 2019 07:47:01 -0800 Subject: [PATCH 2/8] tc_util: support TCA_STATS_PKT64 attribute Kernel exports 64bit packet counters for qdisc/class stats in linux-5.5 Tested: $ tc -s -d qd sh dev eth1 | grep pkt Sent 4041158922097 bytes 46393862190 pkt (dropped 0, overlimits 0 requeues 2072) Sent 501362903764 bytes 5762621697 pkt (dropped 0, overlimits 0 requeues 247) Sent 533282357858 bytes 6128246542 pkt (dropped 0, overlimits 0 requeues 329) Sent 515878280709 bytes 5875638916 pkt (dropped 0, overlimits 0 requeues 267) Sent 516221011694 bytes 5933395197 pkt (dropped 0, overlimits 0 requeues 258) Sent 513175109761 bytes 5898402114 pkt (dropped 0, overlimits 0 requeues 231) Sent 480207942964 bytes 5519535407 pkt (dropped 0, overlimits 0 requeues 229) Sent 483111196765 bytes 5552917950 pkt (dropped 0, overlimits 0 requeues 240) Sent 497920120322 bytes 5723104387 pkt (dropped 0, overlimits 0 requeues 271) $ tc -s -d cl sh dev eth1 | grep pkt Sent 513196316238 bytes 5898645862 pkt (dropped 0, overlimits 0 requeues 231) Sent 533304444981 bytes 6128500406 pkt (dropped 0, overlimits 0 requeues 329) Sent 480227709687 bytes 5519762597 pkt (dropped 0, overlimits 0 requeues 229) Sent 501383660279 bytes 5762860276 pkt (dropped 0, overlimits 0 requeues 247) Sent 483131168192 bytes 5553147506 pkt (dropped 0, overlimits 0 requeues 240) Sent 515899485505 bytes 5875882649 pkt (dropped 0, overlimits 0 requeues 267) Sent 497940747031 bytes 5723341475 pkt (dropped 0, overlimits 0 requeues 271) Sent 516242376893 bytes 5933640774 pkt (dropped 0, overlimits 0 requeues 258) Signed-off-by: Eric Dumazet Signed-off-by: Stephen Hemminger --- tc/tc_util.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tc/tc_util.c b/tc/tc_util.c index afdfc78f..23115f9b 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -809,11 +809,18 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat if (tbs[TCA_STATS_BASIC]) { struct gnet_stats_basic bs = {0}; + __u64 packets64 = 0; + + if (tbs[TCA_STATS_PKT64]) + packets64 = rta_getattr_u64(tbs[TCA_STATS_PKT64]); memcpy(&bs, RTA_DATA(tbs[TCA_STATS_BASIC]), MIN(RTA_PAYLOAD(tbs[TCA_STATS_BASIC]), sizeof(bs))); print_string(PRINT_FP, NULL, "%s", prefix); print_lluint(PRINT_ANY, "bytes", "Sent %llu bytes", bs.bytes); - print_uint(PRINT_ANY, "packets", " %u pkt", bs.packets); + if (packets64) + print_lluint(PRINT_ANY, "packets", " %llu pkt", packets64); + else + print_uint(PRINT_ANY, "packets", " %u pkt", bs.packets); } if (tbs[TCA_STATS_QUEUE]) { From 42060e8d352a7354535aba6ee233d697b26a29cc Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 4 Dec 2019 10:45:47 -0800 Subject: [PATCH 3/8] tc_util: break long lines Try to keep lines less than 100 characters or so. Signed-off-by: Stephen Hemminger --- tc/tc_util.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/tc/tc_util.c b/tc/tc_util.c index 23115f9b..0e70632d 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -814,19 +814,23 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat if (tbs[TCA_STATS_PKT64]) packets64 = rta_getattr_u64(tbs[TCA_STATS_PKT64]); - memcpy(&bs, RTA_DATA(tbs[TCA_STATS_BASIC]), MIN(RTA_PAYLOAD(tbs[TCA_STATS_BASIC]), sizeof(bs))); + memcpy(&bs, RTA_DATA(tbs[TCA_STATS_BASIC]), + MIN(RTA_PAYLOAD(tbs[TCA_STATS_BASIC]), sizeof(bs))); print_string(PRINT_FP, NULL, "%s", prefix); print_lluint(PRINT_ANY, "bytes", "Sent %llu bytes", bs.bytes); if (packets64) - print_lluint(PRINT_ANY, "packets", " %llu pkt", packets64); + print_lluint(PRINT_ANY, "packets", + " %llu pkt", packets64); else - print_uint(PRINT_ANY, "packets", " %u pkt", bs.packets); + print_uint(PRINT_ANY, "packets", + " %u pkt", bs.packets); } if (tbs[TCA_STATS_QUEUE]) { struct gnet_stats_queue q = {0}; - memcpy(&q, RTA_DATA(tbs[TCA_STATS_QUEUE]), MIN(RTA_PAYLOAD(tbs[TCA_STATS_QUEUE]), sizeof(q))); + memcpy(&q, RTA_DATA(tbs[TCA_STATS_QUEUE]), + MIN(RTA_PAYLOAD(tbs[TCA_STATS_QUEUE]), sizeof(q))); print_uint(PRINT_ANY, "drops", " (dropped %u", q.drops); print_uint(PRINT_ANY, "overlimits", ", overlimits %u", q.overlimits); @@ -862,7 +866,8 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat if (tbs[TCA_STATS_QUEUE]) { struct gnet_stats_queue q = {0}; - memcpy(&q, RTA_DATA(tbs[TCA_STATS_QUEUE]), MIN(RTA_PAYLOAD(tbs[TCA_STATS_QUEUE]), sizeof(q))); + 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", ""); print_uint(PRINT_JSON, "backlog", NULL, q.backlog); @@ -877,7 +882,8 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat *xstats = tbs[TCA_STATS_APP] ? : NULL; } -void print_tcstats_attr(FILE *fp, struct rtattr *tb[], char *prefix, struct rtattr **xstats) +void print_tcstats_attr(FILE *fp, struct rtattr *tb[], char *prefix, + struct rtattr **xstats) { SPRINT_BUF(b1); @@ -892,25 +898,29 @@ void print_tcstats_attr(FILE *fp, struct rtattr *tb[], char *prefix, struct rtat struct tc_stats st = {}; /* handle case where kernel returns more/less than we know about */ - memcpy(&st, RTA_DATA(tb[TCA_STATS]), MIN(RTA_PAYLOAD(tb[TCA_STATS]), sizeof(st))); + memcpy(&st, RTA_DATA(tb[TCA_STATS]), + MIN(RTA_PAYLOAD(tb[TCA_STATS]), sizeof(st))); - fprintf(fp, "%sSent %llu bytes %u pkts (dropped %u, overlimits %u) ", - prefix, (unsigned long long)st.bytes, st.packets, st.drops, - st.overlimits); + fprintf(fp, + "%sSent %llu bytes %u pkts (dropped %u, overlimits %u) ", + prefix, (unsigned long long)st.bytes, + st.packets, st.drops, st.overlimits); if (st.bps || st.pps || st.qlen || st.backlog) { fprintf(fp, "\n%s", prefix); if (st.bps || st.pps) { fprintf(fp, "rate "); if (st.bps) - fprintf(fp, "%s ", sprint_rate(st.bps, b1)); + fprintf(fp, "%s ", + sprint_rate(st.bps, b1)); if (st.pps) fprintf(fp, "%upps ", st.pps); } if (st.qlen || st.backlog) { fprintf(fp, "backlog "); if (st.backlog) - fprintf(fp, "%s ", sprint_size(st.backlog, b1)); + fprintf(fp, "%s ", + sprint_size(st.backlog, b1)); if (st.qlen) fprintf(fp, "%up ", st.qlen); } From 920700a425e51aff5782e7982b9a95d5a812b15d Mon Sep 17 00:00:00 2001 From: Gautam Ramakrishnan Date: Tue, 26 Nov 2019 17:28:07 +0530 Subject: [PATCH 4/8] tc: pie: add dq_rate_estimator option PIE now uses per packet timestamps to calculate queuing delay. The average dequeue rate based queue delay calculation is now made optional. This patch adds the option to enable or disable the use of Little's law to calculate queuing delay. Signed-off-by: Gautam Ramakrishnan Signed-off-by: Leslie Monis Signed-off-by: Mohit P. Tahiliani Signed-off-by: Stephen Hemminger --- bash-completion/tc | 1 + man/man8/tc-pie.8 | 31 ++++++++++++++++++++++++++----- tc/q_pie.c | 35 +++++++++++++++++++++++++++++------ 3 files changed, 56 insertions(+), 11 deletions(-) diff --git a/bash-completion/tc b/bash-completion/tc index 007e1c2e..fe0d51ec 100644 --- a/bash-completion/tc +++ b/bash-completion/tc @@ -323,6 +323,7 @@ _tc_qdisc_options() _tc_once_attr 'limit target tupdate alpha beta' _tc_one_of_list 'bytemode nobytemode' _tc_one_of_list 'ecn noecn' + _tc_one_of_list 'dq_rate_estimator no_dq_rate_estimator' return 0 ;; red) diff --git a/man/man8/tc-pie.8 b/man/man8/tc-pie.8 index a302132f..bdcfba51 100644 --- a/man/man8/tc-pie.8 +++ b/man/man8/tc-pie.8 @@ -21,6 +21,10 @@ int ] [ .B bytemode | .B nobytemode +] [ +.B dq_rate_estimator +| +.B no_dq_rate_estimator ] .SH DESCRIPTION @@ -71,7 +75,7 @@ alpha and beta are parameters chosen to control the drop probability. These should be in the range between 0 and 32. .SS ecn | noecn -is used to mark packets instead of dropping +is used to mark packets instead of dropping. .B ecn to turn on ecn mode, .B noecn @@ -80,7 +84,7 @@ to turn off ecn mode. By default, is turned off. .SS bytemode | nobytemode -is used to scale drop probability proportional to packet size +is used to scale drop probability proportional to packet size. .B bytemode to turn on bytemode, .B nobytemode @@ -88,21 +92,38 @@ to turn off bytemode. By default, .B bytemode is turned off. +.SS dq_rate_estimator | no_dq_rate_estimator +is used to calculate delay using Little's law. +.B dq_rate_estimator +to turn on dq_rate_estimator, +.B no_dq_rate_estimator +to turn off no_dq_rate_estimator. By default, +.B dq_rate_estimator +is turned off. + .SH EXAMPLES # tc qdisc add dev eth0 root pie # tc -s qdisc show qdisc pie 8036: dev eth0 root refcnt 2 limit 1000p target 15.0ms tupdate 16.0ms alpha 2 beta 20 Sent 31216108 bytes 20800 pkt (dropped 80, overlimits 0 requeues 0) backlog 16654b 11p requeues 0 - prob 0.006161 delay 15666us avg_dq_rate 1159667 + prob 0.006161 delay 15666us pkts_in 20811 overlimit 0 dropped 80 maxq 50 ecn_mark 0 + # tc qdisc add dev eth0 root pie dq_rate_estimator + # tc -s qdisc show + qdisc pie 8036: dev eth0 root refcnt 2 limit 1000p target 15.0ms tupdate 16.0ms alpha 2 beta 20 + Sent 63947420 bytes 42414 pkt (dropped 41, overlimits 0 requeues 0) + backlog 271006b 179p requeues 0 + prob 0.000092 delay 22200us avg_dq_rate 12145996 + pkts_in 41 overlimit 343 dropped 0 maxq 50 ecn_mark 0 + # tc qdisc add dev eth0 root pie limit 100 target 20ms tupdate 30ms ecn # tc -s qdisc show qdisc pie 8036: dev eth0 root refcnt 2 limit 100p target 20.0ms tupdate 32.0ms alpha 2 beta 20 ecn Sent 6591724 bytes 4442 pkt (dropped 27, overlimits 0 requeues 0) backlog 18168b 12p requeues 0 - prob 0.008845 delay 11348us avg_dq_rate 1342773 + prob 0.008845 delay 11348us pkts_in 4454 overlimit 0 dropped 27 maxq 65 ecn_mark 0 # tc qdisc add dev eth0 root pie limit 100 target 50ms tupdate 30ms bytemode @@ -110,7 +131,7 @@ is turned off. qdisc pie 8036: dev eth0 root refcnt 2 limit 100p target 50.0ms tupdate 32.0ms alpha 2 beta 20 bytemode Sent 1616274 bytes 1137 pkt (dropped 0, overlimits 0 requeues 0) backlog 13626b 9p requeues 0 - prob 0.000000 delay 0us avg_dq_rate 0 + prob 0.000000 delay 0us pkts_in 1146 overlimit 0 dropped 0 maxq 23 ecn_mark 0 .SH SEE ALSO diff --git a/tc/q_pie.c b/tc/q_pie.c index 40982f96..935548a2 100644 --- a/tc/q_pie.c +++ b/tc/q_pie.c @@ -31,9 +31,10 @@ static void explain(void) { fprintf(stderr, - "Usage: ... pie [ limit PACKETS ][ target TIME us]\n" - " [ tupdate TIME us][ alpha ALPHA ]" - "[beta BETA ][bytemode | nobytemode][ecn | noecn ]\n"); + "Usage: ... pie [ limit PACKETS ] [ target TIME ]\n" + " [ tupdate TIME ] [ alpha ALPHA ] [ beta BETA ]\n" + " [ bytemode | nobytemode ] [ ecn | noecn ]\n" + " [ dq_rate_estimator | no_dq_rate_estimator ]\n"); } #define ALPHA_MAX 32 @@ -49,6 +50,7 @@ static int pie_parse_opt(struct qdisc_util *qu, int argc, char **argv, unsigned int beta = 0; int ecn = -1; int bytemode = -1; + int dq_rate_estimator = -1; struct rtattr *tail; while (argc > 0) { @@ -92,6 +94,10 @@ static int pie_parse_opt(struct qdisc_util *qu, int argc, char **argv, bytemode = 1; } else if (strcmp(*argv, "nobytemode") == 0) { bytemode = 0; + } else if (strcmp(*argv, "dq_rate_estimator") == 0) { + dq_rate_estimator = 1; + } else if (strcmp(*argv, "no_dq_rate_estimator") == 0) { + dq_rate_estimator = 0; } else if (strcmp(*argv, "help") == 0) { explain(); return -1; @@ -120,6 +126,9 @@ static int pie_parse_opt(struct qdisc_util *qu, int argc, char **argv, if (bytemode != -1) addattr_l(n, 1024, TCA_PIE_BYTEMODE, &bytemode, sizeof(bytemode)); + if (dq_rate_estimator != -1) + addattr_l(n, 1024, TCA_PIE_DQ_RATE_ESTIMATOR, + &dq_rate_estimator, sizeof(dq_rate_estimator)); addattr_nest_end(n, tail); return 0; @@ -135,6 +144,7 @@ static int pie_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) unsigned int beta; unsigned int ecn; unsigned int bytemode; + unsigned int dq_rate_estimator; SPRINT_BUF(b1); @@ -182,6 +192,14 @@ static int pie_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) fprintf(f, "bytemode "); } + if (tb[TCA_PIE_DQ_RATE_ESTIMATOR] && + RTA_PAYLOAD(tb[TCA_PIE_DQ_RATE_ESTIMATOR]) >= sizeof(__u32)) { + dq_rate_estimator = + rta_getattr_u32(tb[TCA_PIE_DQ_RATE_ESTIMATOR]); + if (dq_rate_estimator) + fprintf(f, "dq_rate_estimator "); + } + return 0; } @@ -198,9 +216,14 @@ static int pie_print_xstats(struct qdisc_util *qu, FILE *f, st = RTA_DATA(xstats); /*prob is returned as a fracion of maximum integer value */ - fprintf(f, "prob %f delay %uus avg_dq_rate %u\n", - (double)st->prob / UINT64_MAX, st->delay, - st->avg_dq_rate); + fprintf(f, "prob %f delay %uus", + (double)st->prob / UINT64_MAX, st->delay); + + if (st->dq_rate_estimating) + fprintf(f, " avg_dq_rate %u\n", st->avg_dq_rate); + else + fprintf(f, "\n"); + fprintf(f, "pkts_in %u overlimit %u dropped %u maxq %u ecn_mark %u\n", st->packets_in, st->overlimit, st->dropped, st->maxq, st->ecn_mark); From 9ab56784a25ecc3763f48450aea98aca242da36f Mon Sep 17 00:00:00 2001 From: Bjarni Ingi Gislason Date: Mon, 2 Dec 2019 00:18:04 +0000 Subject: [PATCH 5/8] man: Fix unequal number of .RS and .RE macros Add missing or excessive ".RE" macros. Remove an excessive ".EE" macro. Signed-off-by: Bjarni Ingi Gislason Signed-off-by: Stephen Hemminger --- man/man7/tc-hfsc.7 | 1 + man/man8/devlink-dev.8 | 1 + man/man8/devlink-port.8 | 1 + man/man8/devlink-region.8 | 1 + man/man8/devlink-resource.8 | 1 + man/man8/devlink-sb.8 | 1 + man/man8/devlink-trap.8 | 1 + man/man8/ip-neighbour.8 | 1 + man/man8/ip-nexthop.8 | 2 -- man/man8/ip.8 | 1 - man/man8/rdma-statistic.8 | 1 + man/man8/tc-ctinfo.8 | 1 + man/man8/tc-police.8 | 1 + man/man8/tc-sample.8 | 3 --- man/man8/tc-simple.8 | 1 - man/man8/tc-skbmod.8 | 1 + man/man8/tc-u32.8 | 1 + man/man8/tc.8 | 1 + 18 files changed, 14 insertions(+), 7 deletions(-) diff --git a/man/man7/tc-hfsc.7 b/man/man7/tc-hfsc.7 index 5ae5e6b3..412b4c3b 100644 --- a/man/man7/tc-hfsc.7 +++ b/man/man7/tc-hfsc.7 @@ -56,6 +56,7 @@ RT \- realtime LS \- linkshare UL \- upperlimit SC \- service curve +.RE .fi . .SH "BASICS OF HFSC" diff --git a/man/man8/devlink-dev.8 b/man/man8/devlink-dev.8 index 2c6acbd3..289935db 100644 --- a/man/man8/devlink-dev.8 +++ b/man/man8/devlink-dev.8 @@ -262,6 +262,7 @@ Preparing to flash Flashing 100% .br Flashing done +.RE .SH SEE ALSO .BR devlink (8), diff --git a/man/man8/devlink-port.8 b/man/man8/devlink-port.8 index a639d01f..188bffb7 100644 --- a/man/man8/devlink-port.8 +++ b/man/man8/devlink-port.8 @@ -116,6 +116,7 @@ Split the specified devlink port into four ports. devlink port unsplit pci/0000:01:00.0/1 .RS 4 Unplit the specified previously split devlink port. +.RE .SH SEE ALSO .BR devlink (8), diff --git a/man/man8/devlink-region.8 b/man/man8/devlink-region.8 index ff10cdbd..c6756566 100644 --- a/man/man8/devlink-region.8 +++ b/man/man8/devlink-region.8 @@ -119,6 +119,7 @@ Dump the snapshot taken from cr-space address region with ID 1 devlink region read pci/0000:00:05.0/cr-space snapshot 1 address 0x10 legth 16 .RS 4 Read from address 0x10, 16 Bytes of snapshot ID 1 taken from cr-space address region +.RE .SH SEE ALSO .BR devlink (8), diff --git a/man/man8/devlink-resource.8 b/man/man8/devlink-resource.8 index b8f78806..8c315807 100644 --- a/man/man8/devlink-resource.8 +++ b/man/man8/devlink-resource.8 @@ -66,6 +66,7 @@ Shows the resources of the specified devlink device. devlink resource set pci/0000:01:00.0 /kvd/linear 98304 .RS 4 Sets the size of the specified resource for the specified devlink device. +.RE .SH SEE ALSO .BR devlink (8), diff --git a/man/man8/devlink-sb.8 b/man/man8/devlink-sb.8 index 91b68189..5a5a9bb9 100644 --- a/man/man8/devlink-sb.8 +++ b/man/man8/devlink-sb.8 @@ -310,6 +310,7 @@ Show occupancy for specified port from the snapshot. sudo devlink sb occupancy clearmax pci/0000:03:00.0 .RS 4 Clear watermarks for shared buffer of specified devlink device. +.RE .SH SEE ALSO diff --git a/man/man8/devlink-trap.8 b/man/man8/devlink-trap.8 index 4f079eb8..db19fe4c 100644 --- a/man/man8/devlink-trap.8 +++ b/man/man8/devlink-trap.8 @@ -127,6 +127,7 @@ Show attributes and statistics of a specific packet trap group. devlink trap set pci/0000:01:00.0 trap source_mac_is_multicast action trap .RS 4 Set the action of a specific packet trap to 'trap'. +.RE .SH SEE ALSO .BR devlink (8), diff --git a/man/man8/ip-neighbour.8 b/man/man8/ip-neighbour.8 index bc77b439..f71f18b1 100644 --- a/man/man8/ip-neighbour.8 +++ b/man/man8/ip-neighbour.8 @@ -253,6 +253,7 @@ the prefix selecting the neighbour to query. .TP .BI dev " NAME" get neighbour entry attached to this device. +.RE .SH EXAMPLES .PP diff --git a/man/man8/ip-nexthop.8 b/man/man8/ip-nexthop.8 index da87ca3b..68164f3c 100644 --- a/man/man8/ip-nexthop.8 +++ b/man/man8/ip-nexthop.8 @@ -130,7 +130,6 @@ create a blackhole nexthop .TP ip nexthop delete id ID delete nexthop with given id. -.RE .TP ip nexthop show @@ -154,7 +153,6 @@ show only nexthop groups ip nexthop flush flushes nexthops selected by some criteria. Criteria options are the same as show. -.RE .TP ip nexthop get id ID diff --git a/man/man8/ip.8 b/man/man8/ip.8 index e2bda2a2..1661aa67 100644 --- a/man/man8/ip.8 +++ b/man/man8/ip.8 @@ -382,7 +382,6 @@ Bring up interface x. .RE .PP ip link set x down -.RE .RS 4 Bring down interface x. .RE diff --git a/man/man8/rdma-statistic.8 b/man/man8/rdma-statistic.8 index 541b5d63..e3f4b51b 100644 --- a/man/man8/rdma-statistic.8 +++ b/man/man8/rdma-statistic.8 @@ -162,6 +162,7 @@ List all currently allocated MR's and their counters. rdma statistic show mr mrn 6 .RS 4 Dump a specific MR statistics with mrn 6. Dumps nothing if does not exists. +.RE .SH SEE ALSO .BR rdma (8), diff --git a/man/man8/tc-ctinfo.8 b/man/man8/tc-ctinfo.8 index 9015b844..5b761a8f 100644 --- a/man/man8/tc-ctinfo.8 +++ b/man/man8/tc-ctinfo.8 @@ -161,6 +161,7 @@ tc -s filter show dev eth0 Sent 32890260 bytes 120441 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 .br +.RE .SH SEE ALSO .BR tc (8), .BR tc-cake (8) diff --git a/man/man8/tc-police.8 b/man/man8/tc-police.8 index bcc5f438..52279755 100644 --- a/man/man8/tc-police.8 +++ b/man/man8/tc-police.8 @@ -116,6 +116,7 @@ continue with the next filter in line (if any). This is the default for exceeding packets. .IP pipe Pass the packet to the next action in line. +.RE .SH EXAMPLES A typical application of the police action is to enforce ingress traffic rate by dropping exceeding packets. Although better done on the sender's side, diff --git a/man/man8/tc-sample.8 b/man/man8/tc-sample.8 index 3e03eba2..c4277caf 100644 --- a/man/man8/tc-sample.8 +++ b/man/man8/tc-sample.8 @@ -67,7 +67,6 @@ group .TP .BI PSAMPLE_ATTR_SAMPLE_RATE The rate the packet was sampled with -.RE .SH OPTIONS .TP @@ -117,8 +116,6 @@ tc filter add dev eth1 parent ffff: matchall \\ .EE .RE -.EE -.RE .SH SEE ALSO .BR tc (8), .BR tc-matchall (8) diff --git a/man/man8/tc-simple.8 b/man/man8/tc-simple.8 index 7363ab56..f565755e 100644 --- a/man/man8/tc-simple.8 +++ b/man/man8/tc-simple.8 @@ -54,7 +54,6 @@ grep the logs to see the logged message .IP 6) 4 display stats again and observe increment by 1 -.RE .EX hadi@noma1:$ tc qdisc add dev eth0 ingress hadi@noma1:$tc filter add dev eth0 parent ffff: protocol ip prio 5 \\ diff --git a/man/man8/tc-skbmod.8 b/man/man8/tc-skbmod.8 index 46418b65..eb3c38fa 100644 --- a/man/man8/tc-skbmod.8 +++ b/man/man8/tc-skbmod.8 @@ -75,6 +75,7 @@ Continue classification with the next filter in line. .B pass Finish classification process and return to calling qdisc for further packet processing. This is the default. +.RE .SH EXAMPLES To start, observe the following filter with a pedit action: diff --git a/man/man8/tc-u32.8 b/man/man8/tc-u32.8 index 2bf2e3e9..a23a1846 100644 --- a/man/man8/tc-u32.8 +++ b/man/man8/tc-u32.8 @@ -490,6 +490,7 @@ Match on source or destination ethernet address. This is dangerous: It assumes an ethernet header is present at the start of the packet. This will probably lead to unexpected things if used with layer three interfaces like e.g. tun or ppp. +.RE .SH EXAMPLES .RS .EX diff --git a/man/man8/tc.8 b/man/man8/tc.8 index b81a396f..d25aadda 100644 --- a/man/man8/tc.8 +++ b/man/man8/tc.8 @@ -828,6 +828,7 @@ Shows classes as ASCII graph on eth0 interface. tc -g -s class show dev eth0 .RS 4 Shows classes as ASCII graph with stats info under each class. +.RE .SH HISTORY .B tc From cad1b0bc5f12be7c3b5a1a4c1b55646a0766c9a8 Mon Sep 17 00:00:00 2001 From: Brian Vazquez Date: Tue, 26 Nov 2019 21:19:34 -0800 Subject: [PATCH 6/8] tc: fix warning in tc/m_ct.c Warning was: m_ct.c:370:13: warning: variable 'nat' is used uninitialized whenever 'if' condition is false Cc: Paul Blakey Fixes: c8a494314c40 ("tc: Introduce tc ct action") Signed-off-by: Brian Vazquez Signed-off-by: Stephen Hemminger --- tc/m_ct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/m_ct.c b/tc/m_ct.c index 8df2f610..45fa4a8c 100644 --- a/tc/m_ct.c +++ b/tc/m_ct.c @@ -359,7 +359,7 @@ static void ct_print_nat(int ct_action, struct rtattr **tb) { size_t done = 0; char out[256] = ""; - bool nat; + bool nat = false; if (!(ct_action & TCA_CT_ACT_NAT)) return; From 908985c6709b6c0673501d61748c080889382d4f Mon Sep 17 00:00:00 2001 From: Brian Vazquez Date: Wed, 4 Dec 2019 13:32:03 -0800 Subject: [PATCH 7/8] tc: fix warning in tc/q_pie.c Warning was: q_pie.c:202:22: error: implicit conversion from 'unsigned long' to 'double' Fixes: 492ec9558b30 ("tc: pie: change maximum integer value of tc_pie_xstats->prob") Cc: Leslie Monis Signed-off-by: Brian Vazquez Signed-off-by: Stephen Hemminger --- tc/q_pie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/q_pie.c b/tc/q_pie.c index 935548a2..fda98a71 100644 --- a/tc/q_pie.c +++ b/tc/q_pie.c @@ -217,7 +217,7 @@ static int pie_print_xstats(struct qdisc_util *qu, FILE *f, st = RTA_DATA(xstats); /*prob is returned as a fracion of maximum integer value */ fprintf(f, "prob %f delay %uus", - (double)st->prob / UINT64_MAX, st->delay); + (double)st->prob / (double)UINT64_MAX, st->delay); if (st->dq_rate_estimating) fprintf(f, " avg_dq_rate %u\n", st->avg_dq_rate); From 9eee92a41ae630b2c9e92ae2875ca56801c96b73 Mon Sep 17 00:00:00 2001 From: Brian Vazquez Date: Wed, 4 Dec 2019 13:32:28 -0800 Subject: [PATCH 8/8] ss: fix end-of-line printing in misc/ss.c The previous change to ss to show header broke the printing of end-of-line for the last entry. Tested: diff <(./ss.old -nltp) <(misc/ss -nltp) 38c38 < LISTEN 0 128 [::1]:35417 [::]:* users:(("foo",pid=65254,fd=116)) \ No newline at end of file Signed-off-by: Stephen Hemminger --- misc/ss.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/ss.c b/misc/ss.c index c58e5c4d..95f1d37a 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -1290,6 +1290,11 @@ static void render(void) token = buf_token_next(token); } + /* Deal with final end-of-line when the last non-empty field printed + * is not the last field. + */ + if (line_started) + printf("\n"); buf_free_all(); current_field = columns;