cbq not borrowing fully from parent queue

Wes Santee wsantee at gmail.com
Tue Mar 14 19:40:00 UTC 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Greetings.

I'm running 6-STABLE using pf and altq/cbq to manage bandwidth on my
wireless adapter.

The setup from pf.conf is this:

altq on $ext_if bandwidth 54Mb cbq queue { internal, external }
queue internal bandwidth 53104Kb priority 7 cbq(borrow)
queue external bandwidth 896Kb priority 4 cbq { highq, defaultq, lowq }
   queue highq    bandwidth 40% priority 3 cbq(borrow)
   queue defaultq bandwidth 40% priority 2 cbq(default borrow)
   queue lowq     bandwidth 20% priority 1 qlimit 300 cbq(borrow)

The internal queue is for wireless traffic coming from and going to the
internal network.  The external queue (and its children) are for traffic
going upstream to my ISP.  The "external" queue is set to my max
upstream bandwidth to my ISP, so it can't borrow from the root queue.
All the child queue's under "external" can (and should) borrow against
the available upstream bandwidth amount if available.

The problem is that packets in lowq are filling up the queue, even
though there is plenty of bandwidth available to borrow from the parent
queue.

Here's a snapshot from pfctl -vvsqueue:

queue  internal bandwidth 53.10Mb priority 7 cbq( borrow )
  [ pkts:        401  bytes:     216532  dropped pkts:    0 bytes:   0 ]
  [ qlength:   0/ 50  borrows:      0  suspends:      0 ]
  [ measured:     0.0 packets/s, 0 b/s ]
queue  external bandwidth 896Kb priority 4 {highq, defaultq, lowq}
  [ pkts:          0  bytes:          0  dropped pkts:    0 bytes:   0 ]
  [ qlength:   0/ 50  borrows:      0  suspends:      0 ]
  [ measured:     0.0 packets/s, 0 b/s ]
queue   highq bandwidth 358.40Kb priority 3 cbq( borrow )
  [ pkts:          0  bytes:          0  dropped pkts:    0 bytes:   0 ]
  [ qlength:   0/ 50  borrows:      0  suspends:      0 ]
  [ measured:     0.0 packets/s, 0 b/s ]
queue   defaultq bandwidth 358.40Kb priority 2 cbq( borrow default )
  [ pkts:       7397  bytes:    3230740  dropped pkts:    0 bytes:   0 ]
  [ qlength:   0/ 50  borrows:     10  suspends:      9 ]
  [ measured:     1.0 packets/s, 4.16Kb/s ]
queue   lowq bandwidth 179.20Kb qlimit 300 cbq( borrow )
  [ pkts:      41643  bytes:   48966175  dropped pkts:    0 bytes:   0 ]
  [ qlength: 117/300  borrows:  31513  suspends:   6282 ]
  [ measured:    21.1 packets/s, 193.23Kb/s ]


Notice that queue "external", the parent of lowq, has plenty of
available bandwidth.  However, lowq has still got a backlog of 117
packets, and refuses to go over 193Kbit/sec.  It is borrowing, but not
enough to keep the queue in check.

Is there a reason the cbq implementation in pf will not aggressively
borrow against the parent queue if the bandwidth is available?  I had to
set the qlimit up to 300 because at 200 it was still dropping packets
even though there was *plenty* of available bandwidth to borrow from the
parent.

Cheers,
- -Wes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iQIVAwUBRBcMmIrq8W17hxGfAQi2HA//cnrbFvZIzOnzKYIsV2GE4IlNA4lC8Wyg
XaZq1yEvqkuA6BgF0V029bgkuCOrKEe6qrOKpygINWLvsCgdNS2RXbgyxSXOkZQ2
IC9giWLV9aZtapR7yo8sK9aKLwhM/ppOtQc1q1tlR4q0NX4El6fKj6QBVqDx2D1Q
qykpAvV23Ew1f7Sl6iqFmOA3d/NUq0knJQCNUD3R3X8cz1N5Cx19hx15Sjb+A1Sg
XRTlo0OzFgwJ67vVS79BAmceZO0gni7VxHbKBdGTklFFIYcykKB+Lv3TLmxJY2l8
CRyfG1ozc7VRQAa1RsbocQfAQ0BTHJ2X0gXd8CfZFIB343Go/4bwWVQrLtpniKnk
Uen8eIlpC0BeCFlDhPOhUT4MapaJxnLgRtVvyqoBJC6J6c54t7K9wrU5PQ8jBbgL
6fhXh/qi5rjTTIPtszDYWI/bZmvYlyOMXAz5zUkFxcHQGkmonizoB2ADonloc3Aw
qQfRjnyc8B+YnYu9F+HyCo0baQylbrmMjb1b0rZbBm2UlXRK7xQKMg0BdWLC3tZH
tFSOXVprx9iKSQL7w7OAuLo2Nyts95eJ/hLLdUF9D1RyHuJWVgys9dnaT3BM/Hge
A3UsmWjcazWJgEk6uy/hRBfB6o0O4GoNRdf7lu5DWStNdxY1HN8c5jSvPUbYZfyB
8g2LTD8CIlI=
=d1NF
-----END PGP SIGNATURE-----


More information about the freebsd-questions mailing list