tc: red, gred: Notify when using the default value for "bandwidth"

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>
This commit is contained in:
David Ward 2015-05-18 11:35:07 -04:00 committed by Stephen Hemminger
parent 6c99695da2
commit d93c909a4c
2 changed files with 8 additions and 6 deletions

View File

@ -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;

View File

@ -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;