mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-02-01 16:38:22 +00:00
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++;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user