[mt7530] 1000/100 mix - strange behavior

If both 1000 and 100 devices attached to the switch port, RX for the 1000 port is 100 if ports are bridged ~_~ However TX is still 1000. Very strange. Interesting, it’s something hardware or not. Maybe owners of other boards with mt7530 can check? Maybe depends on the kernel?

The way to reproduce.

  1. Attach 1000 and 100 devices to internal switch lan ports
  2. Ensure ports are bridged
  3. Launch iperf3 -s
  4. Try iperf3 -c xxx --bidir to device using the cable with 1000
  5. Remove 100 device from the switch (or remove port from the bridge)
  6. Retry
1 Like

There was a report with 100mbit devices on mt7530 afair in openwrt github, but seems no one had a solution yet.

Which kernel do you use and do you see 100m on 1g Client only in iperf or also in link Advertisement/ ethtool on either side? Does the 1g came back when 100m Client is disconnected? Does this also happen when 100m client is indirectly connected (through external switch)?

Well, the person at github said, that he don’t observe the issue. I’m using 6.6 kernel from openwrt (the one from 24.10 branch) + MTK patches from their feed. However, looks like I hadn’t applied some of them.

Regarding symptoms. I have dumb gigabit switch connected to 1st LAN switchport at R4 and 2 100Mbit devices, connected to other LAN ports - AC/Ethernet adapter (2nd lan port) and IP camera (3rd lan port). In my initial setup, only 1st and 2nd LAN ports were in bridge, 3rd port was used as separate interface. Once AC/Ethernet adapter plugged to 2nd LAN port, iperf (at R4 side) shows ~1Gb for Tx and 100Mb for rx. Once AC/Ethernet removed from 2nd lan port iperf (at R4 side) shows 1Gb for Tx and 1Gb for rx.

So, it looks like RX synced for some strange reason.

Once I moved 2nd port from the bridge and made 2nd lan port as separate interface, there is no issues with rx and 1st lan port anymore. So it’s something about DSA/switch logic.

I don’t need switch, just a lot of ports, so for me it’s okay. However, maybe, somebody will have an issue with that…

Also it’s quite possible that this depends on kernel version or hardware

I meant that issue is still there if no 100mbit device is directly connected to r4 only “through” dumb switch.

So basicly if one port on r4 switch is recognize a 100mbit link (ethtool) the full switch may operate in 100mbit mode (rx),would be interesting if it happens too when no software bridge is added.

No “software” bridge == no issue. However, as it’s DSA, no way to check with really software bridge

With software bridge i mean the lanbr created by openwrt which bridges the dsa ports…if you remove this and use the ports alone (different subnets on the dsa ports) the issue is not there,right?

That sounds for me more like an issue with software bridge limiting the underlying hardware/dsa ports

@ericwoud have you noticed something like this on your bridge vlan tests?

if you remove this and use the ports alone (different subnets on the dsa ports) the issue is not there,right?

yep

I did the tests on R3 on 6.12. Nothing noticed there, even with one 100mb/s rj45.

Edit:

Wasn’t this an issue about a year ago, sounds similar. That was solved right?

One could check the settings on lan0…4 ports as well as eth0, which could also be affected. Look at pause settings and check other settings too. What changes at the affected port, when a 100mbit linkpartner is attached on another port…

Tested both eth0 and lan* ports - same behavior, nothing changed

Afaik these are 2 different issues…imho you have the first one (first link from eric) where i see no solution. Second is a hw offloading issue and disabling it would fix it.

try

echo 2 > /sys/kernel/debug/mtk_ppe/qos_toggle

Well, this one I don’t have

> cat /sys/kernel/debug/mtk_ppe/qos_toggle
cat: can't open '/sys/kernel/debug/mtk_ppe/qos_toggle': No such file or directory

you didn’t imort patches from autobuild/unified/filogic/mac80211/24.10/files/target/linux/mediatek/patches-6.6 - openwrt/feeds/mtk-openwrt-feeds - Gitiles

Yes, I thought it’s wifi related, which I don’t have and don’t plan to have

So some output may help. Let’s say lan0 is the affected port that slows down, lan1 is the port with the 100mb device. lan0 and lan1 are bridged. So what is the output of:

ethtool eth0
ethtool lan0

In both cases,

  1. without 100mb device attached to lan1,
  2. with 100mb device attached to lan1.

Anything changes in the output?

cat /tmp/with.txt
# brctl addif br-lan lan2
# brctl show br-lan
bridge name     bridge id               STP enabled     interfaces
br-lan          7fff.eeb4e28d068c       no              eth1
                                                        lan1
                                                        lan2

Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   10000baseCR/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseCR/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10000baseCR/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: No
        Link partner advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: yes

Settings for lan1:
        Supported ports: [ TP    MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Auto-negotiation: on
        master-slave cfg: preferred slave
        master-slave status: slave
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: external
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes

Settings for lan2:
        Supported ports: [ TP    MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 100Mb/s
        Duplex: Full
        Auto-negotiation: on
        master-slave cfg: preferred slave
        master-slave status: master
        Port: Twisted Pair
        PHYAD: 2
        Transceiver: external
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes
cat /tmp/without.txt

# brctl show br-lan
bridge name     bridge id               STP enabled     interfaces
br-lan          7fff.eeb4e28d068c       no              eth1
                                                        lan1
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   10000baseCR/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseCR/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10000baseCR/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: No
        Link partner advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: yes

Settings for lan1:
        Supported ports: [ TP    MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Auto-negotiation: on
        master-slave cfg: preferred slave
        master-slave status: slave
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: external
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes

Settings for lan2:
        Supported ports: [ TP    MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 100Mb/s
        Duplex: Full
        Auto-negotiation: on
        master-slave cfg: preferred slave
        master-slave status: master
        Port: Twisted Pair
        PHYAD: 2
        Transceiver: external
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes
diff /tmp/with.txt /tmp/without.txt
1d0
< # brctl addif br-lan lan2
6,7d4
<                                                         lan2
< 
95a93
> 
cat /tmp/iperf3-with.txt
> iperf3 -c 192.168.1.1 --bidir                                                                                 
Connecting to host 192.168.1.1, port 5201                                                                              
[  5] local 192.168.1.159 port 60824 connected to 192.168.1.1 port 5201      
[  7] local 192.168.1.159 port 60840 connected to 192.168.1.1 port 5201             
[ ID][Role] Interval           Transfer     Bitrate         Retr  Cwnd       
[  5][TX-C]   0.00-1.00   sec  13.2 MBytes   111 Mbits/sec    0    494 KBytes       
[  7][RX-C]   0.00-1.00   sec  13.0 MBytes   109 Mbits/sec                   
[  5][TX-C]   1.00-2.00   sec  11.8 MBytes  98.6 Mbits/sec    0    518 KBytes       
[  7][RX-C]   1.00-2.00   sec  55.5 MBytes   466 Mbits/sec                   
[  5][TX-C]   2.00-3.00   sec  10.6 MBytes  89.1 Mbits/sec    0    518 KBytes       
[  7][RX-C]   2.00-3.00   sec  97.1 MBytes   815 Mbits/sec                   
[  5][TX-C]   3.00-4.00   sec  11.5 MBytes  96.5 Mbits/sec    0    571 KBytes       
[  7][RX-C]   3.00-4.00   sec  97.6 MBytes   819 Mbits/sec                  
[  5][TX-C]   4.00-5.00   sec  11.0 MBytes  92.3 Mbits/sec    0    600 KBytes       
[  7][RX-C]   4.00-5.00   sec   103 MBytes   867 Mbits/sec                          
[  5][TX-C]   5.00-6.00   sec  10.9 MBytes  91.2 Mbits/sec    0    626 KBytes       
[  7][RX-C]   5.00-6.00   sec   100 MBytes   841 Mbits/sec                          
[  5][TX-C]   6.00-7.00   sec  10.9 MBytes  91.2 Mbits/sec    0    720 KBytes       
[  7][RX-C]   6.00-7.00   sec  92.4 MBytes   775 Mbits/sec                   
[  5][TX-C]   7.00-8.00   sec  11.1 MBytes  93.3 Mbits/sec    0    720 KBytes       
[  7][RX-C]   7.00-8.00   sec   100 MBytes   843 Mbits/sec                   
[  5][TX-C]   8.00-9.00   sec  11.1 MBytes  93.3 Mbits/sec    0    720 KBytes       
[  7][RX-C]   8.00-9.00   sec   104 MBytes   874 Mbits/sec                   
[  5][TX-C]   9.00-10.00  sec  11.0 MBytes  92.2 Mbits/sec    0    720 KBytes       
[  7][RX-C]   9.00-10.00  sec  92.5 MBytes   775 Mbits/sec                   
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID][Role] Interval           Transfer     Bitrate         Retr
[  5][TX-C]   0.00-10.00  sec   113 MBytes  94.9 Mbits/sec    0             sender
[  5][TX-C]   0.00-10.02  sec   110 MBytes  91.9 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec   859 MBytes   721 Mbits/sec    0             sender
[  7][RX-C]   0.00-10.02  sec   856 MBytes   717 Mbits/sec                  receiver

iperf Done.                                                
cat /tmp/iperf3-without.txt
> iperf3 -c 192.168.1.1 --bidir                                                                                 
Connecting to host 192.168.1.1, port 5201                                                                              
[  5] local 192.168.1.159 port 43510 connected to 192.168.1.1 port 5201      
[  7] local 192.168.1.159 port 43518 connected to 192.168.1.1 port 5201             
[ ID][Role] Interval           Transfer     Bitrate         Retr  Cwnd       
[  5][TX-C]   0.00-1.00   sec   113 MBytes   949 Mbits/sec    0    773 KBytes       
[  7][RX-C]   0.00-1.00   sec   111 MBytes   929 Mbits/sec                   
[  5][TX-C]   1.00-2.00   sec   112 MBytes   935 Mbits/sec    0    773 KBytes       
[  7][RX-C]   1.00-2.00   sec   112 MBytes   937 Mbits/sec                   
[  5][TX-C]   2.00-3.00   sec   110 MBytes   924 Mbits/sec    0    773 KBytes       
[  7][RX-C]   2.00-3.00   sec   112 MBytes   938 Mbits/sec                   
[  5][TX-C]   3.00-4.00   sec   111 MBytes   934 Mbits/sec    0    773 KBytes       
[  7][RX-C]   3.00-4.00   sec   112 MBytes   937 Mbits/sec                  
[  5][TX-C]   4.00-5.00   sec   111 MBytes   933 Mbits/sec    0    851 KBytes       
[  7][RX-C]   4.00-5.00   sec   112 MBytes   939 Mbits/sec                          
[  5][TX-C]   5.00-6.00   sec   111 MBytes   930 Mbits/sec    0    851 KBytes       
[  7][RX-C]   5.00-6.00   sec   112 MBytes   937 Mbits/sec                          
[  5][TX-C]   6.00-7.00   sec   110 MBytes   927 Mbits/sec    0    851 KBytes       
[  7][RX-C]   6.00-7.00   sec   112 MBytes   939 Mbits/sec                   
[  5][TX-C]   7.00-8.00   sec   112 MBytes   937 Mbits/sec    0    851 KBytes       
[  7][RX-C]   7.00-8.00   sec   112 MBytes   938 Mbits/sec                   
[  5][TX-C]   8.00-9.00   sec   111 MBytes   932 Mbits/sec    0    897 KBytes       
[  7][RX-C]   8.00-9.00   sec   112 MBytes   938 Mbits/sec                  
[  5][TX-C]   9.00-10.00  sec   110 MBytes   921 Mbits/sec    0    897 KBytes       
[  7][RX-C]   9.00-10.00  sec   112 MBytes   938 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -                                                                      
[ ID][Role] Interval           Transfer     Bitrate         Retr             
[  5][TX-C]   0.00-10.00  sec  1.09 GBytes   933 Mbits/sec    0             sender  
[  5][TX-C]   0.00-10.00  sec  1.08 GBytes   931 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec  1.09 GBytes   940 Mbits/sec    0             sender  
[  7][RX-C]   0.00-10.00  sec  1.09 GBytes   937 Mbits/sec                  receiver
                                                                                                                       
iperf Done.                                                                                           

you are missing HQoS and some fixes

Recompiled kernel with almost all patches from MTK feed (excluding wifi hw related) - behavior has not changed.

Tried qos_toggle – same.

Did you try?

echo 1 > /sys/kernel/debug/mtk_ppe/qos_toggle

I tried 0 1 2. But the issue initially doesn’t looks like QoS issue, or anything like that …