netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: Belisko Marek <marek.belisko@gmail.com>
Cc: netdev <netdev@vger.kernel.org>,
	linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com,
	mripard@kernel.org, wens@csie.org, jernej.skrabec@siol.net
Subject: Re: set mtu size broken for dwmac-sun8i
Date: Wed, 17 Mar 2021 17:01:56 +0100	[thread overview]
Message-ID: <YFIn9CRmZGrTILXI@Red> (raw)
In-Reply-To: <CAAfyv37JbPtV3uUzc0ZUHNMCh+_y1XOH-auGWYJSzy4id07VCw@mail.gmail.com>

Le Wed, Mar 17, 2021 at 12:37:48PM +0100, Belisko Marek a écrit :
> On Wed, Mar 17, 2021 at 12:33 PM Corentin Labbe
> <clabbe.montjoie@gmail.com> wrote:
> >
> > Le Wed, Mar 17, 2021 at 10:19:26AM +0100, Belisko Marek a écrit :
> > > Hi,
> > >
> > > I'm hunting an issue when setting mtu failed for dwmac-sun8i driver.
> > > Basically adding more debug shows that in stmmac_change_mtu
> > > tx_fifo_size is 0 and in this case EINVAL is reported. Isaw there was
> > > fix for similar driver dwmac-sunxi driver by:
> > > 806fd188ce2a4f8b587e83e73c478e6484fbfa55
> > >
> > > IIRC dwmac-sun8i should get tx and rx fifo size from dma but seems
> > > it's not the case. I'm using 5.4 kernel LTS release. Any ideas?
> > >
> > > Thanks and BR,
> > >
> > > marek
> > >
> >
> > Hello
> >
> > Could you provide exact command line you tried to change mtu ?
> > Along with all MTU values you tried.
> I tried with ifconfig eth0 down && ifconfig eth0 mtu 1400 return:
> ifconfig: SIOCSIFMTU: Invalid argument
> 
> btw board is orange-pi-pc-plus
> >
> > Thanks
> > Regards
> 

I have added as CC sunxi maintainers

I can confirm that dwmac-sun8i need the same fix as 806fd188ce2a4f8b587e83e73c478e6484fbfa55.
With the patch below, I successfully changed MTU ... and the network is still working.
My first test was on orange-pi-pc which is the same SoC than your board.
I test this patch on all other sunxi SoCs and I send it upstream after.

@netdev, does there is some specific MTU values interesting to test ? (I curently try 68 500 1000 1200 1400 1500 1600 9000)

Regards

Author: Corentin Labbe <clabbe.montjoie@gmail.com>
Date:   Wed Mar 17 16:49:50 2021 +0100

    net: stmmac: dwmac-sun8i: Provide TX and RX fifo sizes
    
    MTU cannot be changed on dwmac-sun8i.
    This is due to tx_fifo_size being 0.
    Like dwmac-sunxi (with 806fd188ce2a ("net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes"))
    dwmac-sun8i need to have tx and rx fifo sizes set.
    
    Fixes: 9f93ac8d408 ("net-next: stmmac: Add dwmac-sun8i")
    Reported-by: Belisko Marek <marek.belisko@gmail.com>
    Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index 6b75cf2603ff..e62efd166ec8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -1214,6 +1214,8 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
        plat_dat->init = sun8i_dwmac_init;
        plat_dat->exit = sun8i_dwmac_exit;
        plat_dat->setup = sun8i_dwmac_setup;
+       plat_dat->tx_fifo_size = 4096;
+       plat_dat->rx_fifo_size = 16384;
 
        ret = sun8i_dwmac_set_syscon(&pdev->dev, plat_dat);
        if (ret)


      reply	other threads:[~2021-03-17 16:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17  9:19 set mtu size broken for dwmac-sun8i Belisko Marek
2021-03-17 11:33 ` Corentin Labbe
2021-03-17 11:37   ` Belisko Marek
2021-03-17 16:01     ` Corentin Labbe [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=YFIn9CRmZGrTILXI@Red \
    --to=clabbe.montjoie@gmail.com \
    --cc=jernej.skrabec@siol.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=marek.belisko@gmail.com \
    --cc=mripard@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wens@csie.org \
    /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).