Thread (6 messages) flat view 6 messages, 3 authors, 2023-01-13

Re: [PATCH v4 1/3] dsa: marvell: Provide per device information about max frame size

From: Vladimir Oltean <olteanv@gmail.com>
Date: 2023-01-13 14:03:05
Also in: lkml

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help