Reduce number of drivers for RTL8367S

Anything you would like me to test?

I see that one lan is missing. Download a new code from https://github.com/namiltd/openwrt/pull/94

1 Like

All interfaces have the same Mac Addresses, was it so on old drivers?

No.

Before eth0 & eth1 had different MAC addresses

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 14:4D:67:6D:B2:A0  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::164d:67ff:fe6d:b2a0/64 Scope:Link
          inet6 addr: fd48:1933:8fb0::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1757 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1576 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:276351 (269.8 KiB)  TX bytes:996972 (973.6 KiB)

eth0      Link encap:Ethernet  HWaddr 14:4D:67:6D:B2:A0  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1789 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1871 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:311169 (303.8 KiB)  TX bytes:1024262 (1000.2 KiB)
          Interrupt:123 

eth1      Link encap:Ethernet  HWaddr 14:4D:67:6D:B2:A1  
          inet6 addr: fe80::164d:67ff:fe6d:b2a1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:11242 (10.9 KiB)
          Interrupt:123 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:265 errors:0 dropped:0 overruns:0 frame:0
          TX packets:265 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:21172 (20.6 KiB)  TX bytes:21172 (20.6 KiB)

I updated the code to have two mac addresses.

1 Like

Perfect

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 14:4D:67:6D:B2:A0  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::164d:67ff:fe6d:b2a0/64 Scope:Link
          inet6 addr: fd12:e96:aa0a::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1088 errors:0 dropped:0 overruns:0 frame:0
          TX packets:942 errors:0 dropped:3 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:160638 (156.8 KiB)  TX bytes:1043579 (1019.1 KiB)

eth0      Link encap:Ethernet  HWaddr 14:4D:67:6D:B2:A0  
          inet6 addr: fe80::164d:67ff:fe6d:b2a0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1508  Metric:1
          RX packets:1122 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1391 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:194865 (190.2 KiB)  TX bytes:1090473 (1.0 MiB)
          Interrupt:123 

lan1      Link encap:Ethernet  HWaddr 14:4D:67:6D:B2:A0  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:4 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 14:4D:67:6D:B2:A0  
          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 14:4D:67:6D:B2:A0  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1089 errors:0 dropped:23 overruns:0 frame:0
          TX packets:1347 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:182295 (178.0 KiB)  TX bytes:1058006 (1.0 MiB)

lan4      Link encap:Ethernet  HWaddr 14:4D:67:6D:B2:A0  
          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)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:169 errors:0 dropped:0 overruns:0 frame:0
          TX packets:169 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13460 (13.1 KiB)  TX bytes:13460 (13.1 KiB)

wan       Link encap:Ethernet  HWaddr 14:4D:67:6D:B2:A1  
          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)

Anything else need testing?

1 Like

Check the LAN port order to ensure it matches the description on the case.
Run performance tests.
You can also test the dual cpu_port version: https://github.com/namiltd/openwrt/pull/93

Lan ports are in the correct order but there is no traffic between ports. I haven't tested the dual CPU version.

Add line dsa-tag-protocol = "rtl8_4"; to port@6.in file target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts.

1 Like

Added that line to the .dts and rebuilt but have the same exact issue.

				port@6 {
					reg = <6>;
					label = "cpu";
					ethernet = <&gmac0>;
					phy-mode = "2500base-x";
                    dsa-tag-protocol = "rtl8_4";
					fixed-link {
						speed = <2500>;
						full-duplex;
						pause;

No traffic between lan ports. Between lan and wan is fine, also performance seems on par with my main zyxel filogic gateway.

Something I noticed and probably normal was the output in ethtool, the ports are always in preferred master mode on the Totolink when on my other devices they are in preferred slave mode

	master-slave cfg: preferred master
	master-slave status: master

1 Like

I have no idea, I need to analyze the code again.

1 Like

Port isolation problem maybe or default vlan problem.

Both, port isolation and vlan are disabled by default for DSA

1 Like

I've created LED modules for several LAN interfaces (ledtrig-netlan) and several WiFi interfaces (ledtrig-netwlan). Patch available at: https://github.com/openwrt/openwrt/pull/19903. Tests and any comments are welcome.

1 Like

@mietekn Do you have any update on this?

No. For the router I have, everything works as it should, so I don't need to change the code.

1 Like

Wasn’t sure if you had pushed any updates that might fix the issues my device had since I last tested this in August.

Updated, try new fixed version from github tree. Due to incorrect PVID handling, some of the LANs were isolated from the others.

1 Like

For testing purposes, I've adapted the rtl8356mb driver to support the rtl8367s-vb chip (rtl8367d family chip). The code is available at https://github.com/namiltd/rtl8367d/pull/3.
Unfortunately, I don't have a router with this chip, so I can't even verify if the code works.

To test, copy https://github.com/namiltd/rtl8367d/pull/3.patch to target/linux/generic/pending-6.12/999-patch.patch

Sorry folks for being late to the discussion. This went under my radar.

I noticed that my old patch series is being used as a reference for forwarding and VLAN offload. Unfortunately, that code will never be suitable for upstream because it relies on SVL (shared VLAN learning). I’m currently working on an alternative IVL-based implementation with proper FDB handling, which is the only approach that can realistically be merged upstream. It is already functionally complete but it might require changes during the reviews.

In the meantime, you’ll have access to a much better driver. I’ve already shared my development tree with @mietekn, and there may be updates coming soon.

My biggest blocker right now is hardware. I only have an old router with an rtl8367s using a single RGMII CPU port. I’m not comfortable submitting code upstream without extensive real-world testing. Relying purely on volunteers for coverage doesn’t scale. Before submitting anything, I want to be confident that this new approach is solid, and I can’t submit some changes required by some of the devices mentioned here.

Ideally, I need a router with a newer rtl8367s-vb variant, using (H)SGMII and preferably two CPU ports, so I can properly validate all changes. A USB port is required, and a Wi-Fi interface would be very helpful as an alternative access path when the switch is down during testing.

Given that rtl8367s-based routers may already be considered outdated, I wanted to ask: does anyone happen to have a compatible device sitting unused in a drawer and be willing to donate it for driver development?

2 Likes