fw4: include virtual L3 devices in flowtables - #102
Open
dormancygrace wants to merge 1 commit into
Open
Conversation
Some netifd protocols, such as WireGuard and QMI QMAP, expose an l3_device but no underlying device. This leaves related_physdevs empty and omits the actual ingress device from software flowtables. Track flowtable and virtual-only devices separately. Prefer the existing physical device and fall back to the logical L3 device only when netifd reports no physical device. Append virtual-only devices after hardware capability probing so hardware and software offload can coexist in one flowtable. This preserves existing Ethernet, bridge, VLAN and PPPoE selection and leaves hardware probing unchanged. Add mock coverage for those paths and for mixed physical and virtual device resolution. On an MT7620 router, WireGuard over QMAP/LTE at 18 Mbit/s reduced CPU from 69.24% with the existing device list to 51.88%. An 80 Mbit/s Ethernet NAT control remained hardware-offloaded. Link: openwrt/openwrt#10224
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some netifd protocols expose an
l3_devicebut no underlyingdevice.WireGuard and QMI QMAP are examples. fw4 currently derives the flowtable
device list exclusively from
device, so it omits the interface on whichdecapsulated packets actually enter the stack. The affected direction cannot
use software flow offload.
Track two additional per-zone lists:
falling back to the logical L3 device only when no physical device exists;
hardware-enabled flowtable can retain software fallback for unsupported
virtual paths.
This deliberately preserves the existing device choice for Ethernet, bridges,
VLAN and PPPoE. It also deduplicates paired protocol instances: for example, a
wan6instance withoutdevicecannot addpppoe-wanwhen the correspondingIPv4 instance reports its physical device. The hardware resolver and its
lower-device probing remain unchanged.
Validation:
mixed hardware/software flowtable;
three valid runs):
PPE devices plus
rmnet-wwan0andwgtest. WireGuard conntrack used[OFFLOAD], not[HW_OFFLOAD], while an 80 Mbit/s Ethernet NAT controlretained
[HW_OFFLOAD]and about 81% router idle CPU. Both traffic classestherefore coexist in the same
flags offloadflowtable.Related discussion: openwrt/openwrt#10224