netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: DENG Qingfang <dqfext@gmail.com>
Cc: netdev <netdev@vger.kernel.org>, "Felix Fietkau" <nbd@nbd.name>,
	"John Crispin" <john@phrozen.org>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Mark Lee" <Mark-MC.Lee@mediatek.com>,
	"Landen Chao" <landen.chao@mediatek.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"René van Dorst" <opensource@vdorst.com>,
	"David Woodhouse" <dwmw2@infradead.org>,
	"Frank Wunderlich" <frank-w@public-files.de>
Subject: Re: [RFC PATCH net-next] net: ethernet: mediatek: support setting MTU
Date: Fri, 30 Oct 2020 13:36:48 +0100	[thread overview]
Message-ID: <20201030123648.GA1017106@lunn.ch> (raw)
In-Reply-To: <CALW65jaPV7sH8v3-K4X8gnzKTymxF=5dnatuKEuesDf64YKa=A@mail.gmail.com>

On Fri, Oct 30, 2020 at 10:43:51AM +0800, DENG Qingfang wrote:
> On Thu, Oct 29, 2020 at 9:02 PM Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > On Thu, Oct 29, 2020 at 02:39:15PM +0800, DENG Qingfang wrote:
> > > MT762x HW supports frame length up to 2048 (maximum length on GDM),
> > > so allow setting MTU up to 2030.
> > >
> > > Signed-off-by: DENG Qingfang <dqfext@gmail.com>
> > > ---
> > >
> > > I only tested this on MT7621, no sure if it is applicable for other SoCs
> > > especially MT7628, which has an old IP.
> > >
> > > ---
> > >  drivers/net/ethernet/mediatek/mtk_eth_soc.c | 31 ++++++++++++++++++++-
> > >  drivers/net/ethernet/mediatek/mtk_eth_soc.h | 11 ++++++--
> > >  2 files changed, 38 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> > > index 6d2d60675ffd..a0c56d9be1d5 100644
> > > --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> > > +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> > > @@ -353,7 +353,7 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode,
> > >       /* Setup gmac */
> > >       mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
> > >       mcr_new = mcr_cur;
> > > -     mcr_new |= MAC_MCR_MAX_RX_1536 | MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
> > > +     mcr_new |= MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
> > >                  MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_FORCE_LINK;
> >
> > Since you no longer set MAC_MCR_MAX_RX_1536, what does the hardware
> > default to?
> 
> 2'b00, i.e. 1518 bytes.

O.K, that fits the default for a netdev.

> It is handled in net_device->max_mtu:
> > eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN;

Cool.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

      reply	other threads:[~2020-10-30 12:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29  6:39 [RFC PATCH net-next] net: ethernet: mediatek: support setting MTU DENG Qingfang
2020-10-29 13:01 ` Andrew Lunn
2020-10-30  2:43   ` DENG Qingfang
2020-10-30 12:36     ` Andrew Lunn [this message]

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=20201030123648.GA1017106@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Mark-MC.Lee@mediatek.com \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=frank-w@public-files.de \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=landen.chao@mediatek.com \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=opensource@vdorst.com \
    --cc=sean.wang@mediatek.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).