[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALW65jYodd=GoWrGTcAWEO6wNQdvSQjgO=4tmNYNnmbCh7n8sg@mail.gmail.com>
Date: Tue, 14 Apr 2020 11:03:02 +0800
From: DENG Qingfang <dqfext@...il.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: Florian Fainelli <f.fainelli@...il.com>,
David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
René van Dorst <opensource@...rst.com>,
John Crispin <john@...ozen.org>,
Vivien Didelot <vivien.didelot@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Sean Wang <sean.wang@...iatek.com>,
Weijie Gao <weijie.gao@...iatek.com>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH net-next] net: dsa: mt7530: enable jumbo frame
On Fri, Apr 10, 2020 at 6:46 PM Vladimir Oltean <olteanv@...il.com> wrote:
>
> Hi Qingfang,
>
> On Fri, 10 Apr 2020 at 05:51, DENG Qingfang <dqfext@...il.com> wrote:
> >
> > On Fri, Apr 10, 2020 at 10:27 AM Florian Fainelli <f.fainelli@...il.com> wrote:
> > >
> > >
> > >
> > > On 4/9/2020 7:19 PM, DENG Qingfang wrote:
> > > > So, since nothing else uses the mt7530_set_jumbo function, should I
> > > > remove the function and just add a single rmw to mt7530_setup?
> > >
> > > (please do not top-post on netdev)
> > >
> > > There is a proper way to support the MTU configuration for DSA switch
> > > drivers which is:
> > >
> > > /*
> > > * MTU change functionality. Switches can also adjust their MRU
> > > through
> > > * this method. By MTU, one understands the SDU (L2 payload) length.
> > > * If the switch needs to account for the DSA tag on the CPU
> > > port, this
> > > * method needs to to do so privately.
> > > */
> > > int (*port_change_mtu)(struct dsa_switch *ds, int port,
> > > int new_mtu);
> > > int (*port_max_mtu)(struct dsa_switch *ds, int port);
> >
> > MT7530 does not support configuring jumbo frame per-port
> > The register affects globally
> >
> > >
> > > --
> > > Florian
>
> This is a bit more tricky, but I think you can still deal with it
> using the port_change_mtu functionality. Basically it is only a
> problem when the other ports are standalone - otherwise the
> dsa_bridge_mtu_normalization function should kick in.
> So if you implement port_change_mtu, you should do something along the lines of:
>
> for (i = 0; i < MT7530_NUM_PORTS; i++) {
> struct net_device *slave;
>
> if (!dsa_is_user_port(ds, i))
> continue;
>
> slave = ds->ports[i].slave;
>
> slave->mtu = new_mtu;
> }
>
> to update the MTU known by the stack for all net devices.
Should we warn users that all ports will be affected?
>
> Hope this helps,
> -Vladimir
Powered by blists - more mailing lists