Commit d93c909a authored by David Ward's avatar David Ward Committed by Stephen Hemminger

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: default avatarDavid Ward <david.ward@ll.mit.edu>
parent 6c99695d
...@@ -214,9 +214,6 @@ static int gred_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n ...@@ -214,9 +214,6 @@ static int gred_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
argc--; argv++; argc--; argv++;
} }
if (rate == 0)
get_rate(&rate, "10Mbit");
if (!opt.qth_min || !opt.qth_max || !opt.limit || !avpkt || if (!opt.qth_min || !opt.qth_max || !opt.limit || !avpkt ||
(opt.DP<0)) { (opt.DP<0)) {
fprintf(stderr, "Required parameter (min, max, limit, " 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 ...@@ -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); burst = (2 * opt.qth_min + opt.qth_max) / (3 * avpkt);
fprintf(stderr, "GRED: set burst to %u\n", burst); 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) { if ((parm = tc_red_eval_ewma(opt.qth_min, burst, avpkt)) < 0) {
fprintf(stderr, "GRED: failed to calculate EWMA constant.\n"); fprintf(stderr, "GRED: failed to calculate EWMA constant.\n");
return -1; return -1;
......
...@@ -109,9 +109,6 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl ...@@ -109,9 +109,6 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
argc--; argv++; argc--; argv++;
} }
if (rate == 0)
get_rate(&rate, "10Mbit");
if (!opt.limit || !avpkt) { if (!opt.limit || !avpkt) {
fprintf(stderr, "RED: Required parameter (limit, avpkt) is missing\n"); fprintf(stderr, "RED: Required parameter (limit, avpkt) is missing\n");
return -1; return -1;
...@@ -126,6 +123,10 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl ...@@ -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; opt.qth_min = opt.qth_max / 3;
if (!burst) if (!burst)
burst = (2 * opt.qth_min + opt.qth_max) / (3 * avpkt); 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) { if ((parm = tc_red_eval_ewma(opt.qth_min, burst, avpkt)) < 0) {
fprintf(stderr, "RED: failed to calculate EWMA constant.\n"); fprintf(stderr, "RED: failed to calculate EWMA constant.\n");
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment