Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use it with vlan-aware bridge - create a bridge for use for wan /etc/systemd/network/11-wanbr.netdev [NetDev] Name=wanbr Kind=bridge [Bridge] DefaultPVID=0 # should be different to other vlan-aware bridges (like lanbr) VLANFiltering=1 - map aux and wan to vlan-aware bridge - traffic will be tagged inside with vlan-id 99 /etc/systemd/network/12-wan-bind.network [Match] Name=wan aux [Link] RequiredForOnline=no [Network] BindCarrier=eth0 Bridge=wanbr [BridgeVLAN] VLAN=99 PVID=99 EgressUntagged=99 - configure eth1 as wan /etc/systemd/network/15-wan.network [Match] Name=eth1 [Network] BindCarrier=eth0 Address=192.168.0.18/24 Gateway=192.168.0.10 DNS=192.168.0.10 IPForward=yes
- Loading branch information
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @frank-w is this patch for offloading wan traffic to eth1?
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, this makes Port 5 acessable from userspace to create the vlan-aware Bridge to byass dsa for wan (or other Ports) and map them to eth1...it is No offloading in Terms of hw acceleration
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frank-w Here's what I understand. Port 5 is supposed to be a CPU port, however, by making it a user port, it will be a slave of gmac0 which is wired to port 6's gmac. Because port 5's gmac is wired to gmac1, any frames sent to the slave interface of port 5, aux, will appear on eth1, the interface of gmac1. Since there's bridge offloading on the MT7530 DSA subdriver, frames between interfaces will be offloaded to switch hardware so it won't exhaust the port 6 - gmac0 link.
I gotta say, this is very smart. I wonder if this would work on other DSA subdrivers. I'll do some tests on my Marvell DSA switch.
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this on a BPI-R2 running 6.2.0-rc1 (with your build script and uart patches) with your Debian 10 rootfs.
Works fine. Although I didn't enable vlan_filtering or set vlan_default_pvid to 0 on the bridge.
The bridge does not drop the VLAN tagged frames between aux and wan as long as vlan_filtering is off. So VLAN tagged traffic between eth1 and computer connected to wan port is completely transparent.
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was the example mtk gave me to use second gmac without patching dsa core. maybe vlan_filtering is only needed if you want to use the vlan outside the bridge too (create tagged frames outside of it).
but good to know it still works...have not tried it again in 6.1 as i still try to get r3 vlan working...
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this is useful, there's no need to do this on MT7530 switch since it supports muxing phy0/4 to its gmac5.
I intend to submit this to mainline:
Also do you plan to submit 5cff381 to mainline? Serial won't work without it.
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should not drop wan-port in mainline also not if using gmac2 for it fixed by dts...this will break existing systems
for the serial-change...i only reordered the uarts so that uart2 (the debug-uart is found first and mapped to ttyS0)...by default this uart is ttyS2 and dts alias section or bootloader should point to it...i made this change to keep it compatible with vendor kernel
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only issue I see is the interface name will change from wan to eth1. That's nothing compared to gaining 2 Gbps routing in total on the device, in my opinion.
If I understand correctly, vendor kernel uses ttyS0 for console compared to mainline using ttyS2? Your patch here changes that back to ttyS0 so the bootloader can boot both kernels with console working?
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,Interface Name will Change and so it Breaks existing userspace settings (Network config,Netfilter)
There is No Mainline Image,only Code and there should be Default bootargs pointing to uart2 or a serial0 alias,so without bootargs in bootloader it should work. But bpi Images have ttyS0 set as bootargs,so this is overridden
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. They will have to update their userspace configuration on newer kernels if this goes through. I'll submit the patch and hear everyone's thoughts.
Thanks, I just removed console= from bootargs and console works fine without swapping uart. As a side effect, now I also see debian stuff starting with
[ OK ]
.c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to ask here, I assume this is you. Were you able to fix this other than pre-up post-down commands?
https://unix.stackexchange.com/questions/629714/buildroot-adding-bridge-via-interfaces
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No,did not get it working with standard-syntax i know from debian.
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the ifup ifdown commands don't include the the bridge extensions to the standard interfaces(5) file format.
ifup/ifdown won't do anything with bridge_ports option, for example. Installing bridge-utils or ifupdown doesn't help.
I'm going to ask the buildroot mailing list. If nothing works, I'll check NetworkManager.
c92b648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For anyone else seeing this page mentioning the issue with buildroot, there's progress:
https://bugs.busybox.net/show_bug.cgi?id=13466#c4