netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iproute2] minor tc cleanup patches
@ 2010-01-12 20:34 Florian Westphal
  2010-01-12 20:39 ` [PATCH 1/5] tc: man: add limit parameter to tc-sfq man page Florian Westphal
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Florian Westphal @ 2010-01-12 20:34 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, kaber

Hello Stephen, hello Patrick,

here are 5 minor patches for iproute2/tc:
the first two are small man page adjustments.
The 3rd one makes tc print a more verbose error message instead of -EINVAL.

The 4th is a janitorial patch that removes some stale (c&p) code.

Last patch adds a man page for sched_drr.
Patrick, it would be nice if you could have a look at this one to see
if I got everything right (or if i forgot something important).

Thanks a lot!

Alternatively, you may pull from

git://git.breakpoint.cc/fw/iproute2.git cleanups

to obtain the following changes since commit
d63a9b2b1e4e3eab0d0577d0a0f412d50be1e0a7:
  Arnd Bergmann (1):
        iproute2/iplink: add macvlan options for bridge mode

Florian Westphal (5):
      tc: man: add limit parameter to tc-sfq man page
      tc: man: SO_PRIORITY is described in socket documentation, not tc one
      tc: red, gred, tbf: more helpful error messages
      tc: remove stale code
      tc: man: add man page for drr scheduler

 man/man8/tc-drr.8  |   89 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 man/man8/tc-prio.8 |    2 +-
 man/man8/tc-sfq.8  |    3 ++
 man/man8/tc.8      |    1 +
 tc/f_fw.c          |    2 -
 tc/f_route.c       |    2 -
 tc/f_rsvp.c        |    2 -
 tc/f_tcindex.c     |    4 --
 tc/f_u32.c         |    2 -
 tc/q_atm.c         |    2 -
 tc/q_cbq.c         |    3 +-
 tc/q_drr.c         |    1 -
 tc/q_dsmark.c      |    3 --
 tc/q_fifo.c        |    2 -
 tc/q_gred.c        |    7 +---
 tc/q_htb.c         |    2 -
 tc/q_ingress.c     |    2 -
 tc/q_multiq.c      |    2 -
 tc/q_netem.c       |    2 -
 tc/q_prio.c        |    4 --
 tc/q_red.c         |   16 +---------
 tc/q_rr.c          |    3 --
 tc/q_sfq.c         |    2 -
 tc/q_tbf.c         |    8 ++--
 24 files changed, 101 insertions(+), 65 deletions(-)
 create mode 100644 man/man8/tc-drr.8

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

* [PATCH 1/5] tc: man: add limit parameter to tc-sfq man page
  2010-01-12 20:34 [iproute2] minor tc cleanup patches Florian Westphal
@ 2010-01-12 20:39 ` Florian Westphal
  2010-01-12 20:43 ` [PATCH 2/5] tc: man: SO_PRIORITY is described in socket documentation, not tc one Florian Westphal
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Florian Westphal @ 2010-01-12 20:39 UTC (permalink / raw)
  To: netdev; +Cc: shemminger, Florian Westphal

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 man/man8/tc-sfq.8 |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/man/man8/tc-sfq.8 b/man/man8/tc-sfq.8
index 337c795..8f2b433 100644
--- a/man/man8/tc-sfq.8
+++ b/man/man8/tc-sfq.8
@@ -51,6 +51,9 @@ on the fullest bucket, thus maintaining fairness.
 
 .SH PARAMETERS
 .TP 
+limit
+Upper limit of the SFQ. Can be used to reduce the default length of 128 packets.
+.TP
 perturb
 Interval in seconds for queue algorithm perturbation. Defaults to 0, which means that 
 no perturbation occurs. Do not set too low for each perturbation may cause some packet
-- 
1.6.4.4


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

* [PATCH 2/5] tc: man: SO_PRIORITY is described in socket documentation, not tc one
  2010-01-12 20:34 [iproute2] minor tc cleanup patches Florian Westphal
  2010-01-12 20:39 ` [PATCH 1/5] tc: man: add limit parameter to tc-sfq man page Florian Westphal
@ 2010-01-12 20:43 ` Florian Westphal
  2010-01-12 20:44 ` [PATCH 3/5] tc: red, gred, tbf: more helpful error messages Florian Westphal
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Florian Westphal @ 2010-01-12 20:43 UTC (permalink / raw)
  To: netdev; +Cc: shemminger, Florian Westphal

fix up reference: there is no tc(7) man page.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 man/man8/tc-prio.8 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/man/man8/tc-prio.8 b/man/man8/tc-prio.8
index 780bcd5..1625fcc 100644
--- a/man/man8/tc-prio.8
+++ b/man/man8/tc-prio.8
@@ -50,7 +50,7 @@ be enqueued.
 From userspace
 A process with sufficient privileges can encode the destination class
 directly with SO_PRIORITY, see
-.BR tc(7).
+.BR socket(7).
 .TP 
 with a tc filter
 A tc filter attached to the root qdisc can point traffic directly to a class
-- 
1.6.4.4


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

