* set mtu size broken for dwmac-sun8i
@ 2021-03-17 9:19 Belisko Marek
2021-03-17 11:33 ` Corentin Labbe
0 siblings, 1 reply; 4+ messages in thread
From: Belisko Marek @ 2021-03-17 9:19 UTC (permalink / raw)
To: netdev
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
--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer
Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: set mtu size broken for dwmac-sun8i
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
0 siblings, 1 reply; 4+ messages in thread
From: Corentin Labbe @ 2021-03-17 11:33 UTC (permalink / raw)
To: Belisko Marek; +Cc: netdev
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.
Thanks
Regards
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: set mtu size broken for dwmac-sun8i
2021-03-17 11:33 ` Corentin Labbe
@ 2021-03-17 11:37 ` Belisko Marek
2021-03-17 16:01 ` Corentin Labbe
0 siblings, 1 reply; 4+ messages in thread
From: Belisko Marek @ 2021-03-17 11:37 UTC (permalink / raw)
To: Corentin Labbe; +Cc: netdev
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
BR,
marek
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: set mtu size broken for dwmac-sun8i
2021-03-17 11:37 ` Belisko Marek
@ 2021-03-17 16:01 ` Corentin Labbe
0 siblings, 0 replies; 4+ messages in thread
From: Corentin Labbe @ 2021-03-17 16:01 UTC (permalink / raw)
To: Belisko Marek
Cc: netdev, linux-kernel, linux-sunxi, mripard, wens, jernej.skrabec
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)
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-17 16:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).