mt7620 tests with DSA switch, problem with mtk_eth_soc MTU

Luiz Angelo Daros de Luca luizluca at gmail.com
Wed Dec 15 08:26:07 PST 2021


Hello,

I'm testing a device with mt7620 with rtl8367s switch with DSA. I
modified the upstream DSA driver for rtl8365mb (kernel 5.15..5.16) to
support rtl8367s with a mdio interface. Although the upstream driver
does not have any offload feature (switching is done in CPU), it is
working fine. I might soon submit those patches upstream.

However, I have some issues with the mt7620 ethernet.  I disabled vlan
for the mt7620 internal switch (mt7530?) by removing the
mediatek,portmap property as it is just used to connect the CPU to the
rtl8367s switch though a gigabit connection. swconfig is still working
but not used.

There is an upstream driver for mediatek ethernet but it looks like it
does not support the mt7620. So, I'm using the one provided by
OpenWrt.

The issue is with MTU. Once DSA is up, it tries to increase the
interface MTU by 8 bytes (1508) to fit the Ethertype DSA tag (rtl8_4).
However, mtk_eth_soc does not accept that and it fails. I hacked the
driver to pass that test (netdev->max_mtu = 1508) but I still get
packets dropped.

I can see the outbound traffic working as expected even with the
802.1Q tag. So, the mt7530 switch is not the issue. However, when I
receive the inbound traffic, any ethernet payload (also considering
the DSA tag) that is over 1500 bytes (frame size 1514) is dropped. The
netdev->max_mtu field seems to be just a software control of what the
driver would accept but it looks like this driver simply ignores any
mtu increases. Does anyone have a suggestion?

I wonder how 802.1Q worked with swconfig... is the 802.1Q tag inserted
in a lower layer than DSA tags, before the MTU limit is in place?

Another issue is with checksum offload. After DSA was in place,
checksum stopped working. For now, I'm disabling it with "ethtool
--offload eth0 tx off" but it would be nice to have it back.

Regards,

---
     Luiz Angelo Daros de Luca
            luizluca at gmail.com



More information about the openwrt-devel mailing list