* [PATCH 3/5] tc: red, gred, tbf: more helpful error messages
  2010-01-12 20:34 [iproute2] minor tc cleanup patches Florian Westphal
  2010-01-12 20:39 ` [PATCH 1/5] tc: man: add limit parameter to tc-sfq man page Florian Westphal
  2010-01-12 20:43 ` [PATCH 2/5] tc: man: SO_PRIORITY is described in socket documentation, not tc one Florian Westphal
@ 2010-01-12 20:44 ` Florian Westphal
  2010-01-12 20:45 ` [PATCH 4/5] tc: remove stale code Florian Westphal
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Florian Westphal @ 2010-01-12 20:44 UTC (permalink / raw)
  To: netdev; +Cc: shemminger, Florian Westphal

$ tc qdisc add dev eth1 root tbf
RTNETLINK answers: Invalid argument

$ tc qdisc add dev eth1 root red
RTNETLINK answers: Invalid argument

with patch:
$ tc qdisc add dev eth1 root red
Required parameter (min, max, burst, limit, avpkt) is missing

$ tc qdisc add dev eth1 root tbf
Usage: ... tbf limit BYTES burst BYTES[/BYTES] rate KBPS ...

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tc/q_gred.c |    5 +----
 tc/q_red.c  |   14 +-------------
 tc/q_tbf.c  |    6 ++++--
 3 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/tc/q_gred.c b/tc/q_gred.c
index ecef42e..ab26801 100644
--- a/tc/q_gred.c
+++ b/tc/q_gred.c
@@ -215,16 +215,13 @@ static int gred_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
 		argc--; argv++;
 	}
 
-	if (!ok)
-		return 0;
-
 	if (rate == 0)
 		get_rate(&rate, "10Mbit");
 
 	if (!opt.qth_min || !opt.qth_max || !burst || !opt.limit || !avpkt ||
 	    (opt.DP<0)) {
 		fprintf(stderr, "Required parameter (min, max, burst, limit, "
-		    "avpket, DP) is missing\n");
+		    "avpkt, DP) is missing\n");
 		return -1;
 	}
 
diff --git a/tc/q_red.c b/tc/q_red.c
index 6f93b26..3ba6bc7 100644
--- a/tc/q_red.c
+++ b/tc/q_red.c
@@ -35,7 +35,6 @@ static void explain(void)
 
 static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
-	int ok=0;
 	struct tc_red_qopt opt;
 	unsigned burst = 0;
 	unsigned avpkt = 0;
@@ -55,52 +54,44 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
 				fprintf(stderr, "Illegal \"limit\"\n");
 				return -1;
 			}
-			ok++;
 		} else if (strcmp(*argv, "min") == 0) {
 			NEXT_ARG();
 			if (get_size(&opt.qth_min, *argv)) {
 				fprintf(stderr, "Illegal \"min\"\n");
 				return -1;
 			}
-			ok++;
 		} else if (strcmp(*argv, "max") == 0) {
 			NEXT_ARG();
 			if (get_size(&opt.qth_max, *argv)) {
 				fprintf(stderr, "Illegal \"max\"\n");
 				return -1;
 			}
-			ok++;
 		} else if (strcmp(*argv, "burst") == 0) {
 			NEXT_ARG();
 			if (get_unsigned(&burst, *argv, 0)) {
 				fprintf(stderr, "Illegal \"burst\"\n");
 				return -1;
 			}
-			ok++;
 		} else if (strcmp(*argv, "avpkt") == 0) {
 			NEXT_ARG();
 			if (get_size(&avpkt, *argv)) {
 				fprintf(stderr, "Illegal \"avpkt\"\n");
 				return -1;
 			}
-			ok++;
 		} else if (strcmp(*argv, "probability") == 0) {
 			NEXT_ARG();
 			if (sscanf(*argv, "%lg", &probability) != 1) {
 				fprintf(stderr, "Illegal \"probability\"\n");
 				return -1;
 			}
-			ok++;
 		} else if (strcmp(*argv, "bandwidth") == 0) {
 			NEXT_ARG();
 			if (get_rate(&rate, *argv)) {
 				fprintf(stderr, "Illegal \"bandwidth\"\n");
 				return -1;
 			}
-			ok++;
 		} else if (strcmp(*argv, "ecn") == 0) {
 			ecn_ok = 1;
-			ok++;
 		} else if (strcmp(*argv, "help") == 0) {
 			explain();
 			return -1;
@@ -112,14 +103,11 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
 		argc--; argv++;
 	}
 
-	if (!ok)
-		return 0;
-
 	if (rate == 0)
 		get_rate(&rate, "10Mbit");
 
 	if (!opt.qth_min || !opt.qth_max || !burst || !opt.limit || !avpkt) {
-		fprintf(stderr, "Required parameter (min, max, burst, limit, avpket) is missing\n");
+		fprintf(stderr, "Required parameter (min, max, burst, limit, avpkt) is missing\n");
 		return -1;
 	}
 
diff --git a/tc/q_tbf.c b/tc/q_tbf.c
index dbf9586..06ccda3 100644
--- a/tc/q_tbf.c
+++ b/tc/q_tbf.c
@@ -158,8 +158,10 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
 		argc--; argv++;
 	}
 
