[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is bandwidth parameter wrong in current OpenBSD's ALTQ/HFSC?
Alexey E. Suslikov wrote:
> > you can do the following:
> > queue Q1 bandwidth 0% hfsc (realtime 32Kb, linkshare 0%)
>
> this is non-working:
>
> bandwidth for Q1 invalid (0 / 0)
> ./pf.conf:xx: errors in queue definition
oops! the bandwidth check is a bit too strict.
the patch at the end of this mail should fix it.
but, again, this isn't the right solution for you since you don't need
any realtime guarantee.
> > but the following might be close to what you are trying to achieve:
> > queue Q1 hfsc (linkshare 10Kb, upperlimit 32Kb)
>
> sorry, but why not linkshare 0%? i don't want to share bandwidth
> available, just hard limit the queue!
setting both realtime and linkshare to 0 means that 0bps is assined to
the queue. then, the queue will get nothing.
you do need to share bandwidth among Q0 through Q5 but just upperlimit
each queue's share. you need to set non-zero linkshare to each queue.
> but in case of linkshare 0% i have got
>
> pfctl: link-sharing sc exceeds parent's sc
> ./test:xx: errors in queue definition
>
> against
>
> altq on fxp0 bandwidth 256Kb hfsc queue \
> {Q1,Q2,Q3,Q4,Q5,Q0}
> queue Q1 hfsc (upperlimit 32Kb linkshare 0%)
> queue Q2 hfsc (upperlimit 32Kb linkshare 0%)
> queue Q3 hfsc (upperlimit 32Kb linkshare 0%)
> queue Q4 hfsc (upperlimit 32Kb linkshare 0%)
> queue Q5 hfsc (upperlimit 32Kb linkshare 0%)
> queue Q0 hfsc (upperlimit 32Kb linkshare 0% default)
if you ommit bandwidth, the value is automatically inherited from the
parent. so, just setting 0 to linkshare doesn't work.
you need to set a non-zero value to linkshare.
> > hfsc has 2 distinct bandwidth parameters; one for the realtime
> > scheduling and the other for the linksharing scheduling.
> > so, the bandwidth parameter is redundant but the current
> > implementation is less surprising for those who don't understand
> > hfsc.
> > (I agree that it's confusing for those who knows hfsc, though.)
>
> not only confusing, it just don't want to work as expected :/
I would call it "confusing" :)
> as for me bandwidth is bogus with hfsc...
do you have a better idea?
-Kenjiro
Index: pfctl_altq.c
===================================================================
RCS file: /cvs/src/sbin/pfctl/pfctl_altq.c,v
retrieving revision 1.81
diff -u -r1.81 pfctl_altq.c
--- pfctl_altq.c 10 Feb 2004 22:26:56 -0000 1.81
+++ pfctl_altq.c 16 Feb 2004 16:19:08 -0000
@@ -338,8 +338,9 @@
pa->qlimit = DEFAULT_QLIMIT;
if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC) {
- if ((pa->bandwidth = eval_bwspec(bw,
- parent == NULL ? 0 : parent->bandwidth)) == 0) {
+ pa->bandwidth = eval_bwspec(bw,
+ parent == NULL ? 0 : parent->bandwidth);
+ if (pa->scheduler == ALTQT_CBQ && pa->bandwidth == 0) {
fprintf(stderr, "bandwidth for %s invalid (%d / %d)\n",
pa->qname, bw->bw_absolute, bw->bw_percent);
return (1);