Weird Performance MT7613BE (Cudy WR1300 v3)

Hi.

I've built an openwrt image from the latest snapshot for my cudy router, so far everything is working but i'm having the weirdest performance issues on the 5ghz wifi

Laptop: Macbook Pro 2017
Phone: Iphone 13

I connect my phone to the router

433.3 Mbit/s, 80 MHz, VHT-MCS 9, VHT-NSS 1, Short GI
433.3 Mbit/s, 80 MHz, VHT-MCS 9, VHT-NSS 1, Short GI

and do an iperf from the phone to a server and i get ~290mbps - fair enough, the phone - I assume has support for only 1 spacial stream

now i connect my laptop

780.0 Mbit/s, 80 MHz, VHT-MCS 9, VHT-NSS 2
866.7 Mbit/s, 80 MHz, VHT-MCS 9, VHT-NSS 2, Short GI

and run the same test

➜  ~ iperf3 -c 172.16.3.91      
Connecting to host 172.16.3.91, port 5201
[  5] local 192.168.1.203 port 61593 connected to 172.16.3.91 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  19.4 MBytes   162 Mbits/sec                  
[  5]   1.00-2.00   sec  16.6 MBytes   140 Mbits/sec                  
[  5]   2.00-3.00   sec  16.9 MBytes   142 Mbits/sec                  
[  5]   3.00-4.00   sec  16.5 MBytes   138 Mbits/sec                  
[  5]   4.00-5.00   sec  15.5 MBytes   130 Mbits/sec                  
[  5]   5.00-6.00   sec  17.1 MBytes   143 Mbits/sec                  
[  5]   6.00-7.00   sec  17.1 MBytes   144 Mbits/sec                  
[  5]   7.00-8.00   sec  17.0 MBytes   143 Mbits/sec                  
[  5]   8.00-9.00   sec  16.9 MBytes   141 Mbits/sec                  
[  5]   9.00-10.00  sec  16.6 MBytes   140 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   170 MBytes   142 Mbits/sec                  sender
[  5]   0.00-10.05  sec   168 MBytes   140 Mbits/sec                  receiver

iperf Done.

Why would performance be worse on my laptop?

Heres an iw list if thats helpful at all

