This issue was reported to me by a friend of mine who purchased a b1300 intending to run stock OpenWrt on it. When he told me about the issue I posted here and have since upgraded my own router so that I can use my home network for testing.
With a default configuration after upgrading to 21.02.1 using sysupgrade -n
I tried to send traffic between two hosts connected on different vlan interfaces of the eth0 interface of the router. I had somewhat variable but still very good performance using iperf3, here are two results:
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1002 MBytes 840 Mbits/sec 206 sender
[ 5] 0.00-10.00 sec 1000 MBytes 838 Mbits/sec receiver
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 917 MBytes 769 Mbits/sec 234 sender
[ 5] 0.00-10.00 sec 915 MBytes 767 Mbits/sec receiver
This traffic was routed but not NATed, so I configured a NAT entry for my test client and server, this resulted in relatively comparable performance results:
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 913 MBytes 766 Mbits/sec 160 sender
[ 5] 0.00-10.00 sec 911 MBytes 764 Mbits/sec receiver
I then tested between a client on my network and a a laptop connected to my ISPs router, so that traffic was sent out the WAN eth0 interface. This resulted in dramatically slower traffic in upstream (sending out WAN interface, default iperf client to server behaviour):
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 356 MBytes 299 Mbits/sec 435 sender
[ 5] 0.00-10.00 sec 355 MBytes 298 Mbits/sec receiver
Downloading using iperf3 -R was somewhat faster:
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 593 MBytes 497 Mbits/sec sender
[ 5] 0.00-10.00 sec 593 MBytes 497 Mbits/sec receiver
I do not understand why the WAN interface behaves so differently, and so much worse than routing or even NAT between two different networks on the LAN (eth0) interface.
I enabled packet_steering by adding the following to /etc/config/network and running /etc/init.d/networking restart
:
config globals 'globals'
option ula_prefix 'some-v6-stuff'
option packet_steering 1
This doesn't appear to have resulted in significant changes in performance when testing using iperf, looking at the output of /proc/interrupts
as discussed in another thread I see that all eth related interupt processing is occuring on CPU0:
[...]
60: 927913 0 0 0 GIC-0 97 Edge edma_eth_tx0
61: 15625 0 0 0 GIC-0 98 Edge edma_eth_tx1
62: 334264 0 0 0 GIC-0 99 Edge edma_eth_tx2
63: 326 0 0 0 GIC-0 100 Edge edma_eth_tx3
[...]
Enabling software flow offloading (with packet_steering still "active") did have a bigger impact, with performance improved as follows for upload (lan to wan):
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 597 MBytes 501 Mbits/sec 44 sender
[ 5] 0.00-10.00 sec 596 MBytes 500 Mbits/sec receiver
Download (wan to lan) results were more mixed and confusing:
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 42.0 MBytes 352 Mbits/sec
[ 5] 1.00-2.00 sec 44.6 MBytes 375 Mbits/sec
[ 5] 2.00-3.00 sec 36.9 MBytes 309 Mbits/sec
[ 5] 3.00-4.00 sec 24.1 MBytes 202 Mbits/sec
[ 5] 4.00-5.00 sec 22.6 MBytes 190 Mbits/sec
[ 5] 5.00-6.00 sec 26.3 MBytes 220 Mbits/sec
[ 5] 6.00-7.00 sec 42.1 MBytes 353 Mbits/sec
[ 5] 7.00-8.00 sec 50.7 MBytes 425 Mbits/sec
[ 5] 8.00-9.00 sec 51.1 MBytes 429 Mbits/sec
[ 5] 9.00-10.00 sec 37.9 MBytes 318 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.00 sec 378 MBytes 317 Mbits/sec sender
[ 5] 0.00-10.00 sec 378 MBytes 317 Mbits/sec receiver
I haven't tested with irqbalance but I am surprised by the performance results I'm seeing and the significant differences between traffic across eth0 and out eth1. If anything I would expect to see better performance through two distinct interfaces.
Finally, prior to upgrading, and while on version 18.06.9 I ran some tests between VLANs that ran very close to line rate; I don't have many examples on hand but here's one that was clearly faster than any of the tests above.
[ 5] 0.00-10.01 sec 1.07 GBytes 921 Mbits/sec receiver