Skip to content
Contents
GuidesOpenWrt

Why hardware flow offload can bypass your OpenWrt SQM limits

Hardware offloading redirects established flows meeting criteria to the forwarding engine.

Hardware offloading redirects established flows meeting criteria to the forwarding engine. If data bypasses the software path with SQM, the counter increments will not match the actual data volume consumed by the client. The most noticeable difference occurs when comparing a single new long-lived connection across two configurations.

Only modify one switch at the same path

First, disable hardware and software offloading in the firewall, retaining the same SQM throttling. Reestablish a wired transmission. Record throughput and the byte increment from tc -s qdisc show. Repeat the test with software offloading only, then perform a standalone hardware offloading test on supported physical machines. Start a new connection each time, wait a few seconds, then read the counters and CPU usage.

Judging bandwidth limiting based on queue bytes versus actual passed traffic

Use the same wired terminal to perform a long-duration upload, and read tc -s qdisc. Reestablish the connection with and without hardware offloading enabled, then compare throughput, queue accumulation, and latency.

QoS and latency are still governed by SQM, so retain these testable configurations. If hardware offloading is enabled and throughput exceeds the set threshold, and the shaping queue increment noticeably shrinks, disable offloading for paths requiring low latency. After disabling, if CPU utilization is at full capacity, evaluate a lower shaping rate or consider a more capable device.

When traffic exceeds expected limits and the queue stops growing, disable offloading for this path, then verify IPv4, IPv6, and download.

Check offloading switches and current queues on the router. · OpenWrt 25.12.6 x86/64 (QEMU/KVM).
Check the terminal output
Check offloading switches and current queues on the router. · OpenWrt 25.12.6 x86/64 (QEMU/KVM).
Check offloading switches and current queues on the router. · OpenWrt 25.12.6 x86/64 (QEMU/KVM). Open the original image

Vary software flow offload and keep the other settings fixed

Use one wired LAN host A, one experimental WAN host B, and an existing available SQM-capable backup OpenWrt. The experimental WAN is not connected to the public internet and does not carry any home or office services. Host A and B require Layer 3 forwarding, with return-path routing or NAT already confirmed; the firewall only allows communication necessary for the experiment. Virtual machines can validate software queues, but cannot substitute hardware offload performance testing on specific chips.

First, record the board type, firmware, kernel, SQM script, and tc version. In LuCI under «Network → Firewall», note the offload options; in the interface where luci-app-sqm is installed, under «Network → SQM QoS», record the interface, uplink and downlink speeds, queue algorithm, script, and link overhead. Menu names shall be taken as the actual page name in the firmware.

In the router SSH terminal, save the configuration, note the printed directory, and store it on the management computer:

lab_backup=$(mktemp -d /tmp/sqm-lab.XXXXXX)
cp -p /etc/config/firewall "$lab_backup/firewall"
cp -p /etc/config/sqm "$lab_backup/sqm"
printf '%s\n' "$lab_backup"
ubus call system board
uname -r
tc -V
uci show sqm
ifstatus wan
tc -s -d qdisc show

If tc does not exist or /etc/config/sqm does not exist, first install the corresponding components via the package manager of the current distribution; do not proceed to evaluate empty results. When the interface is not wan, replace ifstatus with the actual interface name.

This experiment keeps hardware offload disabled and SQM configuration unchanged, comparing only "software offload disabled" and "software offload enabled". The first group serves as a control and does not require permanent daily disable of software offload. A new connection is established after each application to avoid mixing states from the same old connection.

Real LuCI SQM QoS page, verify shaping interface and uplink/downlink configuration

The figure shows the LuCI page of a private test network. The experimental interface e49b corresponds to the WAN side. The download-direction IFB must be queried from the kernel queue separately.

Find the upload queue and download redirect interface

ifstatus's l3_device serves as a clue, but cannot be mechanically treated as the definitive answer for all SQM binding scenarios. PPPoE, VLAN, bridging, and tunneling may create multi-layer devices. Cross-reference SQM's interface, actual routing tables, and boot logs to determine exactly at which layer the packet shaping occurs.

# On the router, execute; view all interfaces and queues, do not guess the IFB name beforehand.
ip -d link show
tc -s -d qdisc show
logread | grep -i sqm

Identify the actual WAN root queue and the IFB used for download shaping. Run tc -s -d qdisc show dev IFNAME for each, substituting the interface name. The IFB may be named ifb4wan. Check the actual interface on PPPoE before interpreting its counters.

Field or phenomenon How to explain
qdisc cake or configure the expected queue tree Queue is mounted, but the experiment traffic has not yet been verified to pass through.
Sent bytes, packets continuously increasing Traffic passes through this statistics point and needs to be associated with the experiment direction.
backlog Peak instantaneous backlog reading, a zero value at a single instance does not prove no queuing has ever occurred.
dropped、overlimits Different meanings; the overflow handling count cannot be directly considered as packet loss.
CAKE statistics for each tin Evaluate only under the corresponding classification mode; it is not assumed that there are exactly four categories.

