Repository navigation
Conversation
|
@Ansuel @LorenzoBianconi This patch will get rid of the need for bridger for L2 offload. And With the bridger plugin, my wifi offload in eagle platform is very buggy and download constantly dropped to 1M, after removed bridger and applied this patch, everything works fine. I also included a screenshoot of my Airoha NPU app that shows the debug counters and live block diagram with the new patches. |
OpenWRT-fanboy
left a comment
There was a problem hiding this comment.
Tested and works well. Should probably be sent upstream at some point.
|
|
The bridger package is broken on snapshot the last I checked it, no flows were bound. This PR works flawlessly on a 250Mbps wan, CPU usage is reduced from 24% to 8% according to top and flows are bound correctly according to Build system: x86/64 |
This should work as well, as long as you make sure the wireless interfaces added to the flow table. |
|
*ttc0419* left a comment (openwrt/openwrt#22533)
<#22533 (comment)>
bridger can work
The bridger package is broken on snapshot the last I checked it, no flows
were bound <nbd168/bridger#9>.
This PR works flawlessly on a 250Mbps wan, CPU usage is reduced from 24%
to 8% according to top and flows are bind correctly according to
/sys/kernel/debug/ppe0/bind and /proc/net/nf_conntrack.
Build system: x86/64
Build-tested: mediatek/filogic (Cudy TR3000 v1 (OpenWrt U-Boot layout))
Run-tested: mediatek/filogic (Cudy TR3000 v1 (OpenWrt U-Boot layout))
—
Reply to this email directly, view it on GitHub
<#22533?email_source=notifications&email_token=AAOA2CKK3JEUWX62QK3RKMD4R66QXA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJQGU4TMNZXHAZKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4105967782>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOA2CLAGKQI56F5B75YGP34R66QXAVCNFSM6AAAAACWZTER6CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCMBVHE3DONZYGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
I fixed briger with this PR: nbd168/bridger#11
…--
UNIX is Sexy: who | grep -i blonde | talk; cd ~; wine; talk; touch; unzip;
touch; strip; gasp; finger; gasp; mount; fsck; more; yes; gasp; umount;
make clean; sleep
|
@LorenzoBianconi The bridger also caused the wireless offload issue under eagle platform with all your patches included the wireless download speed randomly drop to 1M, but with this patch it does not cause that problem. Any thought what might be the cause? |
|
Please refresh the patches with |
This comment was marked as duplicate.
This comment was marked as duplicate.
brada4
left a comment
There was a problem hiding this comment.
There is official upstream bridge flowtable eg https://patchwork.ozlabs.org/project/netdev/cover/[email protected]/
This should not be a one-device thing with global patches.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
|
/claude |
|
Claude finished @hauke's task in 2m 27s —— View job Code Review CompleteI've analyzed this PR which adds L2 bridge offload support to 🔴 Critical Issues1. Upstream Compatibility Concern As @brada4 noted, there is official upstream bridge flowtable support from Pablo Neira Ayuso (netfilter maintainer). The existing Questions:
This needs clarification before merging to avoid technical debt. 2. Direct Bridge Header Include
+#include "../bridge/br_private.h"This is a major red flag. Including private bridge headers with relative paths is fragile and not upstream-acceptable. When this breaks (and it will during kernel updates), it will be painful to maintain. Better approaches:
|
|
Kind of bridge conntrack is old as the world, never fully embraced here. |
Tried your patch, some of the initial flows are bound correctly but the all later flows seem still failed to bind. It's an earlier bug if I recall correctly. |
4b38e08 to
ad5f371
Compare
Refreshed patches. |
That series from 2020 was never merged upstream — nft_flow_offload still has no bridge support in mainline as of 6.12. These patches fill that gap based on what MediaTek ships in their vendor SDK (999-ppe-15/16/24) which has been in production use on MT7988 platforms. Regarding global patches — the generic kernel patches are a no-op on devices without hardware flow offload. The code paths only activate when a flowtable with flags offload is configured and the hardware driver supports TC flower. The airoha-specific commit (sysctl, kmod, hotplug) is correctly scoped to the an7581 target only. @ttc0419 confirmed it also works on MediaTek filogic (MT7981), so this benefits both platforms. |
|
Just to point out that there is competing upstream work |
|
The upstream suggestion looks more comprehensive but dead in the water for five years. I like that @rchen14b's solution is already widely deployed and lightweight, so easy to revert if something better comes along. This kind of workflow to integrate with firewall is unfortunate though: # Reload once per boot (flag cleared on reboot via /tmp)
[ -f /tmp/.flow-offload-wifi-done ] && exit 0
touch /tmp/.flow-offload-wifi-done
# Delay to let all WiFi interfaces finish coming up
(sleep 5 && /etc/init.d/firewall reload) 2>/dev/null & |
|
I do not like this sleep 5 approach. It'd be much better to add the script directly (without sleep) inside /etc/hotplug.d/ieee80211 - as this would be executed after creating phy*-ap interfaces. Maybe some trigger instead of restart would be better - I mean something like: ubus call firewall reload |
|
The bigger problem is that HW offload does not work at all with any kind of roaming. Between wifi netdevs or to wired extender., as all states are fixed between macs + netdevs for sysctl-able expiration timer. |
That approach was the only one I could think at the time when testing it, I think the firewall restart might be a better approach, will do some testing and update here. |
Is this a valid concern to you @rchen14b ? |
It works on my redmi ax6s with 802.11r with usteer 802.11kv. Ping tests only drop <=1 packet during roaming. However, the mediatek team thinks it might still happen as they have patches to improve roaming support by removing flow entries dynamically: 999-eth-42-mtk_eth_soc-add-roaming-handler.patch, 999-ppe-08-mtk_ppe-add-roaming-handler.patch. |
kmod-nf-conntrack-bridge package and enabled hw offload is enouth for me. Can you show me |
sorry. since it was not working. I have flashed back my usual stable firmware. Maybe someone else can also try it out. |
I have 2 ax3000t setup as access points, when I enable wed, roaming doesn't work, even with the bridger package installed. Would your patches fix this? If so, I can give it a go to see if it works? |
Sure. For me it working ok with wlan<->lan offload, but my w1700k is not working as dummy AP.
I'm not tested it on filogic yet, but you can try. |
Would you be able to create an image for me if possible with the following packages, plus any additional required for offloading collectd-mod-thermal curl getrandom hostapd-utils htop iperf3 irqbalance kmod-cfg80211 kmod-crypto-aead kmod-crypto-authenc kmod-crypto-ccm kmod-crypto-cmac kmod-crypto-des kmod-crypto-gcm kmod-hwmon-core kmod-lib-crc-ccitt kmod-libphy kmod-mac80211 kmod-mt76-connac kmod-phy-aquantia kmod-ppp kmod-pppoe libuclient luci-app-attendedsysupgrade luci-app-firewall luci-app-package-manager luci-app-statistics luci-app-usteer luci-light luci-ssl owut wpad-mbedtls -nftables -wpad-basic-mbedtls No problem if you can't, I'll try to figure it out. |
Sorry, but I don't want to brick your APs :) |
I have ASUS BT8 and i'm also interested in the WED functionnaly for it! Thanks for your work |
|
@danpawlik If the mailing list didn't like br_netfilter, why not ask AI to re-write the patch without it? You know, like this: |
I assumed that the kernel community would prefer to go with Eric solution. To avoid additional work that probably would not be merged, I make a step back to see how Eric change works, wait for it and then make additional patches. |
…ered flows When vlan_filtering is enabled and a packet arrives without a VLAN tag (bridged via the port PVID), the bridge offload path places the PVID into the path context for the forward-path walk but not into info->num_encaps. When the walk reaches an untagged destination port and emits DEV_PATH_BR_VLAN_UNTAG, the handler finds num_encaps==0 and cannot decrement it, resulting in incorrect or absent hardware offload entries. WiFi clients on untagged VLANs cannot communicate with wired ports. Tagged VLAN flows (skb_vlan_tag_present) are not affected and continue to use hardware offload correctly. Only skip bridge offload when the packet has no VLAN tag and VLAN filtering is active. Such flows fall through to software bridging, which handles PVID-based forwarding correctly. Closes: openwrt#22533 (comment) Reported-by: gongtao0607 <[email protected]> Signed-off-by: Daniel Pawlik <[email protected]>
|
@chbgdn Hi, thanks for the effort. To report back, I have briefly tested your patches rebased to fanboy/ubi2 (Thanks @OpenWRT-fanboy ) on a w1700k AP. SSID on untagged vlan now works normally (Yay). On top of that, I can see BND traffic in the With that being said, the patch needs a fix: I got this compile error when building all kmods: (Maybe there is more) Another issue I found but may or may not related to your patch is that once I add |
Just tried another build. And this time it seems to work well. Bridge flows are properly offloaded. Putting it through more tests to be sure. Edit: Edit 2: Edit 3: |
Just built and testing your work. So far working as expected. HW Offload is working by looking at btop doing wifi transfers. I'm using mine as a WAP on a W1700k HW1.0. |
|
@chbgdn please create new pull request, that we can make comments. Right now, we are mixing solution in one PR that might be confusing to someone who is reading last comments. @rchen14b what you would like to do with this PR? From one side, kernel maintainers would not merge that solution, from other, dont' see any reply from OpenWrt core reviewers if they would approve that. I think decision is yours. |
|
@gongtao0607 @glassd00r @skramstad @danpawlik Thanks all for testing, I'll prepare new PR today (or maybe it will need few PRs, idk). |
I managed to get an image made. It didn't brick my device, but enabling wed, /sys/kernel/debug/ppe0/bind was empty. Some devices were unable to connect to some wireless networks which were on the non default vlan. |
Mine |
Which device do you have? I still have the image and can flash it or compile a new one if required |
W1700k. |
Thanks, can you share output of @danpawlik @glassd00r @skramstad @gongtao0607 @d687r02j8g I created new draft-PR #24038 so lets move our conversation in it. |
|
Just a thought, usually if we are doing sqm we disable offloading for it, it would be better in my opinion for this to be a seperate toggle for this kind of offloading since its not usual to do any qos on bridges since the bandwidth is usually adequate. Same idea in #24038 should apply if that was to be merged. |
imho.. if bridger works as intended there will be no need for this or other variation of bridge offload via nft_flow_offload. |
I do support this too but also i do acknowledge that some people might want to do weird stuff on their bridges and would want this off. |
easy to exclude the bridge from the offload flow table. |
There was a problem hiding this comment.
@rchen14b Please rebase branch main, thx.
git fetch upstream main
git rebase upstream/main
|
@peterwillcn it is superseded with #24038 |

Summary
Bridged traffic (e.g. WiFi client to wired LAN through br-lan) currently
cannot be offloaded via nft_flow_offload. Only routed/NAT flows get
picked up by the flowtable. This means AP/bridge mode setups always go
through the full kernel bridge + conntrack + netfilter path for every
packet, regardless of hardware capabilities.
These patches add bridge awareness to nft_flow_offload:
This benefits both software and hardware flowtable users:
flow_offloading=1): bridged traffic takes thekernel fast path, skipping per-packet conntrack/firewall/FDB lookups.
Works on any device, no PPE or hardware offload needed.
flow_offloading_hw=1): bridged flows are pushedto PPE hardware on MediaTek and Airoha platforms for wire-speed forwarding.
The second commit enables the required infrastructure on the Airoha AN7581
target (kmod-br-netfilter, sysctl, WiFi flowtable hotplug).
Based on MediaTek SDK patches (999-ppe-15, 999-ppe-16, 999-ppe-24) by
Bo-Cun Chen and chak-kei.lam. Adapted and tested on Airoha AN7581.
The PPE drivers on both MediaTek (mtk_ppe) and Airoha (airoha_ppe) already
support PPE_PKT_TYPE_BRIDGE entries — these patches complete the netfilter
side of the pipeline.
Test results
for both wired and WiFi bridged flows
from 24% to 8% on 250Mbps WAN, flows bound correctly
a flowtable is configured
Test plan