Kmod-mt76 driver is too slow to use

As all know, the open source driver mt76 is too slow/unstable to use. I built the mt7628 driver using the source codes from rt-n56u, the driver can be built & loaded without any error, but the wifi is not working.

I set up a repository in GitHub (mt7628 ap driver) and uploaded my build script for lede 17.01, hope someone can give me some advice to improve.

I build my own MT7603 and MT76x2 mediatek drivers from source in the past. I can have a look at the MT7628 driver within the next few days.

However, there is a lot of improvement on the MT76 driver in the last few months and I actually moved back to those drivers on my own routers. I am using them on both a MT7621 based ZBT and Mercury MAC1200r v2 (MT7628).

How bad performance are you experiencing?

mt76 has seen a lot of development after LEDE 17.01 so please switch to snapshots

1 Like

According to my observation, this is the result of mt76 driver performance:

  1. In STA mode, the bitrate shown by iwconfig can only reach 6.5mb/s. I tried downloading a 200M file from a HTTP server. MT76 wifi's average speed is around 30-50KB/s and it can never finish this whole task in my testing due to the below unstable issue. while my macbook's 2.4G can reach 2.89MB/s.
    27 PM
    02 PM

  2. the link is not stable after receiving few megabytes, it loses association with AP and most of times It's unable to recover forever unless I restart the whole system.
    23 PM

currently the version of LEDE snapshot I'm using is 17.01-SNAPSHOT-r3608-b41a2e646e. should I checkout tag: 17.01.4 or rc2 and will it be better?

You are using really old version.
Just use current snapshot,17.01 branch has not seen mt76 update for over a year

thanks. I will check out the latest version to take a look.

Also, since you are using a device with MT7628 don't expect miracles as MT7628 is supported pretty badly.
MT7620/1 and MT7612 are supported really good

Yes, I've already prepared for the worst case. As long as it works - up and stable, that's enough.

running iperf3 on the router (Mercury MAC1200R v2) using the latest MT76 open source driver and an iperf3 client on my iPhone gives this:

Accepted connection from 10.0.0.179, port 62680
[  5] local 10.0.0.5 port 5201 connected to 10.0.0.179 port 62681
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  6.96 MBytes  58.4 Mbits/sec                  
[  5]   1.00-2.00   sec  10.3 MBytes  86.1 Mbits/sec                  
[  5]   2.00-3.00   sec  9.27 MBytes  77.8 Mbits/sec                  
[  5]   3.00-4.00   sec  5.80 MBytes  48.6 Mbits/sec                  
[  5]   4.00-5.00   sec  8.60 MBytes  72.2 Mbits/sec                  
[  5]   5.00-6.00   sec  4.70 MBytes  39.4 Mbits/sec                  
[  5]   6.00-7.00   sec  4.09 MBytes  34.4 Mbits/sec                  
[  5]   7.00-8.00   sec  11.0 MBytes  91.8 Mbits/sec                  
[  5]   8.00-9.00   sec  8.84 MBytes  74.2 Mbits/sec                  
[  5]   9.00-10.00  sec  4.23 MBytes  35.4 Mbits/sec                  
[  5]  10.00-11.00  sec  10.1 MBytes  84.7 Mbits/sec                  
[  5]  11.00-12.01  sec  11.3 MBytes  93.9 Mbits/sec                  
[  5]  12.01-12.32  sec  3.66 MBytes   100 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-12.32  sec  98.8 MBytes  67.3 Mbits/sec    

I don't think thats bad at all, but of course the driver could still be improved. I will try to do a comparison with the MTK MT7628AP driver when I have some time to build that.

Your result looks pretty good and far beyond my expectation. But my testing result is real and really bad. I don’t know why yet. Maybe it’s due to the mt76 version is too old.

Because the onboard SPI controller will be used to communicate with other device than the internal flash, the whole linux can only run on RAM disk. I cannot use the prebuilt lede snapshot.

after I checkout the latest source codes from Lede GIT and rebuild. I will get back on this later. Thanks for your iperf3 data.

Hi,

I have a u7621-06 router with one 7612 for wifi AC. Here is a iperf3 between my macbook (client) and the router (server):

aBookAir:~ alex$ iperf3 -c 192.168.1.1 -R
Connecting to host 192.168.1.1, port 5201
Reverse mode, remote host 192.168.1.1 is sending
[  4] local 192.168.1.137 port 63315 connected to 192.168.1.1 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec  17.5 MBytes   146 Mbits/sec                  
[  4]   1.00-2.00   sec  17.0 MBytes   143 Mbits/sec                  
[  4]   2.00-3.00   sec  17.9 MBytes   150 Mbits/sec                  
[  4]   3.00-4.00   sec  15.7 MBytes   132 Mbits/sec                  
[  4]   4.00-5.00   sec  15.2 MBytes   127 Mbits/sec                  
[  4]   5.00-6.00   sec  18.5 MBytes   155 Mbits/sec                  
[  4]   6.00-7.00   sec  20.2 MBytes   170 Mbits/sec                  
[  4]   7.00-8.00   sec  19.1 MBytes   160 Mbits/sec                  
[  4]   8.00-9.00   sec  18.7 MBytes   156 Mbits/sec                  
[  4]   9.00-10.00  sec  18.9 MBytes   158 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   179 MBytes   150 Mbits/sec  120             sender
[  4]   0.00-10.00  sec   179 MBytes   150 Mbits/sec                  receiver

iperf Done.

aBookAir:~ alex$ iperf3 -c 192.168.1.1   
Connecting to host 192.168.1.1, port 5201
[  4] local 192.168.1.137 port 63317 connected to 192.168.1.1 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec  6.82 MBytes  57.1 Mbits/sec                  
[  4]   1.00-2.00   sec  8.84 MBytes  74.2 Mbits/sec                  
[  4]   2.00-3.00   sec  9.06 MBytes  76.0 Mbits/sec                  
[  4]   3.00-4.00   sec  9.31 MBytes  78.1 Mbits/sec                  
[  4]   4.00-5.00   sec  9.67 MBytes  81.1 Mbits/sec                  
[  4]   5.00-6.00   sec  9.06 MBytes  76.0 Mbits/sec                  
[  4]   6.00-7.00   sec  9.03 MBytes  75.7 Mbits/sec                  
[  4]   7.00-8.00   sec  8.73 MBytes  73.2 Mbits/sec                  
[  4]   8.00-9.00   sec  9.74 MBytes  81.7 Mbits/sec                  
[  4]   9.00-10.00  sec  8.50 MBytes  71.3 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec  88.7 MBytes  74.4 Mbits/sec                  sender
[  4]   0.00-10.00  sec  88.6 MBytes  74.3 Mbits/sec                  receiver

With this sqm config:

config queue 'eth1'
	option qdisc_advanced '0'
	option linklayer 'none'
	option interface 'eth0.2'
	option debug_logging '0'
	option verbosity '5'
	option qdisc 'cake'
	option script 'piece_of_cake.qos'
	option enabled '1'
	option download '0'
	option upload '0'

I have this result (1gbps/500mbps link):

The upload speed is not stable (sometimes it's worse) but overall quite good.