On Tue, May 09, 2017 at 19:47 +0000, Carl Mascott wrote: > Intel Atom D2500 1.66GHz > OpenBSD i386 v6.1-stable > > I can't get pf to give me the queue bandwidths that I specify in pf.conf. > > pf.conf: > > queue rootq on $ext_if bandwidth 9M max 9M qlimit 100 > queue qdef parent rootq bandwidth 3650K default > queue qrtp parent rootq bandwidth 350K min 350K burst 700K for 200ms > queue qweb parent rootq bandwidth 4M > queue qpri parent rootq bandwidth 900K min 50K burst 1800K for 200ms > queue qdns parent rootq bandwidth 100K min 10K burst 200K for 1000ms > > output of pfctl -srules: > > queue rootq on bge0 bandwidth 9M, max 9M qlimit 100 > queue qdef parent rootq bandwidth 3M default qlimit 50 > queue qrtp parent rootq bandwidth 350K, min 350K burst 700K for 200ms qlimit > 50 > queue qweb parent rootq bandwidth 4M qlimit 50 > queue qpri parent rootq bandwidth 900K, min 50K burst 1M for 200ms qlimit 50 > queue qdns parent rootq bandwidth 100K, min 10K burst 200K for 1000ms qlimit > 50 > > Discrepancies in the above: > > defined actual > ---------- --------- > qdef BW 3650K 3M > qpri burst 1800K 1M > > It looks like for anything specified as abcdK the result is aM, i.e., for any > bandwidth >= 1000K the resulting bandwidth is truncated (not rounded) to > <msd>M, where <msd> = most significant digit. Any bandwidth < > 1000K works correctly. > > Is this a bug, a misfeature, or a feature? > Thanks! >
Borrowing is enabled by default, so it's hard to say what affects your test since you didn't specify how are you exactly testing this. Every queue in your setup can borrow up to 9M of bandwidth, preventing others from doing the same, especially since you're attempting to measure a 200ms burst. How are you exactly doing this? I suggest you create a simple isolated test where you have only the specified traffic, e.g. generated with tcpbench. Then you disable borrowing by specifying "max" bandwidth: queue rootq on $ext_if bandwidth 9M max 9M queue qdef parent rootq bandwidth 3650K max 3650K default W/o other queues. Then you proceed to add others, with or without borrowing enabled undestanding what you're doing and what an how you're testing. Inside pfctl parser all bandwitdh specifications are converted to bits per second (where K means multiplied by 1000 and M by 1.000.000).