[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8FiQ3Fv25QJyawQ@lunn.ch>
Date: Fri, 13 Jan 2023 14:53:07 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Lukasz Majewski <lukma@...x.de>
Cc: Vladimir Oltean <olteanv@...il.com>,
Eric Dumazet <edumazet@...gle.com>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Russell King <linux@...linux.org.uk>,
Paolo Abeni <pabeni@...hat.com>,
Alexander Duyck <alexander.duyck@...il.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/3] dsa: marvell: Provide per device information
about max frame size
> I tend to agree... The number of switched which suppor 1522 B max frame
> is only six. This may be why the problem was not noticed.
>
> 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 would suggest some comments are added, explaining what is going on
here. Given the number of Fixes: tags in this area, it is clearly
tricky to get right, given how different switches operate.
I've not looked back to the email archive, but i have a vague
recollection that it could be some switches don't impose the MTU limit
on CPU and DSA ports, just the user ports. So the value reported for
those ports can actually be bigger than then the max mtu, in order to
accommodate the DSA header.
Andrew
Powered by blists - more mailing lists