← All posts

OpenWrt software acceleration: flow offloading, packet steering and NIC offload

Grow through practice

No need to finish reading — test now

First, define the term: software acceleration is not overclocking, and disabling QoS is not acceleration. On OpenWrt, the most direct form is software flow offloading: established flows bypass the full netfilter path.

1. Software vs hardware acceleration

TypeWho does itTypical setting
Software flow offloadLinux nftables flowtable + CPUflow_offloading '1'
Hardware flow offloadNIC/switch driverflow_offloading_hw '1'
NIC offloadGRO/GSO/TSO, etc.ethtool -K
Packet steeringRPS/XPS/IRQ distributionpacket_steering '1'
SQM/CAKEShaping/queueing, not accelerationsqm

Software offload still forwards on the CPU; it just skips full firewall processing per packet. Hardware offload programs flows into supported network hardware, depending on the driver.

2. Enable software flow offloading

OpenWrt 22.03+ uses fw4/nftables. Edit /etc/config/firewall:

config defaults
    option input 'REJECT'
    option output 'ACCEPT'
    option forward 'REJECT'
    option syn_flood '1'
    option flow_offloading '1'
    option flow_offloading_hw '0'

Commit and restart the firewall:

uci commit firewall
/etc/init.d/firewall restart

Start with software offload only. flow_offloading_hw '1' requires driver support; without it there is no benefit and it can cause problems.

3. Verify it is active

fw4 print | grep -i -A5 flowtable
nft list ruleset | grep -i -A10 flowtable

While running iperf3:

top -H
cat /proc/interrupts
ethtool -S eth0 | grep -i -E 'drop|error'

Falling softirq CPU and higher throughput indicate offload is working. If throughput is unchanged but some rules/statistics stop working, suspect a conflict with the feature.

4. Packet steering

On multi-core routers, one core can saturate with softirq. OpenWrt packet steering distributes RX processing across CPUs:

config globals 'globals'
    option packet_steering '1'

Service:

/etc/init.d/packet_steering restart

Not every NIC/driver benefits evenly; check /proc/interrupts and top -H, not just total CPU.

5. NIC offload

Show current settings:

ethtool -k eth0

Common options:

ethtool -K eth0 gro on
ethtool -K eth0 gso on
ethtool -K eth0 tso on

These are NIC/protocol aggregation/segmentation offloads, not nftables flow offload. Virtual interfaces, USB NICs and some DSA drivers may not support them or may already enable them.

6. When not to enable it

Flow offload lets established flows bypass the full netfilter path. Be careful with:

  • SQM/CAKE, complex QoS or traffic shaping;
  • per-packet accounting/billing firewalls;
  • NAT reflection / hairpin;
  • policy routing or complex mangle;
  • VPN/tunnels and multi-level NAT;
  • per-packet logging or deep packet inspection.

SQM and offload often have opposing goals: shaping for low bufferbloat vs offload for maximum NAT throughput. Pick the goal first.

7. A conservative tuning order

  1. Measure baseline: iperf3, CPU softirq, temperature;
  1. Enable only flow_offloading '1' and retest;
  1. Try flow_offloading_hw '1' only with driver support;
  1. If multi-core is the bottleneck, try packet_steering;
  1. Tune ethtool and IRQ affinity last;
  1. Change one item at a time and keep a rollback path.

Verification

  • ✅ Configuration semantics: OpenWrt firewall flow_offloading / flow_offloading_hw, fw4/nftables flowtable.
  • ✅ Command paths: fw4 print, nft list ruleset, ethtool, packet_steering.
  • ⚠️ Not measured on a specific device; support and gains vary widely by SoC/driver/firmware.
  • ❓ Not covered: hardware NAT/PPE driver details and firmware defaults.

One sentence

OpenWrt software acceleration is primarily flow offloading; packet steering and NIC offload support it, while SQM is a different, often opposing, goal.


Series: OpenWrt Related: What is netifd? · UCI guide · From UCI to a data model

Practice

Found this useful?

I write about AI agents × embedded / edge AI. Subscribe, or email me a concrete problem.

Guestbook →Subscribe (RSS)Support

Comments 0

No comments yet — be the first!

No login required; name is optional.