OpenBSD: PF queues break the 4 Gbps barrier

Published: (March 19, 2026 at 09:43 AM EDT)
2 min read

Source: Hacker News

Introduction

OpenBSD’s PF packet filter has long supported HFSC traffic shaping with the queue rules in pf.conf(5). However, an internal 32‑bit limitation in the HFSC service‑curve structure (struct hfsc_sc) capped bandwidth values at approximately 4.29 Gbps – the maximum value of a u_int.

With 10 G, 25 G, and 100 G network interfaces now commonplace, and ongoing kernel work for SMP and high‑speed drivers, this limitation became a practical obstacle. Configuring bandwidth 10G on a queue would silently wrap around, leading to incorrect and unpredictable scheduling behavior.

The Patch

A new patch widens the bandwidth fields in the kernel’s HFSC scheduler from 32‑bit to 64‑bit integers, removing the bottleneck entirely. The same change also fixes a display bug in pftop(1) where bandwidth values above 4 Gbps were shown incorrectly.

Key Changes

  • Bandwidth fields in HFSC scheduler are now 64‑bit.
  • pftop correctly displays high‑speed bandwidth values.
  • No impact on existing configurations that use values below 4 Gbps.

Practical Impact

PF queue bandwidth configuration now works correctly for modern high‑speed interfaces. The familiar syntax remains unchanged:

queue rootq on em0 bandwidth 10G
queue defq parent rootq bandwidth 8G default

Values up to 999 G are supported, more than enough for today’s and future interfaces. Existing configurations using values below 4 G continue to work without modification.

Usage Example

# Define a root queue on interface em0 with 10 Gbps bandwidth
queue rootq on em0 bandwidth 10G

# Define a default child queue with 8 Gbps bandwidth
queue defq parent rootq bandwidth 8G default

References

0 views
Back to Blog

Related posts

Read more »

Time to Dump Windows?

!Time To Dump Windows?https://dennisforbes.ca/include/images/microblog/2026/02/time_to_dump_windows_og.jpg I primarily use Apple Macs — while Tahoe was a regres...

Our commitment to Windows quality

Hello Windows Insiders, I want to speak to you directly, as an engineer who has spent his career building technology that people depend on every day. Windows to...

Attention Residuals

Paperhttps://github.com/MoonshotAI/Attention-Residuals/blob/master/Attention_Residuals.pdf | arXivhttps://arxiv.org/abs/2603.15031 | Overviewoverview | Resultsr...