When queue increments are not observed, first check interface, direction, and service startup errors; do not immediately conclude that software offload and SQM are conflicting.SQM Detailed DocumentationProvides entry points for troubleshooting via ifstatus, logs, and tc.

First verify queue processing, then verify manual bandwidth limiting

The following addresses are only usable after isolation experiment network configuration is completed: A at 192.0.2.10, B at 198.51.100.20. Both ends prepare identical available iperf3 and verify parameter support. On B, start a one-time service bound exclusively to the experiment address:

iperf3 -s -1 -B 198.51.100.20 -p 5201

On A, run low-load TCP, and record the router queue statistics once before and once after:

iperf3 -c 198.51.100.20 -B 192.0.2.10 -p 5201 -b 200K -t 15

If the expected WAN queue grows on upload, start the one-off server on B again. Add -R to the command on A and check whether the download queue grows on the reverse transfer. The 200 kbit/s target limits this probe. It does not measure the maximum speed of the link or either device. Use dedicated test endpoints to keep background traffic out of the counters.

To verify the integrity of the flow, set both SQM uplink and downlink to 1000 kbit/s within this dedicated experiment network, while maintaining the physical link and end-to-end capabilities above this rate; keep all other parameters unchanged. Restart the B service, then introduce a bounded, load exceeding the artificially imposed throttling from A:

iperf3 -c 198.51.100.20 -B 192.0.2.10 -p 5201 -u -b 2M -l 1200 -t 15

After restarting the service, use -R to separately test the other direction. Here, 1200 refers to the UDP payload bytes, not the full frame length on the wire. This experiment only verifies whether the manually configured 1 Mbit/s queue constrains this flow; UDP overflow transmission may result in queuing or packet loss, so it is not required that the receiver exactly displays 1.000 Mbit/s; furthermore, the results should not be reported as the device's maximum capability. Do not move this load to the public internet or any currently used network.

Use two sets of results to determine which setting to retain

For the software offload (off) and on (on) groups, separately record the receiver rate, packet loss, corresponding queue increments, and stream offload status. The software state can be queried by connection five-tuple via conntrack; when the tool is not installed, first supplement the package matching the current release version; do not treat "no tool" as "miss match".

If both upload and download traffic pass through the expected queue, and manual rate limiting remains effective, record "this version, interface, and queue combination passes basic shaping acceptance." If software offloading is enabled or rate limiting changes, first preserve the configuration snapshot, verify actual traffic diversion, interface, and rules, and then decide whether to temporarily use the disabled state.

When performing per-packet classification using DSCP, device priority, or nftables, separate verification of classification location and target queue is required. Effective general rate limiting does not imply that all custom classifications are correct. To evaluate end-to-end delay under full load, repeated empty and loaded tests under a fixed topology must be conducted, and reports on received throughput, delay distribution, packet loss, and per-core load must be provided; the low-speed probe used in this example cannot be substituted.

What is actually observed during a single bidirectional acceptance?

In an isolated instance of OpenWrt 25.12.6 x86/64 with iperf3 3.22, two separate subnets are connected via veth interfaces. Uplink and downlink both use CAKE queues with a bandwidth of 1,000 kbit/s. Each direction transmits for 8 seconds, with UDP payload size of 1,200 B, targeting a send rate of 2 Mbit/s. The table below extracts end.sum_received.bits_per_second from the receiver's JSON output and converts it to Mbit/s in decimal.

Software offload A to B B to A
Close 0.966 0.968
Enable 0.966 0.968

During upload, the CAKE package count on e49b increases; during download, the count on ifb4e49b increases. When software offload is enabled, both new test flows show corresponding [OFFLOAD] entries. Approximately twice the integer budget of UDP traffic is actively injected, resulting in the receiver recording about 51% packet loss. These numbers only address whether the two paths in this virtual machine can enforce a manually set low-speed ceiling. The wire-speed performance of physical ports, hardware offload, the full-load latency after shaping, and custom DSCP classification require individual validation. The original SQM and firewall configurations have been restored post-experiment.

Restore configuration, and verify normal business operations.

Stop the client and wait for B's one-time service to exit; if it hasn't terminated, press Ctrl-C in the foreground. Restore the SQM rate, interface, script, and offload options to their previously recorded values, then verify the lightweight upload and download again. If this experiment consistently uses exclusive configuration, you may restore the configuration on the router's local management terminal using the actual backup directory:

# REPLACE must be replaced with the actual directory for this instance; the service must be restarted only after both files have been copied successfully.
cp -p /tmp/sqm-lab.REPLACE/firewall /etc/config/firewall &&
cp -p /tmp/sqm-lab.REPLACE/sqm /etc/config/sqm &&
/etc/init.d/firewall restart && /etc/init.d/sqm restart

Verify that the management connection, original queues, and communication have been restored before revoking the experiment license. Do not clear the full machine connection table during restoration, and do not carry over the experiment's 1000 kbit/s setting to the production line.

Measure 2.5 GbE throughput with an iperf3 endpoint on each side

Reference

Related guides

Explore hardware

Devices mentioned

Comments