From: David Ward <david.ward@ll.mit.edu>
To: netdev@vger.kernel.org
Cc: David Ward <david.ward@ll.mit.edu>
Subject: [PATCH iproute2 03/10] tc: red, gred: Notify when using the default value for "bandwidth"
Date: Mon, 18 May 2015 11:35:07 -0400 [thread overview]
Message-ID: <1431963314-56420-4-git-send-email-david.ward@ll.mit.edu> (raw)
In-Reply-To: <1431963314-56420-1-git-send-email-david.ward@ll.mit.edu>
The "bandwidth" parameter is optional, but ensure the user is aware
of its default value, to proactively avoid configuration problems.
Signed-off-by: David Ward <david.ward@ll.mit.edu>
---
tc/q_gred.c | 7 ++++---
tc/q_red.c | 7 ++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/tc/q_gred.c b/tc/q_gred.c
index d876f83..5e0dfcf 100644
--- a/tc/q_gred.c
+++ b/tc/q_gred.c
@@ -214,9 +214,6 @@ static int gred_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
argc--; argv++;
}
- if (rate == 0)
- get_rate(&rate, "10Mbit");
-
if (!opt.qth_min || !opt.qth_max || !opt.limit || !avpkt ||
(opt.DP<0)) {
fprintf(stderr, "Required parameter (min, max, limit, "
@@ -227,6 +224,10 @@ static int gred_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
burst = (2 * opt.qth_min + opt.qth_max) / (3 * avpkt);
fprintf(stderr, "GRED: set burst to %u\n", burst);
}
+ if (!rate) {
+ get_rate(&rate, "10Mbit");
+ fprintf(stderr, "GRED: set bandwidth to 10Mbit\n");
+ }
if ((parm = tc_red_eval_ewma(opt.qth_min, burst, avpkt)) < 0) {
fprintf(stderr, "GRED: failed to calculate EWMA constant.\n");
return -1;
diff --git a/tc/q_red.c b/tc/q_red.c
index 6555eb2..1bf2bd9 100644
--- a/tc/q_red.c
+++ b/tc/q_red.c
@@ -109,9 +109,6 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
argc--; argv++;
}
- if (rate == 0)
- get_rate(&rate, "10Mbit");
-
if (!opt.limit || !avpkt) {
fprintf(stderr, "RED: Required parameter (limit, avpkt) is missing\n");
return -1;
@@ -126,6 +123,10 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
opt.qth_min = opt.qth_max / 3;
if (!burst)
burst = (2 * opt.qth_min + opt.qth_max) / (3 * avpkt);
+ if (!rate) {
+ get_rate(&rate, "10Mbit");
+ fprintf(stderr, "RED: set bandwidth to 10Mbit\n");
+ }
if ((parm = tc_red_eval_ewma(opt.qth_min, burst, avpkt)) < 0) {
fprintf(stderr, "RED: failed to calculate EWMA constant.\n");
return -1;
--
1.7.1
next prev parent reply other threads:[~2015-05-18 15:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 15:35 [PATCH iproute2 00/10] RED and GRED fixes, plus TCA_GRED_LIMIT support David Ward
2015-05-18 15:35 ` [PATCH iproute2 01/10] tc: red, gred: Rename overloaded variable wlog David Ward
2015-05-21 21:29 ` Stephen Hemminger
2015-05-18 15:35 ` [PATCH iproute2 02/10] tc: red, gred: Fix format specifier in burst size warning David Ward
2015-05-18 15:35 ` David Ward [this message]
2015-05-18 15:35 ` [PATCH iproute2 04/10] tc: red: Mark "bandwidth" parameter as optional in usage text David Ward
2015-05-18 15:35 ` [PATCH iproute2 05/10] tc: gred: Fix whitespace issues in code David Ward
2015-05-18 15:35 ` [PATCH iproute2 06/10] tc: gred: Print usage text if no arguments appear after "gred" David Ward
2015-05-18 15:35 ` [PATCH iproute2 07/10] tc: gred: Improve parameter/statistics output David Ward
2015-05-18 15:35 ` [PATCH iproute2 08/10] tc: gred: Handle unsigned values properly in option parsing/printing David Ward
2015-05-18 15:35 ` [PATCH iproute2 09/10] tc: gred: Adopt the term VQ in the command syntax and output David Ward
2015-05-18 15:35 ` [PATCH iproute2/net-next] tc: gred: Add support for TCA_GRED_LIMIT attribute David Ward
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1431963314-56420-4-git-send-email-david.ward@ll.mit.edu \
--to=david.ward@ll.mit.edu \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).