diff options
author | Patrick Kelsey <pkelsey@FreeBSD.org> | 2019-02-11 22:58:43 +0000 |
---|---|---|
committer | Patrick Kelsey <pkelsey@FreeBSD.org> | 2019-02-11 22:58:43 +0000 |
commit | 997667302f638219587f1bbc55051716a80fe863 (patch) | |
tree | 0a09be570691467d43ab094ccd7af7b9d27013d1 /sbin | |
parent | 3420c04b44d4568d2eba31feeba2242bf0e87e86 (diff) | |
download | src-test2-997667302f638219587f1bbc55051716a80fe863.tar.gz src-test2-997667302f638219587f1bbc55051716a80fe863.zip |
Notes
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pfctl/pfctl_altq.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index e5dad956f83f..f23fe057f703 100644 --- a/sbin/pfctl/pfctl_altq.c +++ b/sbin/pfctl/pfctl_altq.c @@ -429,34 +429,25 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw, if (pa->qlimit == 0) pa->qlimit = DEFAULT_QLIMIT; - if (eval_queue_opts(pa, opts, - parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth)) - return (1); - if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC || pa->scheduler == ALTQT_FAIRQ) { pa->bandwidth = eval_bwspec(bw, parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth); - /* - * For HFSC, if the linkshare service curve m2 parameter is - * set, it overrides the provided queue bandwidth parameter, - * so adjust the queue bandwidth parameter accordingly here - * to avoid false positives in the total child bandwidth - * check below. - */ - if ((pa->scheduler == ALTQT_HFSC) && - (pa->pq_u.hfsc_opts.lssc_m2 != 0)) { - pa->bandwidth = pa->pq_u.hfsc_opts.lssc_m2; - } - if (pa->bandwidth > pa->ifbandwidth) { fprintf(stderr, "bandwidth for %s higher than " "interface\n", pa->qname); return (1); } - /* check the sum of the child bandwidth is under parent's */ - if (parent != NULL) { + /* + * If not HFSC, then check that the sum of the child + * bandwidths is less than the parent's bandwidth. For + * HFSC, the equivalent concept is to check that the sum of + * the child linkshare service curves are under the parent's + * linkshare service curve, and that check is performed by + * eval_pfqueue_hfsc(). + */ + if ((parent != NULL) && (pa->scheduler != ALTQT_HFSC)) { if (pa->bandwidth > parent->pa.bandwidth) { warnx("bandwidth for %s higher than parent", pa->qname); @@ -472,6 +463,10 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw, } } + if (eval_queue_opts(pa, opts, + parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth)) + return (1); + if (parent != NULL) parent->meta.children++; |