-	if (!ok)
-		return 0;
+	if (!ok) {
+		explain();
+		return -1;
+	}
 
 	if (opt.rate.rate == 0 || !buffer) {
 		fprintf(stderr, "Both \"rate\" and \"burst\" are required.\n");
-- 
1.6.4.4


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

* [PATCH 4/5] tc: remove stale code
  2010-01-12 20:34 [iproute2] minor tc cleanup patches Florian Westphal
                   ` (2 preceding siblings ...)
  2010-01-12 20:44 ` [PATCH 3/5] tc: red, gred, tbf: more helpful error messages Florian Westphal
@ 2010-01-12 20:45 ` Florian Westphal
  2010-01-12 20:45 ` [PATCH 5/5] tc: man: add man page for drr scheduler Florian Westphal
  2010-01-21 18:13 ` [iproute2] minor tc cleanup patches Stephen Hemminger
  5 siblings, 0 replies; 12+ messages in thread
From: Florian Westphal @ 2010-01-12 20:45 UTC (permalink / raw)
  To: netdev; +Cc: shemminger

remove unused #define and "ok" statements.

Signed-off-by: Florian Westphal <fwestphal@astaro.com>
---
 tc/f_fw.c      |    2 --
 tc/f_route.c   |    2 --
 tc/f_rsvp.c    |    2 --
 tc/f_tcindex.c |    4 ----
 tc/f_u32.c     |    2 --
 tc/q_atm.c     |    2 --
 tc/q_cbq.c     |    3 +--
 tc/q_drr.c     |    1 -
 tc/q_dsmark.c  |    3 ---
 tc/q_fifo.c    |    2 --
 tc/q_gred.c    |    2 --
 tc/q_htb.c     |    2 --
 tc/q_ingress.c |    2 --
 tc/q_multiq.c  |    2 --
 tc/q_netem.c   |    2 --
 tc/q_prio.c    |    4 ----
 tc/q_red.c     |    2 --
 tc/q_rr.c      |    3 ---
 tc/q_sfq.c     |    2 --
 tc/q_tbf.c     |    2 --
 20 files changed, 1 insertions(+), 45 deletions(-)

diff --git a/tc/f_fw.c b/tc/f_fw.c
index cc8ea2d..219b404 100644
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -31,8 +31,6 @@ static void explain(void)
 	fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
 }
 
-#define usage() return(-1)
-
 static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n)
 {
 	struct tc_police tp;
diff --git a/tc/f_route.c b/tc/f_route.c
index 67dd49c..eccf924 100644
--- a/tc/f_route.c
+++ b/tc/f_route.c
@@ -34,8 +34,6 @@ static void explain(void)
 	fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
 }
 
-#define usage() return(-1)
-
 static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n)
 {
 	struct tc_police tp;
diff --git a/tc/f_rsvp.c b/tc/f_rsvp.c
index 7e1e6d9..808310d 100644
--- a/tc/f_rsvp.c
+++ b/tc/f_rsvp.c
@@ -37,8 +37,6 @@ static void explain(void)
 	fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
 }
 
-#define usage() return(-1)
-
 int get_addr_and_pi(int *argc_p, char ***argv_p, inet_prefix * addr,
 		    struct tc_rsvp_pinfo *pinfo, int dir, int family)
 {
diff --git a/tc/f_tcindex.c b/tc/f_tcindex.c
index 39ac75a..cb6f854 100644
--- a/tc/f_tcindex.c
+++ b/tc/f_tcindex.c
@@ -24,10 +24,6 @@ static void explain(void)
 	    "[ police POLICE_SPEC ]\n");
 }
 
-
-#define usage() return(-1)
-
-
 static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
     char **argv, struct nlmsghdr *n)
 {
diff --git a/tc/f_u32.c b/tc/f_u32.c
index cb3f67e..4f5f74e 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -45,8 +45,6 @@ static void explain(void)
 	fprintf(stderr, "\nNOTE: CLASSID is parsed at hexadecimal input.\n");
 }
 
-#define usage() return(-1)
-
 int get_u32_handle(__u32 *handle, const char *str)
 {
 	__u32 htid=0, hash=0, nodeid=0;
diff --git a/tc/q_atm.c b/tc/q_atm.c
index 4c8dc0b..eec0d77 100644
--- a/tc/q_atm.c
+++ b/tc/q_atm.c
@@ -26,8 +26,6 @@
 
 #define MAX_HDR_LEN 64
 
-#define usage() return(-1)
-
 
 static int atm_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
diff --git a/tc/q_cbq.c b/tc/q_cbq.c
index c99dc3b..3c5e72c 100644
--- a/tc/q_cbq.c
+++ b/tc/q_cbq.c
@@ -46,7 +46,6 @@ static void explain1(char *arg)
 	fprintf(stderr, "Illegal \"%s\"\n", arg);
 }
 
-#define usage() return(-1)
 
 static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
@@ -319,7 +318,7 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
 			NEXT_ARG();
 			if (get_tc_classid(&fopt.split, *argv)) {
 				fprintf(stderr, "Invalid split node ID.\n");
-				usage();
+				return -1;
 			}
 			fopt_ok++;
 		} else if (matches(*argv, "defmap") == 0) {
diff --git a/tc/q_drr.c b/tc/q_drr.c
index 7d2d874..81de44d 100644
--- a/tc/q_drr.c
+++ b/tc/q_drr.c
@@ -33,7 +33,6 @@ static void explain2(void)
 	fprintf(stderr, "Usage: ... drr quantum SIZE\n");
 }
 
-#define usage() return(-1)
 
 static int drr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
diff --git a/tc/q_dsmark.c b/tc/q_dsmark.c
index cdb5bf2..cfbb335 100644
--- a/tc/q_dsmark.c
+++ b/tc/q_dsmark.c
@@ -19,9 +19,6 @@
 #include "tc_util.h"
 
 
-#define usage() return(-1)
-
-
 static void explain(void)
 {
 	fprintf(stderr,"Usage: dsmark indices INDICES [ default_index "
diff --git a/tc/q_fifo.c b/tc/q_fifo.c
index 9f3b3eb..f561752 100644
--- a/tc/q_fifo.c
+++ b/tc/q_fifo.c
@@ -28,8 +28,6 @@ static void explain(void)
 	fprintf(stderr, "Usage: ... [p|b]fifo [ limit NUMBER ]\n");
 }
 
-#define usage() return(-1)
-
 static int fifo_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
 	int ok=0;
diff --git a/tc/q_gred.c b/tc/q_gred.c
index ab26801..df4aa3d 100644
--- a/tc/q_gred.c
+++ b/tc/q_gred.c
@@ -46,8 +46,6 @@ static void explain(void)
 	    "[grio]\n");
 }
 
-#define usage() return(-1)
-
 static int init_gred(struct qdisc_util *qu, int argc, char **argv, 
 		     struct nlmsghdr *n)
 {
diff --git a/tc/q_htb.c b/tc/q_htb.c
index c69e350..caa47c2 100644
--- a/tc/q_htb.c
+++ b/tc/q_htb.c
@@ -58,8 +58,6 @@ static void explain1(char *arg)
 }
 
 
-#define usage() return(-1)
-
 static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
 	struct tc_htb_glob opt;
diff --git a/tc/q_ingress.c b/tc/q_ingress.c
index 71fbd49..ba58e72 100644
--- a/tc/q_ingress.c
+++ b/tc/q_ingress.c
@@ -32,8 +32,6 @@ static void explain(void)
 	fprintf(stderr, "Usage: ... ingress \n");
 }
 
-#define usage() return(-1)
-
 static int ingress_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
 
diff --git a/tc/q_multiq.c b/tc/q_multiq.c
index 306e170..fce5e44 100644
--- a/tc/q_multiq.c
+++ b/tc/q_multiq.c
@@ -41,8 +41,6 @@ static void explain(void)
 	fprintf(stderr, "Usage: ... multiq [help]\n");
 }
 
-#define usage() return(-1)
-
 static int multiq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 			    struct nlmsghdr *n)
 {
diff --git a/tc/q_netem.c b/tc/q_netem.c
index 33b3d2a..6aaaded 100644
--- a/tc/q_netem.c
+++ b/tc/q_netem.c
@@ -42,8 +42,6 @@ static void explain1(const char *arg)
 	fprintf(stderr, "Illegal \"%s\"\n", arg);
 }
 
-#define usage() return(-1)
-
 /* Upper bound on size of distribution 
  *  really (TCA_BUF_MAX - other headers) / sizeof (__s16)
  */
diff --git a/tc/q_prio.c b/tc/q_prio.c
index 31a37cd..2f54d55 100644
--- a/tc/q_prio.c
+++ b/tc/q_prio.c
@@ -28,11 +28,8 @@ static void explain(void)
 	fprintf(stderr, "Usage: ... prio bands NUMBER priomap P1 P2...[multiqueue]\n");
 }
 
-#define usage() return(-1)
-
 static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
-	int ok=0;
 	int pmap_mode = 0;
 	int idx = 0;
 	struct tc_prio_qopt opt={3,{ 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }};
@@ -48,7 +45,6 @@ static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
 				fprintf(stderr, "Illegal \"bands\"\n");
 				return -1;
 			}
-			ok++;
 		} else if (strcmp(*argv, "priomap") == 0) {
 			if (pmap_mode) {
 				fprintf(stderr, "Error: duplicate priomap\n");
diff --git a/tc/q_red.c b/tc/q_red.c
index 3ba6bc7..4b1b889 100644
--- a/tc/q_red.c
+++ b/tc/q_red.c
@@ -31,8 +31,6 @@ static void explain(void)
 	fprintf(stderr, "               probability PROBABILITY bandwidth KBPS [ ecn ]\n");
 }
 
-#define usage() return(-1)
-
 static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
 	struct tc_red_qopt opt;
diff --git a/tc/q_rr.c b/tc/q_rr.c
index 9bb8c7d..1ff3ac9 100644
--- a/tc/q_rr.c
+++ b/tc/q_rr.c
@@ -28,11 +28,9 @@ static void explain(void)
 	fprintf(stderr, "Usage: ... rr bands NUMBER priomap P1 P2... [multiqueue]\n");
 }
 
-#define usage() return(-1)
 
 static int rr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
-	int ok = 0;
 	int pmap_mode = 0;
 	int idx = 0;
 	struct tc_prio_qopt opt={3,{ 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }};
@@ -48,7 +46,6 @@ static int rr_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlm
 				fprintf(stderr, "Illegal \"bands\"\n");
 				return -1;
 			}
-			ok++;
 		} else if (strcmp(*argv, "priomap") == 0) {
 			if (pmap_mode) {
 				fprintf(stderr, "Error: duplicate priomap\n");
diff --git a/tc/q_sfq.c b/tc/q_sfq.c
index ce4dade..71a3c9a 100644
--- a/tc/q_sfq.c
+++ b/tc/q_sfq.c
@@ -28,8 +28,6 @@ static void explain(void)
 	fprintf(stderr, "Usage: ... sfq [ limit NUMBER ] [ perturb SECS ] [ quantum BYTES ]\n");
 }
 
-#define usage() return(-1)
-
 static int sfq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
 	int ok=0;
diff --git a/tc/q_tbf.c b/tc/q_tbf.c
index 06ccda3..dc556fe 100644
--- a/tc/q_tbf.c
+++ b/tc/q_tbf.c
@@ -36,8 +36,6 @@ static void explain1(char *arg)
 }
 
 
-#define usage() return(-1)
-
 static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
 {
 	int ok=0;
-- 
1.6.4.4


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

* [PATCH 5/5] tc: man: add man page for drr scheduler
  2010-01-12 20:34 [iproute2] minor tc cleanup patches Florian Westphal
                   ` (3 preceding siblings ...)
  2010-01-12 20:45 ` [PATCH 4/5] tc: remove stale code Florian Westphal
@ 2010-01-12 20:45 ` Florian Westphal
  2010-01-13  5:34   ` Patrick McHardy
  2010-01-18 22:54   ` [PATCH 5/5 v2] " Florian Westphal
  2010-01-21 18:13 ` [iproute2] minor tc cleanup patches Stephen Hemminger
  5 siblings, 2 replies; 12+ messages in thread
From: Florian Westphal @ 2010-01-12 20:45 UTC (permalink / raw)
  To: netdev; +Cc: shemminger, Patrick McHardy, Florian Westphal

Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 man/man8/tc-drr.8 |   89 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 man/man8/tc.8     |    1 +
 2 files changed, 90 insertions(+), 0 deletions(-)
 create mode 100644 man/man8/tc-drr.8

diff --git a/man/man8/tc-drr.8 b/man/man8/tc-drr.8
new file mode 100644
index 0000000..5fcb0eb
--- /dev/null
+++ b/man/man8/tc-drr.8
@@ -0,0 +1,89 @@
+.TH TC 8 "January 2010" "iproute2" "Linux"
+.SH NAME
+drr \- deficit round robin scheduler
+.SH SYNOPSIS
+.B tc qdisc ... add drr
+.B [ quantum
+bytes
+.B ]
+
+.SH DESCRIPTION
+
+The Deficit Round Robin Scheduler is a classful queuing discipline as
+a more flexible replacement for Stochastic Fairness Queuing.
+
+Unlike SFQ, there are no built-in queues \-\- you need to add classes
+and then set up filters to classify packets accordingly.
+This can be useful e.g. for using RED qdiscs with different settings for particular
+traffic. There is no default class \-\- if a packet cannot be classified,
+it is dropped.
+
+.SH ALGORITHM
+Each class is assigned a deficit counter, initialized to
+.B quantum.
+
+DRR maintains an (internal) ''active'' list of classes whose qdiscs are
+non-empty.  This list is used for dequeuing.  A packet is dequeued from
+the class at the head of the list if the packet size is smaller or equal
+to the deficit counter.  If the counter is too small, it is increased by
+.B quantum
+and the scheduler moves on to the next class in the active list.
+
+
+.SH PARAMETERS
+.TP
+quantum
+Amount of bytes a flow is allowed to dequeue before the scheduler moves to the next.
+Defaults to the MTU of the interface. The minimum value is 1.
+
+.SH EXAMPLE & USAGE
+
+To attach to device eth0, using the interface MTU as its quantum:
+.P
+# tc qdisc add dev eth0 handle 1 root drr
+.P
+Adding two classes:
+.P
+# tc class add dev eth0 parent 1: classid 1:1 drr
+# tc class add dev eth0 parent 1: classid 1:2 drr
+.P
+You also need to add at least one filter to classify packets.
+.P
+# tc filter add dev eth0 protocol .. classid 1:1
+.P
+
+Like SFQ, DRR is only useful when it owns the queue \-\- it is a pure scheduler and does
+not delay packets.  Attaching non-work-conserving qdiscs like tbf to it does not make
+sense \-\- other qdiscs in the active list will also become inactive until the dequeue
+operation succeeds.  Embed DRR within another qdisc like HTB or HFSC to ensure it owns the queue.
+.P
+You can mimic SFQ behavior by assigning packets to the attached classes using the
+hash filter:
+
+.B tc qdisc add dev .. drr
+.B for i in .. 1024;do
+.B   tc class add dev ..  classid $handle:$(print %x $i)
+.B   tc qdisc add dev .. fifo limit 16
+.B done
+.B tc filter add .. protocol ip .. $handle flow hash keys src,dst divisor 1024 perturb 10
+
+
+.SH SOURCE
+.TP
+o
+M. Shreedhar and George Varghese "Efficient Fair
+Queuing using Deficit Round Robin", Proc. SIGCOMM 95.
+
+.SH NOTES
+
+This implementation does not drop packets from the longest queue on overrun,
+as limits are handled by the individual child qdiscs.
+
+.SH SEE ALSO
+.BR tc (8),
+.BR tc-htb (8),
+.BR tc-sfq (8)
+
+.SH AUTHOR
+sched_drr was written by Patrick McHardy.
+
diff --git a/man/man8/tc.8 b/man/man8/tc.8
index 8c0880f..e17ce68 100644
--- a/man/man8/tc.8
+++ b/man/man8/tc.8
@@ -367,6 +367,7 @@ print rates in IEC units (ie. 1K = 1024).
 was written by Alexey N. Kuznetsov and added in Linux 2.2.
 .SH SEE ALSO
 .BR tc-cbq (8),
+.BR tc-drr (8),
 .BR tc-htb (8),
 .BR tc-sfq (8),
 .BR tc-red (8),
-- 
1.6.4.4


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

* Re: [PATCH 5/5] tc: man: add man page for drr scheduler
  2010-01-12 20:45 ` [PATCH 5/5] tc: man: add man page for drr scheduler Florian Westphal
@ 2010-01-13  5:34   ` Patrick McHardy
  2010-01-13  8:27     ` Florian Westphal
  2010-01-18 22:54   ` [PATCH 5/5 v2] " Florian Westphal
  1 sibling, 1 reply; 12+ messages in thread
From: Patrick McHardy @ 2010-01-13  5:34 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netdev, shemminger

Florian Westphal wrote:

Thanks Florian. A few minor suggestions below.

> diff --git a/man/man8/tc-drr.8 b/man/man8/tc-drr.8
> new file mode 100644
> index 0000000..5fcb0eb
> --- /dev/null
> +++ b/man/man8/tc-drr.8
> @@ -0,0 +1,89 @@
> +.TH TC 8 "January 2010" "iproute2" "Linux"
> +.SH NAME
> +drr \- deficit round robin scheduler
> +.SH SYNOPSIS
> +.B tc qdisc ... add drr
> +.B [ quantum
> +bytes
> +.B ]
> +
> +.SH DESCRIPTION
> +
> +The Deficit Round Robin Scheduler is a classful queuing discipline as
> +a more flexible replacement for Stochastic Fairness Queuing.
> +
> +Unlike SFQ, there are no built-in queues \-\- you need to add classes
> +and then set up filters to classify packets accordingly.
> +This can be useful e.g. for using RED qdiscs with different settings for particular
> +traffic. There is no default class \-\- if a packet cannot be classified,
> +it is dropped.
> +
> +.SH ALGORITHM
> +Each class is assigned a deficit counter, initialized to
> +.B quantum.
> +
> +DRR maintains an (internal) ''active'' list of classes whose qdiscs are
> +non-empty.  This list is used for dequeuing.  A packet is dequeued from
> +the class at the head of the list if the packet size is smaller or equal
> +to the deficit counter.  If the counter is too small, it is increased by
> +.B quantum
> +and the scheduler moves on to the next class in the active list.
> +
> +
> +.SH PARAMETERS
> +.TP
> +quantum
> +Amount of bytes a flow is allowed to dequeue before the scheduler moves to the next.

next class or next flow?

> +Defaults to the MTU of the interface. The minimum value is 1.
> +
> +.SH EXAMPLE & USAGE
> +
> +To attach to device eth0, using the interface MTU as its quantum:
> +.P
> +# tc qdisc add dev eth0 handle 1 root drr
> +.P
> +Adding two classes:
> +.P
> +# tc class add dev eth0 parent 1: classid 1:1 drr
> +# tc class add dev eth0 parent 1: classid 1:2 drr
> +.P
> +You also need to add at least one filter to classify packets.
> +.P
> +# tc filter add dev eth0 protocol .. classid 1:1
> +.P
> +
> +Like SFQ, DRR is only useful when it owns the queue \-\- it is a pure scheduler and does
> +not delay packets.  Attaching non-work-conserving qdiscs like tbf to it does not make
> +sense \-\- other qdiscs in the active list will also become inactive until the dequeue
> +operation succeeds.  Embed DRR within another qdisc like HTB or HFSC to ensure it owns the queue.
> +.P
> +You can mimic SFQ behavior by assigning packets to the attached classes using the
> +hash filter:

flow filter

> +
> +.B tc qdisc add dev .. drr
> +.B for i in .. 1024;do
> +.B   tc class add dev ..  classid $handle:$(print %x $i)
> +.B   tc qdisc add dev .. fifo limit 16
> +.B done
> +.B tc filter add .. protocol ip .. $handle flow hash keys src,dst divisor 1024 perturb 10

To mimic SFQ, the filter needs to use "keys
src,dst,proto,proto-src,proto-dst".

> +
> +
> +.SH SOURCE
> +.TP
> +o
> +M. Shreedhar and George Varghese "Efficient Fair
> +Queuing using Deficit Round Robin", Proc. SIGCOMM 95.
> +
> +.SH NOTES
> +
> +This implementation does not drop packets from the longest queue on overrun,
> +as limits are handled by the individual child qdiscs.
> +
> +.SH SEE ALSO
> +.BR tc (8),
> +.BR tc-htb (8),
> +.BR tc-sfq (8)
> +
> +.SH AUTHOR
> +sched_drr was written by Patrick McHardy.
> +

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

* Re: [PATCH 5/5] tc: man: add man page for drr scheduler
  2010-01-13  5:34   ` Patrick McHardy
@ 2010-01-13  8:27     ` Florian Westphal
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Westphal @ 2010-01-13  8:27 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Florian Westphal, netdev, shemminger

Patrick McHardy <kaber@trash.net> wrote:
> Thanks Florian. A few minor suggestions below.

Thanks Patrick, I'll add all of your suggestions
to the man page in the next round of this patch.

I'll wait a few days, maybe someone else has other ideas.

Thanks again for reviewing,
Florian

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

* [PATCH 5/5 v2] tc: man: add man page for drr scheduler
  2010-01-12 20:45 ` [PATCH 5/5] tc: man: add man page for drr scheduler Florian Westphal
  2010-01-13  5:34   ` Patrick McHardy
@ 2010-01-18 22:54   ` Florian Westphal
  1 sibling, 0 replies; 12+ messages in thread
From: Florian Westphal @ 2010-01-18 22:54 UTC (permalink / raw)
  To: netdev; +Cc: Florian Westphal

With help from Patrick McHardy.

Signed-off-by: Florian Westphal <fw@strlen.de>
---

 Aplogies for taking so long to re-spin this.
 Changes since v1:
  - fix garbled formatting of drr example usage
  - add all changes Patrick suggested.

 man/man8/tc-drr.8 |   94 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 man/man8/tc.8     |    1 +
 2 files changed, 95 insertions(+), 0 deletions(-)
 create mode 100644 man/man8/tc-drr.8

diff --git a/man/man8/tc-drr.8 b/man/man8/tc-drr.8
new file mode 100644
index 0000000..16a8ec0
--- /dev/null
+++ b/man/man8/tc-drr.8
@@ -0,0 +1,94 @@
+.TH TC 8 "January 2010" "iproute2" "Linux"
+.SH NAME
+drr \- deficit round robin scheduler
+.SH SYNOPSIS
+.B tc qdisc ... add drr
+.B [ quantum
+bytes
+.B ]
+
+.SH DESCRIPTION
+
+The Deficit Round Robin Scheduler is a classful queuing discipline as
+a more flexible replacement for Stochastic Fairness Queuing.
+
+Unlike SFQ, there are no built-in queues \-\- you need to add classes
+and then set up filters to classify packets accordingly.
+This can be useful e.g. for using RED qdiscs with different settings for particular
+traffic. There is no default class \-\- if a packet cannot be classified,
+it is dropped.
+
+.SH ALGORITHM
+Each class is assigned a deficit counter, initialized to
+.B quantum.
+
+DRR maintains an (internal) ''active'' list of classes whose qdiscs are
+non-empty.  This list is used for dequeuing.  A packet is dequeued from
+the class at the head of the list if the packet size is smaller or equal
+to the deficit counter.  If the counter is too small, it is increased by
+.B quantum
+and the scheduler moves on to the next class in the active list.
+
+
+.SH PARAMETERS
+.TP
+quantum
+Amount of bytes a flow is allowed to dequeue before the scheduler moves to
+the next class.  Defaults to the MTU of the interface. The minimum value is 1.
+
+.SH EXAMPLE & USAGE
+
+To attach to device eth0, using the interface MTU as its quantum:
+.P
+# tc qdisc add dev eth0 handle 1 root drr
+.P
+Adding two classes:
+.P
+# tc class add dev eth0 parent 1: classid 1:1 drr
+# tc class add dev eth0 parent 1: classid 1:2 drr
+.P
+You also need to add at least one filter to classify packets.
+.P
+# tc filter add dev eth0 protocol .. classid 1:1
+.P
+
+Like SFQ, DRR is only useful when it owns the queue \-\- it is a pure scheduler and does
+not delay packets.  Attaching non-work-conserving qdiscs like tbf to it does not make
+sense \-\- other qdiscs in the active list will also become inactive until the dequeue
+operation succeeds.  Embed DRR within another qdisc like HTB or HFSC to ensure it owns the queue.
+.P
+You can mimic SFQ behavior by assigning packets to the attached classes using the
+flow filter:
+
+.B tc qdisc add dev .. drr
+
+.B for i in .. 1024;do
+.br
+.B \ttc class add dev ..  classid $handle:$(print %x $i)
+.br
+.B \ttc qdisc add dev .. fifo limit 16
+.br
+.B done
+
+.B tc filter add .. protocol ip .. $handle flow hash keys src,dst,proto,proto-src,proto-dst divisor 1024 perturb 10
+
+
+.SH SOURCE
+.TP
+o
+M. Shreedhar and George Varghese "Efficient Fair
+Queuing using Deficit Round Robin", Proc. SIGCOMM 95.
+
+.SH NOTES
+
+This implementation does not drop packets from the longest queue on overrun,
+as limits are handled by the individual child qdiscs.
+
+.SH SEE ALSO
+.BR tc (8),
+.BR tc-htb (8),
+.BR tc-sfq (8)
+
+.SH AUTHOR
+sched_drr was written by Patrick McHardy.
+
diff --git a/man/man8/tc.8 b/man/man8/tc.8
index 8c0880f..e17ce68 100644
--- a/man/man8/tc.8
+++ b/man/man8/tc.8
@@ -367,6 +367,7 @@ print rates in IEC units (ie. 1K = 1024).
 was written by Alexey N. Kuznetsov and added in Linux 2.2.
 .SH SEE ALSO
 .BR tc-cbq (8),
+.BR tc-drr (8),
 .BR tc-htb (8),
 .BR tc-sfq (8),
 .BR tc-red (8),
-- 
1.6.4.4


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

* Re: [iproute2] minor tc cleanup patches
  2010-01-12 20:34 [iproute2] minor tc cleanup patches Florian Westphal
                   ` (4 preceding siblings ...)
  2010-01-12 20:45 ` [PATCH 5/5] tc: man: add man page for drr scheduler Florian Westphal
@ 2010-01-21 18:13 ` Stephen Hemminger
  2010-01-21 18:19   ` Patrick McHardy
  5 siblings, 1 reply; 12+ messages in thread
From: Stephen Hemminger @ 2010-01-21 18:13 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netdev, kaber

On Tue, 12 Jan 2010 21:34:28 +0100
Florian Westphal <fw@strlen.de> wrote:

> Hello Stephen, hello Patrick,
> 
> here are 5 minor patches for iproute2/tc:
> the first two are small man page adjustments.
> The 3rd one makes tc print a more verbose error message instead of -EINVAL.
> 
> The 4th is a janitorial patch that removes some stale (c&p) code.
> 
> Last patch adds a man page for sched_drr.
> Patrick, it would be nice if you could have a look at this one to see
> if I got everything right (or if i forgot something important).
> 
> Thanks a lot!
> 
> Alternatively, you may pull from
> 
> git://git.breakpoint.cc/fw/iproute2.git cleanups
> 
> to obtain the following changes since commit


Applied 1-4 will wait for updated DRR man page for 5

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

* Re: [iproute2] minor tc cleanup patches
  2010-01-21 18:13 ` [iproute2] minor tc cleanup patches Stephen Hemminger
@ 2010-01-21 18:19   ` Patrick McHardy
  2010-01-21 21:51     ` Stephen Hemminger
  0 siblings, 1 reply; 12+ messages in thread
From: Patrick McHardy @ 2010-01-21 18:19 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Florian Westphal, netdev

Stephen Hemminger wrote:
> Applied 1-4 will wait for updated DRR man page for 5
> 

I believe Florian posted the final version on the 18th:

[PATCH 5/5 v2] tc: man: add man page for drr scheduler

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

* Re: [iproute2] minor tc cleanup patches
  2010-01-21 18:19   ` Patrick McHardy
@ 2010-01-21 21:51     ` Stephen Hemminger
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Hemminger @ 2010-01-21 21:51 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Florian Westphal, netdev

On Thu, 21 Jan 2010 19:19:00 +0100
Patrick McHardy <kaber@trash.net> wrote:

> Stephen Hemminger wrote:
> > Applied 1-4 will wait for updated DRR man page for 5
> > 
> 
> I believe Florian posted the final version on the 18th:
> 
> [PATCH 5/5 v2] tc: man: add man page for drr scheduler

got it thanks

-- 

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

end of thread, other threads:[~2010-01-21 21:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-12 20:34 [iproute2] minor tc cleanup patches Florian Westphal
2010-01-12 20:39 ` [PATCH 1/5] tc: man: add limit parameter to tc-sfq man page Florian Westphal
2010-01-12 20:43 ` [PATCH 2/5] tc: man: SO_PRIORITY is described in socket documentation, not tc one Florian Westphal
2010-01-12 20:44 ` [PATCH 3/5] tc: red, gred, tbf: more helpful error messages Florian Westphal
2010-01-12 20:45 ` [PATCH 4/5] tc: remove stale code Florian Westphal
2010-01-12 20:45 ` [PATCH 5/5] tc: man: add man page for drr scheduler Florian Westphal
2010-01-13  5:34   ` Patrick McHardy
2010-01-13  8:27     ` Florian Westphal
2010-01-18 22:54   ` [PATCH 5/5 v2] " Florian Westphal
2010-01-21 18:13 ` [iproute2] minor tc cleanup patches Stephen Hemminger
2010-01-21 18:19   ` Patrick McHardy
2010-01-21 21:51     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).