From: Simon Horman <simon.horman@corigine.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Murali Krishna Policharla <murali.policharla@broadcom.com>,
Lukasz Majewski <lukma@denx.de>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 1/2] net: dsa: don't error out when drivers return ETH_DATA_LEN in .port_max_mtu()
Date: Wed, 15 Mar 2023 10:53:36 +0100 [thread overview]
Message-ID: <ZBGVoEWp728Kb1tw@corigine.com> (raw)
In-Reply-To: <20230314182405.2449898-2-vladimir.oltean@nxp.com>
On Tue, Mar 14, 2023 at 08:24:04PM +0200, Vladimir Oltean wrote:
> Currently, when dsa_slave_change_mtu() is called on a user port where
> dev->max_mtu is 1500 (as returned by ds->ops->port_max_mtu()), the code
> will stumble upon this check:
>
> if (new_master_mtu > mtu_limit)
> return -ERANGE;
>
> because new_master_mtu is adjusted for the tagger overhead but mtu_limit
> is not.
>
> But it would be good if the logic went through, for example if the DSA
> master really depends on an MTU adjustment to accept DSA-tagged frames.
>
> To make the code pass through the check, we need to adjust mtu_limit for
> the overhead as well, if the minimum restriction was caused by the DSA
> user port's MTU (dev->max_mtu). A DSA user port MTU and a DSA master MTU
> are always offset by the protocol overhead.
>
> Currently no drivers return 1500 .port_max_mtu(), but this is only
> temporary and a bug in itself - mv88e6xxx should have done that, but
> since commit b9c587fed61c ("dsa: mv88e6xxx: Include tagger overhead when
> setting MTU for DSA and CPU ports") it no longer does. This is a
> preparation for fixing that.
>
> Fixes: bfcb813203e6 ("net: dsa: configure the MTU for switch ports")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
next prev parent reply other threads:[~2023-03-15 9:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-14 18:24 [PATCH net 0/2] Fix MTU reporting for Marvell DSA switches where we can't change it Vladimir Oltean
2023-03-14 18:24 ` [PATCH net 1/2] net: dsa: don't error out when drivers return ETH_DATA_LEN in .port_max_mtu() Vladimir Oltean
2023-03-15 9:53 ` Simon Horman [this message]
2023-03-15 18:34 ` Florian Fainelli
2023-03-14 18:24 ` [PATCH net 2/2] net: dsa: mv88e6xxx: fix max_mtu of 1492 on 6165, 6191, 6220, 6250, 6290 Vladimir Oltean
2023-03-15 9:54 ` Simon Horman
2023-03-15 18:35 ` Florian Fainelli
2023-03-16 17:50 ` [PATCH net 0/2] Fix MTU reporting for Marvell DSA switches where we can't change it patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZBGVoEWp728Kb1tw@corigine.com \
--to=simon.horman@corigine.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lukma@denx.de \
--cc=murali.policharla@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).