[ipq8064] WAN breaks after testing the upload speed

Download speed test:

root@R3D:~# iperf3 -c spd-rudp.hostkey.ru -p 5202 -t 5 -R
Connecting to host spd-rudp.hostkey.ru, port 5202
Reverse mode, remote host spd-rudp.hostkey.ru is sending
[  5] local 192.168.0.199 port 38144 connected to 31.192.104.200 port 5202
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  42.5 MBytes   356 Mbits/sec
[  5]   1.00-2.00   sec  42.3 MBytes   355 Mbits/sec
[  5]   2.00-3.00   sec  29.1 MBytes   244 Mbits/sec
[  5]   3.00-4.00   sec  35.3 MBytes   296 Mbits/sec
[  5]   4.00-5.00   sec  28.9 MBytes   243 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec   182 MBytes   305 Mbits/sec  275             sender
[  5]   0.00-5.00   sec   178 MBytes   299 Mbits/sec                  receiver

Upload spped test:

root@R3D:~# iperf3 -c spd-rudp.hostkey.ru -p 5202 -t 5
Connecting to host spd-rudp.hostkey.ru, port 5202
[  5] local 192.168.0.199 port 38140 connected to 31.192.104.200 port 5202
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  19.2 MBytes   161 Mbits/sec   51   67.9 KBytes
[  5]   1.00-2.00   sec  6.52 MBytes  54.6 Mbits/sec   48   1.41 KBytes
[  5]   2.00-3.02   sec  0.00 Bytes  0.00 bits/sec    1   1.41 KBytes
[  5]   3.02-4.00   sec  0.00 Bytes  0.00 bits/sec    1   1.41 KBytes
^C

After testing the upload speed, traffic through the WAN interface does not move in any direction. All logs are completely silent.

Device tree: https://github.com/openwrt-xiaomi/openwrt/commit/912fe9a77a7ea920b3fded09bd667c6337aea0f4
Kernel log: https://pastebin.com/gAervSy8
System log: [no defects]

Command for restore WAN connect:
ip l set down dev eth0 ; sleep 1 ; ip l set up dev eth0

Network config:

root@R3D:~# cat /etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdb4:63f3:f046::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth1.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option device 'eth0.2'
        option proto 'dhcp'

config interface 'wan6'
        option device 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 2 3 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '5 0t'

ifconfig:

root@R3D:~# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 40:31:3C:XX:XX:XX
          inet6 addr: fe80::4231:3cff:XXXX:XXXX/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15160 errors:0 dropped:0 overruns:0 frame:0
          TX packets:47137 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2468315 (2.3 MiB)  TX bytes:70703543 (67.4 MiB)
          Interrupt:31
root@R3D:~# ethtool eth0
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   1000baseKX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseKX/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: ug
        Wake-on: d
        Current message level: 0x0000003f (63)
                               drv probe link timer ifdown ifup
        Link detected: yes

If the primary router (Xiaomi R3P OpenWrt 21.02) is forced to specify a speed of 10Mbps for the LAN1 port, then the speed test is successful.

root@R3P:~# ethtool -s lan1 speed 10 duplex half autoneg on

Upload speed test:

root@R3D:~# iperf3 -c spd-rudp.hostkey.ru -p 5202 -t 5
Connecting to host spd-rudp.hostkey.ru, port 5202
[  5] local 192.168.0.199 port 38156 connected to 31.192.104.200 port 5202
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  1018 KBytes  8.34 Mbits/sec   30   11.3 KBytes
[  5]   1.00-2.00   sec   986 KBytes  8.07 Mbits/sec   30   5.66 KBytes
[  5]   2.00-3.00   sec   902 KBytes  7.39 Mbits/sec   24   5.66 KBytes
[  5]   3.00-4.00   sec  1001 KBytes  8.20 Mbits/sec   29   5.66 KBytes
[  5]   4.00-5.00   sec   954 KBytes  7.82 Mbits/sec   25   7.07 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec  4.75 MBytes  7.96 Mbits/sec  138             sender
[  5]   0.00-5.00   sec  4.67 MBytes  7.84 Mbits/sec                  receiver

UPD: Long upload tests fail (more than 25 sec)

that's not an official openwrt release, you should probably ask the maintainer

It seems that I managed to fix this problem.
I replaced the bitmask here:

&mdio0 {
	phy0: ethernet-phy@0 {
		qca,ar8327-initvals = <
		     //0xe4 0x000aa545   // MAC_POWER_SEL   S17_RGMII0_1_8V = 0x80000   
		       0xe4 0x0006a545   // MAC_POWER_SEL   S17_RGMII1_1_8V = 0x40000
		>;
	};

Result:

root@R3D:~# iperf3 -c iperf.par2.as49434.net -p 9202
Connecting to host iperf.par2.as49434.net, port 9202
[  5] local 192.168.0.199 port 56810 connected to 193.177.162.41 port 9202
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  33.8 MBytes   283 Mbits/sec    1   3.80 MBytes
[  5]   1.00-2.00   sec  47.5 MBytes   398 Mbits/sec  771   1.01 MBytes
[  5]   2.00-3.00   sec  28.5 MBytes   239 Mbits/sec  1115    980 KBytes
[  5]   3.00-4.00   sec  20.8 MBytes   174 Mbits/sec    0   1.03 MBytes
[  5]   4.00-5.00   sec  22.4 MBytes   188 Mbits/sec    0   1.08 MBytes
[  5]   5.00-6.00   sec  22.1 MBytes   186 Mbits/sec    0   1.11 MBytes
[  5]   6.00-7.00   sec  23.5 MBytes   197 Mbits/sec    1    814 KBytes
[  5]   7.00-8.00   sec  18.0 MBytes   151 Mbits/sec    0    881 KBytes
[  5]   8.00-9.00   sec  18.0 MBytes   151 Mbits/sec    0    928 KBytes
[  5]   9.00-10.00  sec  19.5 MBytes   164 Mbits/sec    0    959 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   254 MBytes   213 Mbits/sec  1888             sender
[  5]   0.00-10.05  sec   252 MBytes   210 Mbits/sec                  receiver

root@R3D:~# iperf3 -c 192.168.0.8
Connecting to host 192.168.0.8, port 5201
[  5] local 192.168.0.199 port 49354 connected to 192.168.0.8 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  89.8 MBytes   753 Mbits/sec    0    535 KBytes
[  5]   1.00-2.00   sec  90.3 MBytes   757 Mbits/sec    0    535 KBytes
[  5]   2.00-3.00   sec  90.8 MBytes   762 Mbits/sec    0    535 KBytes
[  5]   3.00-4.01   sec  87.1 MBytes   721 Mbits/sec    0    535 KBytes

But the configuration of the WAN interface still worries me:

root@R3D:~# ethtool eth0
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   1000baseKX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseKX/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: ug
        Wake-on: d
        Current message level: 0x0000003f (63)
                               drv probe link timer ifdown ifup
        Link detected: yes
1 Like