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:
parent
6c99695da2
commit
d93c909a4c
|
|
@ -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
|
||||||
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
|
||||||
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
|
||||||
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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue