Configure MT7530 DSA

As an experiment I am trying to use the official in-tree MT7530 DSA module. For some reason I am not able to get it properly configured.

root@OpenWrt:/# dmesg | grep "mt7530"
[    0.750000] mt7530 mdio-bus:00: MT7530 adapts as multi-chip module
[    0.870000] mt7530 mdio-bus:00: MT7530 adapts as multi-chip module
[    0.890000] mt7530 mdio-bus:00 lan0 (uninitialized): PHY [dsa-0.0:00] driver [Generic PHY]
[    0.900000] mt7530 mdio-bus:00 lan1 (uninitialized): PHY [dsa-0.0:01] driver [Generic PHY]
[    0.910000] mt7530 mdio-bus:00 lan2 (uninitialized): PHY [dsa-0.0:02] driver [Generic PHY]
[    0.920000] mt7530 mdio-bus:00 lan3 (uninitialized): PHY [dsa-0.0:03] driver [Generic PHY]
[    0.930000] mt7530 mdio-bus:00 lan4 (uninitialized): PHY [dsa-0.0:04] driver [Generic PHY]
[    0.940000] mt7530 mdio-bus:00: configuring for fixed/trgmii link mode
[    0.950000] mt7530 mdio-bus:00: Link is Up - 1Gbps/Full - flow control off
[   16.810000] mt7530 mdio-bus:00 lan0: configuring for phy/gmii link mode
[   16.870000] mt7530 mdio-bus:00 lan1: configuring for phy/gmii link mode
[   16.910000] mt7530 mdio-bus:00 lan2: configuring for phy/gmii link mode
[   16.950000] mt7530 mdio-bus:00 lan3: configuring for phy/gmii link mode
[   16.990000] mt7530 mdio-bus:00 lan4: configuring for phy/gmii link mode
[   20.090000] mt7530 mdio-bus:00 lan3: Link is Up - 1Gbps/Full - flow control rx/tx
[   20.970000] mt7530 mdio-bus:00 lan0: Link is Up - 1Gbps/Full - flow control rx/tx
root@OpenWrt:/# _   84.560000] br-lan: port 4(lan3) entered disabled state
[   84.560000] mt7530 mdio-bus:00 lan3: Link is Down
[   86.730000] mt7530 mdio-bus:00 lan4: Link is Up - 1Gbps/Full - flow control rx/tx
[   86.730000] IPv6: ADDRCONF(NETDEV_CHANGE): lan4: link becomes ready

My /etc/config/network

root@OpenWrt:/# cat /etc/config/network 
config interface 'lan'
        option type 'bridge'
        option ifname 'lan0 lan1 lan2 lan3'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.2.1'

config interface 'wan'
        option ifname 'lan4'
        option proto dhcp
ifconfig
br-lan    Link encap:Ethernet  HWaddr A2:E6:57:F9:FB:7B  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a0e6:57ff:fef9:fb7b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:335 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:62489 (61.0 KiB)  TX bytes:1602 (1.5 KiB)

eth0      Link encap:Ethernet  HWaddr A2:E6:57:F9:FB:7B  
          inet6 addr: fe80::a0e6:57ff:fef9:fb7b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:338 errors:0 dropped:0 overruns:0 frame:82
          TX packets:362 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:69185 (67.5 KiB)  TX bytes:75181 (73.4 KiB)
          Interrupt:22 

lan0      Link encap:Ethernet  HWaddr A2:E6:57:F9:FB:7B  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:186 errors:0 dropped:0 overruns:0 frame:0
          TX packets:142 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:32736 (31.9 KiB)  TX bytes:30770 (30.0 KiB)

lan1      Link encap:Ethernet  HWaddr A2:E6:57:F9:FB:7B  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan2      Link encap:Ethernet  HWaddr A2:E6:57:F9:FB:7B  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan3      Link encap:Ethernet  HWaddr A2:E6:57:F9:FB:7B  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:150 errors:0 dropped:0 overruns:0 frame:0
          TX packets:196 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:29814 (29.1 KiB)  TX bytes:36637 (35.7 KiB)

lan4      Link encap:Ethernet  HWaddr A2:E6:57:F9:FB:7B  
          inet6 addr: fe80::a0e6:57ff:fef9:fb7b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:551 (551.0 B)  TX bytes:1510 (1.4 KiB)

Everything else is "stock", dnsmasq, firewall.

DHCP is not working, no automatic IP on LAN4 (the WAN port), no IP handed out on the 'LAN' bridge. Even when I configure a client with a static IP, I can't even ping this client or the router the other way around.

removing the /etc/config/network and trying to setup the DSA switch as 'gateway' as described here DSA switch configuration from userspace will allow traffic to go "through" the router like a dumb switch, but still not able to even ping anything.

What am I missing (fail to understand)??

The DSA driver leverages switch tagging protocols of which five are known as being supported, the different protocols are implemented in [1]:

net/dsa/tag_trailer.c: Marvell’s 4 trailer tag mode (legacy)
net/dsa/tag_dsa.c: Marvell’s original DSA tag
net/dsa/tag_edsa.c: Marvell’s enhanced DSA tag
net/dsa/tag_brcm.c: Broadcom’s 4 bytes tag
net/dsa/tag_qca.c: Qualcomm’s 2 bytes tag

Afaik /etc/config/network does not configure any of the DSA driver aspects and 802.1q tag management (via ip | bridge) is handled by the bridge driver instead

Suppose that is meant from the OpenWrt distro or is it rather source development [2]? The latter exhibiting a constant development stream which may not have fully backported into the former and thus may not yet be suitable for deployment.

Else, it is difficult to see why those ports are not reachable at all, unless there is some mishap in the network configuration (routing | firewall).


[1] https://www.kernel.org/doc/html/latest/networking/dsa/dsa.html#switch-tagging-protocols
[2] https://github.com/torvalds/linux/commits/master/drivers/net/dsa/mt7530.c

Thanks for the reply, I just figured it out:

In my MT7621.dtsi I was using "phy-mode = "trgmii";" for the CPU port (port6) and it seems that that doesn't work (yet) or maybe needs some additional configuration on the GMAC side as well.

Changing the phy-mode to "rgmii" magically transferred my setup into fully working :smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.