Wiphy phy1
	wiphy index: 1
	max # scan SSIDs: 4
	max scan IEs length: 2304 bytes
	max # sched scan SSIDs: 0
	max # match sets: 0
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Device supports AP-side u-APSD.
	Device supports T-DLS.
	Available Antennas: TX 0x3 RX 0x3
	Configured Antennas: TX 0x3 RX 0x3
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * monitor
		 * mesh point
		 * P2P-client
		 * P2P-GO
	Band 2:
		Capabilities: 0x1ff
			RX LDPC
			HT20/HT40
			SM Power Save disabled
			RX Greenfield
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			RX STBC 1-stream
			Max AMSDU length: 3839 bytes
			No DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: No restriction (0x00)
		HT TX/RX MCS rate indexes supported: 0-15
		VHT Capabilities (0x338001f8):
			Max MPDU length: 3895
			Supported Channel Width: 160 MHz, 80+80 MHz
			RX LDPC
			short GI (80 MHz)
			short GI (160/80+80 MHz)
			TX STBC
			RX antenna pattern consistency
			TX antenna pattern consistency
		VHT RX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT RX highest supported: 0 Mbps
		VHT TX MCS set:
			1 streams: MCS 0-9
			2 streams: MCS 0-9
			3 streams: not supported
			4 streams: not supported
			5 streams: not supported
			6 streams: not supported
			7 streams: not supported
			8 streams: not supported
		VHT TX highest supported: 0 Mbps
		VHT extended NSS: not supported
		Frequencies:
			* 5180 MHz [36] (23.0 dBm)
			* 5200 MHz [40] (23.0 dBm)
			* 5220 MHz [44] (23.0 dBm)
			* 5240 MHz [48] (23.0 dBm)
			* 5260 MHz [52] (23.0 dBm) (radar detection)
			* 5280 MHz [56] (23.0 dBm) (radar detection)
			* 5300 MHz [60] (23.0 dBm) (radar detection)
			* 5320 MHz [64] (23.0 dBm) (radar detection)
			* 5500 MHz [100] (23.0 dBm) (radar detection)
			* 5520 MHz [104] (23.0 dBm) (radar detection)
			* 5540 MHz [108] (23.0 dBm) (radar detection)
			* 5560 MHz [112] (23.0 dBm) (radar detection)
			* 5580 MHz [116] (23.0 dBm) (radar detection)
			* 5600 MHz [120] (23.0 dBm) (radar detection)
			* 5620 MHz [124] (23.0 dBm) (radar detection)
			* 5640 MHz [128] (23.0 dBm) (radar detection)
			* 5660 MHz [132] (23.0 dBm) (radar detection)
			* 5680 MHz [136] (23.0 dBm) (radar detection)
			* 5700 MHz [140] (23.0 dBm) (radar detection)
			* 5720 MHz [144] (23.0 dBm) (radar detection)
			* 5745 MHz [149] (23.0 dBm)
			* 5765 MHz [153] (23.0 dBm)
			* 5785 MHz [157] (23.0 dBm)
			* 5805 MHz [161] (23.0 dBm)
			* 5825 MHz [165] (23.0 dBm)
			* 5845 MHz [169] (23.0 dBm) (no IR)
			* 5865 MHz [173] (23.0 dBm) (no IR)
			* 5885 MHz [177] (23.0 dBm) (no IR)
	valid interface combinations:
		 * #{ IBSS } <= 1, #{ managed, AP, mesh point, P2P-client, P2P-GO } <= 16,
		   total <= 16, #channels <= 1, STA/AP BI must match
	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing
	max # scan plans: 1
	max scan plan interval: 0
	max scan plan iterations: 0
	Supported extended features:
		* [ VHT_IBSS ]: VHT-IBSS
		* [ RRM ]: RRM
		* [ MU_MIMO_AIR_SNIFFER ]: MU-MIMO sniffer
		* [ SET_SCAN_DWELL ]: scan dwell setting
		* [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
		* [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
		* [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
		* [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
		* [ CAN_REPLACE_PTK0 ]: can safely replace PTK 0 when rekeying
		* [ AIRTIME_FAIRNESS ]: airtime fairness scheduling
		* [ AQL ]: Airtime Queue Limits (AQL)
		* [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
		* [ DEL_IBSS_STA ]: deletion of IBSS station support
		* [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
		* [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
Wiphy phy0
	wiphy index: 0
	max # scan SSIDs: 4
	max scan IEs length: 2257 bytes
	max # sched scan SSIDs: 0
	max # match sets: 0
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Device supports AP-side u-APSD.
	Device supports T-DLS.
	Available Antennas: TX 0x3 RX 0x3
	Configured Antennas: TX 0x3 RX 0x3
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * monitor
		 * mesh point
		 * P2P-client
		 * P2P-GO
	Band 1:
		Capabilities: 0x1fe
			HT20/HT40
			SM Power Save disabled
			RX Greenfield
			RX HT20 SGI
			RX HT40 SGI
			TX STBC
			RX STBC 1-stream
			Max AMSDU length: 3839 bytes
			No DSSS/CCK HT40
		Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
		Minimum RX AMPDU time spacing: No restriction (0x00)
		HT TX/RX MCS rate indexes supported: 0-15
		Frequencies:
			* 2412 MHz [1] (23.0 dBm)
			* 2417 MHz [2] (23.0 dBm)
			* 2422 MHz [3] (23.0 dBm)
			* 2427 MHz [4] (23.0 dBm)
			* 2432 MHz [5] (23.0 dBm)
			* 2437 MHz [6] (23.0 dBm)
			* 2442 MHz [7] (23.0 dBm)
			* 2447 MHz [8] (23.0 dBm)
			* 2452 MHz [9] (23.0 dBm)
			* 2457 MHz [10] (23.0 dBm)
			* 2462 MHz [11] (23.0 dBm)
			* 2467 MHz [12] (disabled)
			* 2472 MHz [13] (disabled)
			* 2484 MHz [14] (disabled)
	valid interface combinations:
		 * #{ IBSS } <= 1, #{ managed, AP, mesh point, P2P-client, P2P-GO } <= 4,
		   total <= 4, #channels <= 1, STA/AP BI must match
	HT Capability overrides:
		 * MCS: ff ff ff ff ff ff ff ff ff ff
		 * maximum A-MSDU length
		 * supported channel width
		 * short GI for 40 MHz
		 * max A-MPDU length exponent
		 * min MPDU start spacing
	max # scan plans: 1
	max scan plan interval: -1
	max scan plan iterations: 0
	Supported extended features:
		* [ RRM ]: RRM
		* [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
		* [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
		* [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
		* [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
		* [ SCAN_RANDOM_SN ]: use random sequence numbers in scans
		* [ SCAN_MIN_PREQ_CONTENT ]: use probe request with only rate IEs in scans
		* [ AIRTIME_FAIRNESS ]: airtime fairness scheduling
		* [ AQL ]: Airtime Queue Limits (AQL)
		* [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
		* [ DEL_IBSS_STA ]: deletion of IBSS station support
		* [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
		* [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support

Hoping someone can point me in the right direction for some more troubleshooting, i would expect the same (ideally better performance) on a better end device...

this could perhaps be expected from a 7 y.o laptop ?
while your phone's 4 years newer.

post your /etc/config/wireless file.

connecting to a unifi-ac ap i get substantially better results

➜  ~ iperf3 -c 172.16.3.91 
Connecting to host 172.16.3.91, port 5201
[  5] local 172.16.3.58 port 61636 connected to 172.16.3.91 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  61.6 MBytes   517 Mbits/sec                  
[  5]   1.00-2.00   sec  60.9 MBytes   511 Mbits/sec                  
[  5]   2.00-3.00   sec  59.0 MBytes   494 Mbits/sec                  
[  5]   3.00-4.00   sec  61.6 MBytes   517 Mbits/sec                  
[  5]   4.00-5.00   sec  60.6 MBytes   509 Mbits/sec                  
[  5]   5.00-6.00   sec  63.6 MBytes   532 Mbits/sec                  
[  5]   6.00-7.00   sec  61.6 MBytes   519 Mbits/sec                  
[  5]   7.00-8.00   sec  63.6 MBytes   533 Mbits/sec                  
[  5]   8.00-9.00   sec  60.5 MBytes   508 Mbits/sec                  
[  5]   9.00-10.00  sec  55.1 MBytes   462 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   608 MBytes   510 Mbits/sec                  sender
[  5]   0.00-10.03  sec   607 MBytes   507 Mbits/sec                  receiver

iperf Done.

heres the /etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option path '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
	option channel '1'
	option band '2g'
	option htmode 'HT20'
	option disabled '1'
	option country 'US'
	option cell_density '0'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'sae-mixed'
	option disabled '1'
	option key 'password'

config wifi-device 'radio1'
	option type 'mac80211'
	option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0'
	option channel '36'
	option band '5g'
	option htmode 'VHT80'
	option cell_density '0'
	option country 'US'
	option txpower '23'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'sae-mixed'
	option key 'password'

Mt7613 driver are really really bad, and that's the reason of the problem.

Ok - well thanks for the reply.

Is this across the board on Mediatek interfaces or something specific to the MT7613?

All sorted this side.

It seems that enabling Software flow offloading brings me to the performance level I was hoping for

Without Software Flow Offloading

➜  ~ iperf3 -c 172.16.3.91    
Connecting to host 172.16.3.91, port 5201
[  5] local 192.168.1.203 port 64810 connected to 172.16.3.91 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  9.62 MBytes  80.4 Mbits/sec                  
[  5]   1.00-2.00   sec  23.9 MBytes   200 Mbits/sec                  
[  5]   2.00-3.00   sec  25.0 MBytes   210 Mbits/sec                  
[  5]   3.00-4.00   sec  24.9 MBytes   209 Mbits/sec                  
[  5]   4.00-5.00   sec  25.0 MBytes   210 Mbits/sec                  
[  5]   5.00-6.00   sec  24.9 MBytes   209 Mbits/sec                  
[  5]   6.00-7.00   sec  24.5 MBytes   206 Mbits/sec                  
[  5]   7.00-8.00   sec  18.4 MBytes   154 Mbits/sec                  
[  5]   8.00-9.00   sec  21.8 MBytes   182 Mbits/sec                  
[  5]   9.00-10.00  sec  24.5 MBytes   205 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   222 MBytes   186 Mbits/sec                  sender
[  5]   0.00-10.01  sec   221 MBytes   185 Mbits/sec                  receiver

iperf Done.


➜  ~ iperf3  -R -c 172.16.3.91 
Connecting to host 172.16.3.91, port 5201
Reverse mode, remote host 172.16.3.91 is sending
[  5] local 192.168.1.203 port 64816 connected to 172.16.3.91 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  34.6 MBytes   289 Mbits/sec                  
[  5]   1.00-2.00   sec  30.2 MBytes   254 Mbits/sec                  
[  5]   2.00-3.00   sec  28.6 MBytes   240 Mbits/sec                  
[  5]   3.00-4.00   sec  28.5 MBytes   240 Mbits/sec                  
[  5]   4.00-5.00   sec  27.9 MBytes   234 Mbits/sec                  
[  5]   5.00-6.00   sec  28.2 MBytes   237 Mbits/sec                  
[  5]   6.00-7.00   sec  28.4 MBytes   238 Mbits/sec                  
[  5]   7.00-8.00   sec  28.5 MBytes   239 Mbits/sec                  
[  5]   8.00-9.00   sec  31.0 MBytes   260 Mbits/sec                  
[  5]   9.00-10.00  sec  29.4 MBytes   246 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec   299 MBytes   250 Mbits/sec  1386             sender
[  5]   0.00-10.00  sec   295 MBytes   248 Mbits/sec                  receiver

iperf Done.

With Software Flow Offloading

➜  ~ iperf3 -R -c 172.16.3.91 
Connecting to host 172.16.3.91, port 5201
Reverse mode, remote host 172.16.3.91 is sending
[  5] local 192.168.1.203 port 64802 connected to 172.16.3.91 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  41.6 MBytes   349 Mbits/sec                  
[  5]   1.00-2.00   sec  47.0 MBytes   394 Mbits/sec                  
[  5]   2.00-3.00   sec  47.8 MBytes   400 Mbits/sec                  
[  5]   3.00-4.00   sec  46.8 MBytes   393 Mbits/sec                  
[  5]   4.00-5.00   sec  48.4 MBytes   406 Mbits/sec                  
[  5]   5.00-6.00   sec  50.1 MBytes   420 Mbits/sec                  
[  5]   6.00-7.00   sec  49.2 MBytes   413 Mbits/sec                  
[  5]   7.00-8.00   sec  48.6 MBytes   407 Mbits/sec                  
[  5]   8.00-9.00   sec  46.8 MBytes   393 Mbits/sec                  
[  5]   9.00-10.00  sec  48.8 MBytes   409 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec   478 MBytes   401 Mbits/sec   12             sender
[  5]   0.00-10.00  sec   475 MBytes   398 Mbits/sec                  receiver

iperf Done.

➜  ~ iperf3 -c 172.16.3.91  
Connecting to host 172.16.3.91, port 5201
[  5] local 192.168.1.203 port 64799 connected to 172.16.3.91 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  76.5 MBytes   641 Mbits/sec                  
[  5]   1.00-2.00   sec  67.8 MBytes   568 Mbits/sec                  
[  5]   2.00-3.00   sec  63.8 MBytes   534 Mbits/sec                  
[  5]   3.00-4.00   sec  77.6 MBytes   653 Mbits/sec                  
[  5]   4.00-5.00   sec  79.8 MBytes   669 Mbits/sec                  
[  5]   5.00-6.00   sec  79.9 MBytes   670 Mbits/sec                  
[  5]   6.00-7.00   sec  79.9 MBytes   669 Mbits/sec                  
[  5]   7.00-8.00   sec  67.8 MBytes   568 Mbits/sec                  
[  5]   8.00-9.00   sec  58.6 MBytes   493 Mbits/sec                  
[  5]   9.00-10.00  sec  58.4 MBytes   489 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   710 MBytes   595 Mbits/sec                  sender
[  5]   0.00-10.05  sec   709 MBytes   592 Mbits/sec                  receiver

iperf Done.