lkml.org 
[lkml]   [2023]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/3] dsa: marvell: Provide per device information about max frame size
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.

\
 
 \ /
  Last update: 2023-03-26 23:39    [W:0.076 / U:0.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site