Repository navigation
fix(start-wrt): turn off flow offloading - #4689
Conversation
#4460 turned on fw4 software flow offloading for new installs and, through the EnableFlowOffloading migration, for every router updating to 1.4.0. With it on, TCP routed from one profile to a Wi-Fi client in another stalls: a wired or USB client in a second profile sending to an Admin Wi-Fi client managed ~0.1 Mbit/s with hundreds of retransmissions, and SSH sessions lagged while VS Code Remote-SSH timed out after logging in. Reproduced on a K1 running 1.4.0. The stall needs all of: offloading on, traffic routed between two profiles of br-lan, a Wi-Fi receiver, and multi-segment GSO packets. It is clean with offloading off, within one profile (bridged), to a wired receiver in another profile, from the WAN to Wi-Fi, for offloaded UDP, and with the sender limited to gso_max_segs 1. The packets reach the Wi-Fi netdev's egress hook, but mac80211 transmits only what the client receives, and no counter records the loss. The exact kernel line is not yet known; the likely point is mac80211's software segmentation, which frees a packet silently when skb_gso_segment fails. DisableFlowOffloading clears the '1' the earlier migration and firstboot config wrote; an explicit '0' or any other value stays. An owner's own '1' cannot be told apart and is cleared too. The firstboot firewall drops the option, so fresh installs match 1.3.0. The threaded NAPI and packet steering half of #4460 is unchanged. Bench, USB Ethernet client in a second profile, before and after: profile-to-Wi-Fi TCP 0.1 -> 102-110 Mbit/s with 0 retransmissions; WAN TCP 941 up / 804 down -> 941 / 801; WAN UDP at 950 Mbit/s offered 950 / 943 -> 465 / 288.
helix-white
left a comment
There was a problem hiding this comment.
Approved on code review of 04f8afa69. The branch merges cleanly with current master.
Before merge: the changelog/version check is failing: the latest stable StartWRT tag is still 1.3.0, so the pending minor fragments require 1.4.0 rather than 1.4.1. Preserve the stated release order: tag the actual 1.4.0 image commit first, then obtain a passing version check. This approval does not treat that failed check as success.
This disables software flow offloading by default to address cross-profile TCP stalls with a Wi-Fi receiver. It extends the existing append-only, pre-network migration runner rather than adding a recurring configuration rewrite. Migration 15 removes the first firewall defaults section's flow_offloading value when it is 1; an owner's manually selected 1 is also cleared, while 0, yes, and other values remain untouched. Fresh images omit the option. Existing migration numbering, backup/restore handling, threaded NAPI, and packet steering remain intact. There is no RPC schema change.
The workaround avoids the failing offload path; it does not fix the suspected kernel segmentation failure. The consequential tradeoff is lower high-rate UDP throughput: the author's K1 bench reports WAN UDP falling from 950/943 to 465/288 Mbit/s up/down, while WAN TCP remains approximately 941/801 Mbit/s and cross-profile Wi-Fi TCP recovers to 102–110 Mbit/s. Preserving non-1 custom values also permits owners to retain offloading explicitly.
Implementation diff: +27 / −2 lines in 3 files (excludes lockfiles, tests, docs, release notes, and changelog).
Verification evidence is author-reported: 949 + 37 tests passed, formatting passed, and a deployed binary on a K1 with 1.4.0 configuration exercised migration, repeated boot, backup restore, preserved custom values, and throughput. Those runs are recorded against precursor 6c145c041, which is not retrievable from the current forge history; I inspected the final head without executing it. Fresh installation and real OTA were not exercised; other Wi-Fi profiles, 2.4 GHz, and onboard-LAN throughput remain unverified. Current CI has passed Prettier, conflict-marker and license checks; automated tests, formatting/lockfiles, generated artifacts, and binary builds remain pending. The full OpenWrt image job was skipped.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
1.4.0 is being re-cut with this fix before it reaches stable, so stable users never receive flow offloading or the stall it caused. Revert the 1.4.1 bump, drop the fixed fragment, and remove the offload sentence from 1.4.0's throughput entry. Beta routers that installed the first 1.4.0 still run DisableFlowOffloading on their next install, which their migration record of 14 leaves pending.
Helix-Harness: pi Helix-Model: openai-codex/gpt-6.1-sol
helix-white
left a comment
There was a problem hiding this comment.
One remaining release-note correctness issue on 184850bf5: projects/start-wrt/changelog/patch-changed-wired-throughput.md:5 still promises that wired Internet traffic "reaches full gigabit speed" without qualifying the protocol. Disabling offloading makes that claim false for the recorded WAN UDP workload: this PR's evidence reports 465/288 Mbit/s after the change, versus 950/943 before it. The description also correctly notes that the onboard-port gigabit figure was measured with offloading enabled, not this configuration. This fragment is selected for the release highlights, so the user-facing claim needs to describe the retained improvement without promising full gigabit throughput. The proposal makes that one-line correction; it does not require additional benchmarking.
The migration and fresh-install configuration are unchanged from my previous review, and I found no new runtime defect. Keeping the version at 1.4.0 for the unreleased re-cut removes my earlier requirement to tag the offloading-enabled image first; that previous release-order advice is superseded. The explicit same-version update target is supported by the existing handler, while normal newer-version discovery will not offer the re-cut to routers already on 1.4.0, consistent with the revised rollout description.
The reviewed head merges cleanly with current master. I did not build or run tests; current CI was still running when inspected.
Proposed changes: 184850b...proposal/4689
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
|
helix-white
left a comment
There was a problem hiding this comment.
The only change since my previous review is the throughput release-note fragment. It is now exactly my proposal: "Improved wired throughput by spreading each Ethernet port's work across the router's processor cores." The fragment no longer claims full gigabit speed, which the recorded UDP results contradict, and it still holds without offloading. Migration and firstboot code are unchanged from what I reviewed. The head (fccd9b52b) merges cleanly with current master.
Summary. This re-cuts StartWRT 1.4.0 with software flow offloading turned off. When offloading is on, TCP routed from one profile to a Wi-Fi client in another profile stalls at about 0.1 Mbit/s. Migration 15 (DisableFlowOffloading) runs before networking starts and removes flow_offloading '1' from the first firewall defaults section. Values such as 0 and yes stay as they are. An owner who deliberately set 1 cannot be told apart from the value the release wrote, so that setting is cleared too. Fresh images no longer set the option, which matches 1.3.0. Threaded NAPI and packet steering from #4460 stay. No RPC or data-model contract changes.
Implementation diff: +26 / −1 lines in 2 files (excludes lockfiles, tests, docs, release notes, and changelog).
Rollout. The version stays 1.4.0, so stable users never get the release that enabled offloading. Beta routers already running the first 1.4.0 have migration record 14. They clear the setting only when they reinstall 1.4.0 explicitly (a same-version --target-version update, sysupgrade, or the microSD Keep-settings path) or when they move to a later release. Normal update discovery does not offer them the re-cut.
Tradeoff. This works around the failure rather than fixing it. The suspected cause, silent loss in mac80211's software GSO segmentation, is not root-caused. The cost is high-rate UDP throughput: the author's K1 bench measured WAN UDP falling from 950/943 to 465/288 Mbit/s up/down, while WAN TCP held at about 941/801 Mbit/s and cross-profile Wi-Fi TCP recovered to 102–110 Mbit/s.
Testing. All evidence is author-reported. The runtime tests ran on 6c145c041, whose migration and firstboot code match this head: 949 + 37 tests and formatting passed, and a K1 with a 1.4.0 configuration and the binary deployed covered the migration, a repeat boot that did not rerun it, preserved custom values, backup restore and throughput. On this head the author reports that check-version and pinned Prettier pass. Fresh install, real OTA, same-version reinstall, onboard-LAN-port throughput, wired cross-profile traffic, non-Admin Wi-Fi profiles and 2.4 GHz were not exercised. I read the code and did not run it. When I checked, CI on this head had only metadata, classification and conflict-marker checks running, and the build and test jobs were skipped for this fragment-only change.
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Summary
#4460 turned on fw4 software flow offloading for new installs and, through the
EnableFlowOffloadingmigration, for every router updating to 1.4.0. With offloading on, TCP routed from one profile to a Wi-Fi client in another profile stalls at ~0.1 Mbit/s with hundreds of retransmissions: SSH sessions lag, and VS Code Remote-SSH logs in and then times out.1.4.0 is being re-cut with this fix before it reaches stable, so stable users never receive offloading:
Migration::DisableFlowOffloading, appended as the 15th migration, clears the1that the first 1.4.0's firstboot config and migration wrote. An explicit0or any other value stays. An owner's own1reads the same and is cleared too. Beta routers that installed the first 1.4.0 have a migration record of 14, so they run it on their next install: the re-cut 1.4.0 reinstalled by hand (startwrt-cli system update --target-version 1.4.0, sysupgrade, or the microSD wizard's Keep settings) or any later release.firstboot_config/firewalldropsoption flow_offloading 1, so fresh installs match 1.3.0.patch-changed-wired-throughputentry now reads "Improved wired throughput by spreading each Ethernet port's work across the router's processor cores." It no longer claims full gigabit speed, which UDP doesn't reach without offloading, or that established connections skip the per-packet firewall checks.Diagnosis
Reproduced on a K1 running 1.4.0. The stall needs all of these: offloading on, traffic routed between two profiles of
br-lan, a Wi-Fi receiver, and multi-segment GSO packets. Each of these was clean:gso_max_segs 1.The packets reach the Wi-Fi netdev's egress hook, but mac80211 transmits only what the client receives, and no drop counter records the loss. The exact kernel line is not identified, because the image has no tracing or tcpdump. The likely point is mac80211's software segmentation (
ieee80211_tx_skb_fixup), which frees the skb silently whenskb_gso_segmentfails. Root-causing it is follow-up work, and offloading should stay off until then.Verification
The code (
migrate.rs,firstboot_config/firewall) is identical between 6c145c041, which was tested and benched, and HEAD fccd9b5. Since then only the version (back to 1.4.0) and the fragments have changed.make start-wrt-test: 949 + 37 passed, including the newflow_offloading_an_earlier_release_enabled_is_clearedandflow_offloading_stays_off_from_before_it_shipped.make start-wrt-format.check-version projects/start-wrtpasses at 1.4.0, andmake release-notes-testpasses. On fccd9b5, which changes only the throughput fragment's wording:check-versionand the pinned Prettier pass.startwrt-cli migratewith the record rewound keptyesand0and cleared1.bench.sh smokepassed after each of three reboots.Throughput with a USB Ethernet client in a second profile:
Not verified:
startwrt-migrateinit script and migration code.