From: Jonathan McDowell <noodles@earth.li>
To: DENG Qingfang <dqfext@gmail.com>
Cc: "Vladimir Oltean" <olteanv@gmail.com>,
"Jakub Kicinski" <kuba@kernel.org>,
netdev <netdev@vger.kernel.org>,
"Sean Wang" <sean.wang@mediatek.com>,
"Landen Chao" <Landen.Chao@mediatek.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Vivien Didelot" <vivien.didelot@gmail.com>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
"René van Dorst" <opensource@vdorst.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Murali Krishna Policharla" <murali.policharla@broadcom.com>,
"Chris Packham" <chris.packham@alliedtelesis.co.nz>
Subject: Re: [PATCH] net: dsa: mt7530: support setting MTU
Date: Thu, 29 Oct 2020 08:11:08 +0000 [thread overview]
Message-ID: <20201029081108.GB32650@earth.li> (raw)
In-Reply-To: <CALW65jYa9rTRaE2jn67iWG3=w=CFYvR0VWDNqtj5Vc3L=s6Jpg@mail.gmail.com>
On Thu, Oct 29, 2020 at 11:32:36AM +0800, DENG Qingfang wrote:
> On Thu, Oct 29, 2020 at 2:31 AM Vladimir Oltean <olteanv@gmail.com> wrote:
> >
> > On Thu, Oct 29, 2020 at 02:12:21AM +0800, DENG Qingfang wrote:
...
> > > +static int
> > > +mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
> > > +{
> > > + struct mt7530_priv *priv = ds->priv;
> > > + int length;
> > > +
> > > + /* When a new MTU is set, DSA always set the CPU port's MTU to the largest MTU
> > > + * of the slave ports. Because the switch only has a global RX length register,
> > > + * only allowing CPU port here is enough.
> > > + */
> >
> > Good point, please tell that to Linus (cc) - I'm talking about
> > e0b2e0d8e669 ("net: dsa: rtl8366rb: Roof MTU for switch"),
>
> And 6ae5834b983a ("net: dsa: b53: add MTU configuration support"),
> 1baf0fac10fb ("net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU"),
> f58d2598cf70 ("net: dsa: qca8k: implement the port MTU callbacks")
>
> CC'd them as well.
qca8k tracks and use the maximum provided mtu; perhaps that could be
optimised by only allow the CPU port to be set but it feels a bit more
future proof (e.g. if/when we support multiple CPU ports).
> Also, the commit e0b2e0d8e669 states that the new_mtu parameter is L2
> frame length instead of L2 payload. But according to my tests, it is
> L2 payload (i.e. the same as the MTU shown in `ip link` or `ifconfig`.
> Is that right?
Certainly that's what I saw; qca8k sets the MTU to the provided MTU +
ETH_HLEN + ETH_FCS_LEN.
J.
--
Pretty please, with sugar on top, clean the f**king car.
This .sig brought to you by the letter J and the number 13
Product of the Republic of HuggieTag
next prev parent reply other threads:[~2020-10-29 8:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 18:12 [PATCH] net: dsa: mt7530: support setting MTU DENG Qingfang
2020-10-28 18:31 ` Vladimir Oltean
2020-10-29 3:32 ` DENG Qingfang
2020-10-29 8:11 ` Jonathan McDowell [this message]
2020-10-29 8:19 ` DENG Qingfang
2020-10-28 18:46 ` Florian Fainelli
2020-10-29 22:42 ` Jakub Kicinski
2020-10-30 2:58 ` DENG Qingfang
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=20201029081108.GB32650@earth.li \
--to=noodles@earth.li \
--cc=Landen.Chao@mediatek.com \
--cc=andrew@lunn.ch \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=murali.policharla@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=opensource@vdorst.com \
--cc=sean.wang@mediatek.com \
--cc=vivien.didelot@gmail.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).