From nobody@FreeBSD.org  Sun Mar 20 23:33:28 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E5E4106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 20 Mar 2011 23:33:28 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 20DA98FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 20 Mar 2011 23:33:28 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p2KNXRqK033273
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 20 Mar 2011 23:33:27 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p2KNXRqd033269;
	Sun, 20 Mar 2011 23:33:27 GMT
	(envelope-from nobody)
Message-Id: <201103202333.p2KNXRqd033269@red.freebsd.org>
Date: Sun, 20 Mar 2011 23:33:27 GMT
From: Marcin Wisnicki <mwisnicki+freebsd@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [pf] [altq] borrow from parent queue does not work with cbq
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         155736
>Category:       kern
>Synopsis:       [pf] [altq] borrow from parent queue does not work with cbq
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-pf
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 20 23:40:01 UTC 2011
>Closed-Date:    
>Last-Modified:  Mon Mar 21 01:29:09 UTC 2011
>Originator:     Marcin Wisnicki
>Release:        8.2-STABLE
>Organization:
>Environment:
FreeBSD ghost.pnet.one.pl 8.2-STABLE FreeBSD 8.2-STABLE #1: Wed Mar  2 17:18:23 CET 2011     root@ghost.pnet.one.pl:/home/obj/usr/src/sys/SERWER_DDB  i386

>Description:
I have queues like this:

altq on $lan_if cbq bandwidth 100Mb queue { qLocal, qExt }
queue qLocal bandwidth 0b cbq(default borrow)
queue qExt bandwidth 10Mb cbq { qExtFast, qExtSlow }
queue  qExtFast priority 7 bandwidth 80% cbq(borrow)
queue  qExtSlow priority 1 bandwidth 20% cbq(borrow red)

pass on $lan_if from <slow> to $internet queue qExtSlow
pass on $lan_if from $internet to <slow> queue qExtSlow
pass on $lan_if from !<slow> to $internet queue qExtFast

Lan is 100Mbps and Wan is 10Mbps. Above rules are supposed to slow down traffic coming from internet to <slow> hosts.

Unfortunately it seems that borrowing does not work when parent queue (qExt) does not also borrow. But it should according to man and PF FAQ.
pfctl -sq -v shows 0 packets in qExt. If I reduce eg. qExtFast to 10% it goes down as if there was no borrow.

Googling reveals many similar posts dating back to FreeBSD-6, possibly bug is there since ALTQ introduction.

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Marcin Wisnicki <mwisnicki+freebsd@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Cc:  
Subject: Re: kern/155736: [pf] [altq] borrow from parent queue does not work
 with cbq
Date: Mon, 21 Mar 2011 02:00:06 +0100

 HFSC can be used as a workaround since it can express everything that
 is possible with CBQ:
 
 altq on $lan_if hfsc bandwidth 100Mb queue { qLocal, qExt }
 queue qLocal bandwidth 90Mb hfsc(default)
 queue qExt bandwidth 10Mb hfsc(upperlimit 10Mb) { qExtFast, qExtSlow }
 queue  qExtFast priority 7 bandwidth 80%
 queue  qExtSlow priority 1 bandwidth 20% hfsc(red)
Responsible-Changed-From-To: freebsd-bugs->freebsd-pf 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Mar 21 01:28:56 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=155736 
>Unformatted:
