The pull request is applied to the master branch!
PR is open on GitHub.
It is possible to achieve 2 Gbps routing in total on devices with MT7621 SoCs.
Currently you can only get a maximum of 500/500 Mbps (download/upload) speed on LAN/WAN routing (this includes NAT too). The reason is explained at the bottom of the post.
With this patch, 1000/1000 Mbps routing or 2 Gbps total bandwidth to the CPU is possible.
Here are the results for iperf3 bidirectional speed test with hardware offloading.
Routing and NAT performance is identical.
Without the patch
[ 5][RX-S] 0.00-20.00 sec 353 MBytes 148 Mbits/sec receiver [ 8][TX-S] 0.00-20.00 sec 1.79 GBytes 769 Mbits/sec 0 sender
With the patch
[ 5][RX-S] 0.00-20.00 sec 2.16 GBytes 926 Mbits/sec receiver [ 8][TX-S] 0.00-20.00 sec 1.80 GBytes 775 Mbits/sec 0 sender
Check out the changes of the phy muxing commit for supported devices.
Devices confirmed working:
See GitHub PR above.
Single port devices:
No muxable phy on these:
RGMII2 pins are used with an external phy on these:
RGMII2 pins are used as GPIO on these:
You download a file from internet with 1000 Mbps speed.[*] Traffic will flow through wan to lan. On the CPU port, this causes 1000/1000 Mbps load because it receives 1 Gbps traffic from wan then transmits 1 Gbps traffic to lan.
Let's say someone uploads a file with 1000 Mbps speed at the same time. Traffic will flow through lan to wan. Since there's no bandwidth left on the CPU port it will halve the speed.
Therefore, you can only download a file at 500 Mbps and upload a file at 500 Mbps at the same time.
With this patch, wan port is connected directly to the CPU on a second link.
Now, you can download and upload a file at 1 Gbps at the same time.
[*] In a real life scenario, your computer downloading the file has to send some packets back (upload) because the TCP packets for downloading the file may be out of order, some of it may have to be re-sent, etc.. So you won't even get to download your file with 1 Gbps download speed on a single link to CPU.
Therefore, this patch should also improve 1 Gbps speed for just downloading or uploading.
I do the test on a single computer. I have two gigabit ports on my motherboard.
I isolate a port by putting it on another network namespace to do the test.
iperf client: 192.168.2.2/24
iperf server: 192.168.3.1/24
ip a add 192.168.2.2/24 dev enp9s0 ip l set up enp9s0 ip route add 192.168.3.1 via 192.168.2.1 iperf3 -c 192.168.3.1 --bidir -t 20
ip netns add iperfserver ip link set dev eno1 netns iperfserver ip netns exec iperfserver ip a add 192.168.3.1/24 dev eno1 ip netns exec iperfserver ip l set up eno1 ip netns exec iperfserver iperf3 -s
The ports called "wan" are muxed where possible. On a minority of devices, this is not possible. Those cases:
The "wan" port is just what the vendor designated on the board/plastic chasis of the device. On a technical level, there is no difference between a lan and wan port on MT7621AT/MT7621ST SoCs. Prefer connecting to WAN via the port described above for these devices to benefit the feature brought with this patch.