Repository navigation
feat(start-wrt): turn flow offloading back on with the flowtable fixed - #4691
Dominion5254 wants to merge 2 commits into
Conversation
Linux 6.18.y backported b5964aac51e0 ("netfilter: flowtable: consolidate
xmit path") and 2bdc536c9da7 ("netfilter: flowtable: always set route
tuple out ifindex"), which make an offloaded neigh-xmit flow transmit on
the device that forward path discovery found instead of the route's
device. For a route that ends at a bridge that breaks two ways:
- mac80211 reports no forward path for mt7915 without WED, so a flow
towards a Wi-Fi client is offloaded with no output device: the fast
path tears it down and drops the packet, the classic path offloads it
again, and up to every other packet is lost.
- For a wired client on a bridge without VLAN devices, the single-profile
layout, discovery resolves to the bridge port. The flow bypasses the
bridge, so it skips the bridge output hook that binds a published IPv6
address to its device, and keeps leaving through that port after the
client has moved to another.
Carry two kernel patches until 6.18.y has a fix:
- 0005 calls neigh_event_send() before the fast path uses the neighbour
address, as the classic output path does, so an unresolved or departed
neighbour is probed instead of being sent to an all-zero or stale MAC.
- 0006 transmits a neigh-xmit flow through the route's device unless the
path's last device is a flowtable device, as before those commits.
The kernel bump steps now say to re-check both patches, which still apply
over an upstream fix that changes what they do.
1.4.0 shipped with flow offloading off because the kernel dropped offloaded packets towards Wi-Fi clients. With the flowtable patches in place, RestoreFlowOffloading sets it for a router that has no setting, and the firstboot firewall sets it for a new install. An explicit value stays. A router that skips releases runs EnableFlowOffloading, DisableFlowOffloading and RestoreFlowOffloading in one pass; the activity entry names only the last of a migration and the one that undoes it.
helix-white
left a comment
There was a problem hiding this comment.
Approved on code at 20e89e5656b549c479808bdfb21fc90580e29f29; it merges cleanly with current master. No correctness changes requested.
Before merge: release/tag StartWRT 1.4.0 and rerun the failing Changelog fragments & versions check. Its log confirms the documented mismatch: expected 1.4.0, found 1.4.1. Other CI remains pending; this approval does not establish passing CI.
Brief
- Restores software flow offloading for fresh installs and upgrades with no saved setting, while preserving an explicit disable. The append-only migration reuses the existing enable helper and migration record; it adds no separate setting or API contract. Updates that skip releases still run the intervening migrations, but their activity summary omits effects subsequently undone in the same pass.
- Fixes two independent kernel failures before restoring that default. The route-device fallback avoids dropping Wi-Fi-bound packets after failed path discovery and avoids bypassing bridge output filtering or pinning wired traffic to an obsolete bridge port. Both IPv4 and IPv6 neighbour-transmit paths now drive neighbour resolution/probing before using the destination MAC; an unusable neighbour tears down the flow and drops that packet, leaving subsequent packets to classic forwarding.
- Reuses the kernel neighbour state machine rather than inventing neighbour tracking. The intentional departure from mainline's fail-closed discovery changes preserves acceleration with the pinned OpenWrt firewall, whose software flowtable lists zone devices rather than their bridge ports. Carrying these patches costs an explicit semantic review at each kernel bump; the contributor instructions now require it.
Implementation diff: +67 / −5 lines in 5 files (excludes lockfiles, tests, docs, release notes, and changelog). Kernel patches count their stored unified-diff payload, excluding explanatory headers.
Evidence and limits
The author reports 949 + 37 passing Rust tests, clean scoped formatting, and patch applicability to pristine Linux 6.18.57. Recorded K1 bench evidence covers the Wi-Fi stall, bridge output/drop enforcement, movement between bridge ports, departed neighbours, throughput, VPN forwarding, reboot migration, replay, and explicit-disable preservation. Reported WAN-to-Wi-Fi TCP improved from approximately 10 KB/s on the stock image to 103 Mbit/s with the patches.
I traced the patches against the pinned kernel source, neighbour state machine, flow-route ownership, OpenWrt firewall device selection, and migration callers/tests. I ran no builds or tests. End-to-end PPPoE and LAN/WAN IPv6, the actual IPv6 MAC-spoof scenario, and a clean image build remain unverified; the recorded bridge-hook enforcement test used an analogous IPv4 rule. CI's OpenWrt image build is skipped; automated tests, formatting/lockfiles, generated artifacts, and binary builds are still running. Prettier, conflict-marker, and dependency-license checks have passed.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
helix-white
left a comment
There was a problem hiding this comment.
Changes requested for base integration: git merge-tree --write-tree origin/master 20e89e5656b549c479808bdfb21fc90580e29f29 confirms a content conflict in projects/start-wrt/backend/ctrl/src/migrate.rs against master 9cef87c9b09ced9dc28a588a22b96e808357d34f.
The proposal merges that base while keeping its TurnOffRemoteAccess migration as entry 16 and appending RestoreFlowOffloading as entry 17. Keeping this order is necessary: routers with record 16 have already completed Remote Access migration and must still restore offloading. Both enum variants and their handlers remain. The conflicting legacy-offloading test keeps this PR's direct helper invocation, rather than running the full runner that now restores offloading afterward.
The proposed merge is conflict-free against that base. As reviewer, I have not run builds or tests and have not changed the PR branch. Please adopt the base integration, verify the resolved migration behavior, and re-request review. My earlier code approval does not cover this unresolved integration.
Proposed changes: 20e89e5...proposal/4691
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
Confirmed against master |
Helix-Harness: pi Helix-Model: openai-codex/gpt-6.1-sol
helix-white
left a comment
There was a problem hiding this comment.
The PR still conflicts in projects/start-wrt/backend/ctrl/src/migrate.rs against master 4d58b935488b6699f8399f280ed0b343aec7a933. Master has now appended another migration, so the earlier proposal also needed updating.
Refreshed proposal/4691 at 5a297eaad merges current master, preserves TurnOffRemoteAccess as entry 16 and SplitAutomaticForwardTransports as entry 17, then appends RestoreFlowOffloading as entry 18. This keeps routers with migration record 17 from skipping restoration and retains master's transport-splitting migration and its regression coverage. No published migration is reordered.
The proposal merges cleanly with that base. It is a reviewer proposal only: no builds or tests were run and the PR branch remains untouched. Author integration, verification of the adopted resolution, and renewed review remain required.
Proposed changes: 20e89e5...proposal/4691
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
1.4.0 ships with flow offloading off (#4689) because the kernel dropped offloaded packets towards Wi-Fi clients. This fixes the kernel and turns offloading back on, as 1.4.1.
Cause
Linux 6.18.y backported b5964aac51e0 ("netfilter: flowtable: consolidate xmit path") and 2bdc536c9da7 ("netfilter: flowtable: always set route tuple out ifindex"). An offloaded neigh-xmit flow now transmits on the device that forward path discovery found instead of the route's device. For a route that ends at a bridge, that breaks two ways:
br-lanwith no VLAN devices, and discovery resolves to the bridge port. The flow bypasses the bridge: it skips the bridge output hook wherestartwrt_pp_v6_bindbinds a published IPv6 address to its device, and it keeps leaving through that port after the client has moved to another.The fast path also wrote
neigh->hainto the frame without looking at the neighbour's state, so a flow to an unresolved or departed neighbour was sent to an all-zero or stale MAC, which a bridge floods.Mainline's fix (871df5007eda, 3ae37eafd366) is not in 6.18.y, and it needs the bridge ports in the flowtable, which the fw4 in OpenWrt 25.12 does not list.
Change
patches-6.18/0005: callneigh_event_send()before the fast path uses the neighbour address, as the classic output path does.patches-6.18/0006: transmit a neigh-xmit flow through the route's device unless the path's last device is a flowtable device, as before those commits.RestoreFlowOffloadingsetsflow_offloadingfor a router that has no value; an explicit value stays. The firstboot firewall sets it for a new install.EnableFlowOffloading,DisableFlowOffloadingandRestoreFlowOffloadingin one pass. The activity entry leaves out a migration that a later one in the same pass undoes.projects/start-wrt/AGENTS.mdgains a step to re-check both patches: they still apply over an upstream fix that changes what they do.Changelog fragments & versionsfails untilstart-wrt/v1.4.0is tagged (1.4.1 is ahead of the expected 1.4.0). Re-run it after the tag; do not merge before the cut.Verification
On 20e89e5 (based on master 35a38d8):
make start-wrt-test: 949 + 37 passed.make start-wrt-format-checkand prettier on the changed Markdown: clean.Live bench, K1, image built from this branch's patches, offloading on:
Throughput against the image before 0006's second hunk, single profile: wired TCP 790 → 785 down, 940 → 941 up; wired UDP at 600 Mbit/s 0% loss both; Wi-Fi 5 GHz TCP 102 → 103 down, 114 → 112 up. Two profiles: wired 800 down, 939 up.
VPN, wired client: outbound 654 down / 549 up Mbit/s, inbound 653 / 677, UDP at 100 Mbit/s 0% loss. The upload figure is the same with offloading off (546). Only LAN → tunnel is offloaded; the tunnel devices are not flowtable devices.
Migration, with the 1.4.1 binary on a router at record 15 with no
flow_offloading: a reboot advanced the record to 16, set the option, brought the flowtable up, and logged "Updated settings for v1.4.1 to speed up forwarding of established connections". A rerun changed nothing; an explicit0at record 15 stayed0. With the migrated config: wired 797 down / 941 up, Wi-Fi 103 / 113, 0% UDP loss, no kernel warnings,bench.sh smokepasses.Added after review, same kernel image, single profile, offloading on:
published-ports set, then the router's neighbour entry for that address pointed at another LAN client. No spoof: 200 of 200 packets delivered. Spoof before the flow: 200 of 200 dropped by the bind. Spoof applied mid-flow: 212 delivered, then 288 dropped. The other client received none, and the flow was offloaded in each case.pppoe-wan; a reboot comes back with the session up and 860 down. The upload retransmissions are the same with offloading off.Not run: a clean image build. This PR's CI skips
Build OpenWrt image, and the local build was incremental.