Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Feb 2006 18:27:10 -0600
From:      Bill Marquette <bill.marquette@gmail.com>
To:        Andrew Atrens <atrens@nortel.com>
Cc:        pf@benzedrine.cx, freebsd-pf@freebsd.org
Subject:   Re: some (hopefully basic) altq questions ...
Message-ID:  <55e8a96c0602081627s2446e537mac2c1c2c1444162a@mail.gmail.com>
In-Reply-To: <43EA3DD4.2070704@nortel.com>
References:  <43EA3DD4.2070704@nortel.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Redirecting to pf@benzedrine.cx and freebsd-pf@freebsd.org as slightly
more appropriate lists than misc@

On 2/8/06, Andrew Atrens <atrens@nortel.com> wrote:
> Here's what I have today, that looks to be working well -
>
>
> altq on $ext_if cbq bandwidth 100Mb queue { output_ext }
> queue output_ext bandwidth 850Kb cbq { std_ext,  known_ext, torrent_ext, =
tcp_ack_ext }
> queue std_ext     bandwidth 75%  priority 1 cbq(default red) qlimit 100
> queue torrent_ext bandwidth 75%  priority 1 cbq(red) qlimit 1
> queue known_ext   bandwidth 90% priority  3 cbq(borrow) qlimit 100
> queue tcp_ack_ext bandwidth 10% priority  7 cbq(borrow) qlimit 100

That parses????  It shouldn't!

# pfctl -nf /tmp/foo
pfctl: the sum of the child bandwidth higher than parent "output_ext"
pfctl: the sum of the child bandwidth higher than parent "output_ext"
pfctl: the sum of the child bandwidth higher than parent "output_ext"
pfctl: queue bandwidth must be larger than 123.77Kb
cbq: queue tcp_ack_ext is too slow!
# cat /tmp/foo
altq on lo0 cbq bandwidth 100Mb queue { output_ext }
queue output_ext bandwidth 850Kb cbq { std_ext,  known_ext,
torrent_ext, tcp_ack_ext }
queue std_ext     bandwidth 75%  priority 1 cbq(default red) qlimit 100
queue torrent_ext bandwidth 75%  priority 1 cbq(red) qlimit 1
queue known_ext   bandwidth 90% priority  3 cbq(borrow) qlimit 100
queue tcp_ack_ext bandwidth 10% priority  7 cbq(borrow) qlimit 100

That's from a early January OpenBSD 3.8 snapshot, FYI.

> Notice the percentages don't add up ?
>
> I *thought* I should be doing something like -
>
> altq on $ext_if cbq bandwidth 100Mb queue { output_ext }
> queue output_ext bandwidth 850Kb cbq { std_ext,  known_ext, torrent_ext, =
tcp_ack_ext }
> queue std_ext     bandwidth 5%  priority 1 cbq(default red borrow) qlimit=
 100
> queue torrent_ext bandwidth 5%  priority 1 cbq(red borrow) qlimit 1
> queue known_ext   bandwidth 80% priority  3 cbq(borrow) qlimit 100
> queue tcp_ack_ext bandwidth 10% priority  7 cbq(borrow) qlimit 100

That's the correct syntax if I grok the man pages correctly myself.

> But with this config torrent uploads *crawl*, at most using 6 or 7 % of t=
he available
> bandwidth - lots of dropped packets are preventing tcp from ramping up th=
e connection
> speed, this regardless of whether or not the bw is being used by the othe=
r queues.

This sounds suspiciously like kern/82271
(http://www.freebsd.org/cgi/query-pr.cgi?pr=3D82271) which I'm seeing
problems with too.  We just noticed however that we were compiling an
SMP kernel and weren't using option ALTQ_NOPCC which the man page says
is required although I'm not sure it is (unless you're on a multi-proc
alpha - see below) as that option is only referenced twice in
altq_subr.c.  Once do set machclk_usepcc to 0 (which SMP will do also)
and once if it's running on an alpha and ALTQ_NOPCC isn't defined.

My next step is to take one of our broken rule files and validate it
on an openbsd box to see if it works the same there.

--Bill

$ grep -A4 -B2 ALTQ_NOPCC *
altq_subr.c-    else
altq_subr.c-            tbr_timer =3D 0;  /* don't need tbr_timer anymore *=
/
altq_subr.c:#if defined(__alpha__) && !defined(ALTQ_NOPCC)
altq_subr.c-    {
altq_subr.c-            /*
altq_subr.c-             * XXX read out the machine dependent clock
once a second
altq_subr.c-             * to detect counter wrap-around.
--
altq_subr.c-            }
altq_subr.c-    }
altq_subr.c:#endif /* __alpha__ && !ALTQ_NOPCC */
altq_subr.c-}
altq_subr.c-
altq_subr.c-/*
altq_subr.c- * get token bucket regulator profile
--
altq_subr.c-    machclk_usepcc =3D 1;
altq_subr.c-
altq_subr.c:#if (!defined(__i386__) && !defined(__alpha__)) ||
defined(ALTQ_NOPCC)
altq_subr.c-    machclk_usepcc =3D 0;
altq_subr.c-#endif
altq_subr.c-#if defined(__FreeBSD__) && defined(SMP)
altq_subr.c-    machclk_usepcc =3D 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55e8a96c0602081627s2446e537mac2c1c2c1444162a>