[lkml]   [2020]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectAw: Re: [PATCH v2] net: ethernet: mtk_eth_soc: fix mtu warning
> Gesendet: Donnerstag, 09. Juli 2020 um 15:41 Uhr
> Von: "Andrew Lunn" <>

> > + eth->netdev[id]->max_mtu = 1536;
> I assume this is enough to make the DSA warning go away, but it is the
> true max? I have a similar patch for the FEC driver which i should
> post sometime. Reviewing the FEC code and after some testing, i found
> the real max was 2K - 64.

i tried setting only the max_mtu, but the dsa-error is still present

mt7530 mdio-bus:00: nonfatal error -95 setting MTU on port 0

but i got it too, if i revert the change...mhm, strange that these were absent last time...

the other 2 are fixed with only max_mtu.
@andrew where did you got the 2k-64 (=1984) information? sounds like orwell ;)


as so far, commit 72579e14a1d3d3d561039dfe7e5f47aaf22e3fd3 introduces the warning,
but the change is making it i need to adjust my fixes-tag.
i guess the real problem lies in this:

bfcb813203e6 net: dsa: configure the MTU for switch ports

it looks like dsa_slave_change_mtu failes because of missing callback in mtk_driver (mt7530 for mt7531 in my case).

1405 static int dsa_slave_change_mtu(struct net_device *dev, int new_mtu)
1420 if (!ds->ops->port_change_mtu)
1421 return -EOPNOTSUPP;

i added an empty callback to avoid this message, but mtu should be set in hardware too...
here i will ne some assistance from mtk ethernet experts and mt7531 driver (from landen chao) to be merged first (after some needed changes)

--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2259,6 +2259,12 @@ mt753x_phy_write(struct dsa_switch *ds, int port, int regnum, u16 val)
return priv->info->phy_write(ds, port, regnum, val);

+static int
+mt753x_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
+ return 0;
static const struct dsa_switch_ops mt7530_switch_ops = {
.get_tag_protocol = mtk_get_tag_protocol,
.setup = mt753x_setup,
@@ -2281,6 +2287,7 @@ static const struct dsa_switch_ops mt7530_switch_ops = {
.port_vlan_del = mt7530_port_vlan_del,
.port_mirror_add = mt7530_port_mirror_add,
.port_mirror_del = mt7530_port_mirror_del,
+ .port_change_mtu = mt753x_port_change_mtu,
.phylink_validate = mt753x_phylink_validate,
.phylink_mac_link_state = mt7530_phylink_mac_link_state,
.phylink_mac_config = mt753x_phylink_mac_config,
 \ /
  Last update: 2020-07-09 21:50    [W:0.048 / U:2.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site