On Fri, Jan 13, 2023 at 02:20:17PM +0100, Lukasz Majewski wrote:
The fixed function maybe should look like below:
static int mv88e6xxx_get_max_mtu(struct dsa_switch *ds, int port)
{
....
int max_mtu;
max_mtu = chip->info->max_frame_size - VLAN_ETH_HLEN -
ETH_FCS_LE;
if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port))
max_mtu -= EDSA_HLEN;
return max_mtu;
}
Comments more than welcome.
I suspect that looking at the DSA code which calls these methods will
answer a lot of your questions. ds->ops->port_max_mtu() is only called
for user ports. As for ds->ops->port_change_mtu(), this will always be
called with the requested L2 payload length (default 1500) on user ports,
and with the maximum among user ports for DSA and CPU ports.