Aw: Re: Re: Re: Re: Re: [PATCH net-next v12 08/18] net: ethernet: mtk_eth_soc: fix 1000Base-X and 2500Base-X modes

From: Frank Wunderlich
Date: Tue Mar 14 2023 - 06:02:01 EST


Hi

> Gesendet: Dienstag, 14. März 2023 um 10:12 Uhr
> Von: "Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx>
> On Tue, Mar 14, 2023 at 09:51:12AM +0100, Frank Wunderlich wrote:
> > Hi,
> >
> > at least the error-message is gone, and interface gets up when i call ethtoo to switch off autoneg.
...
> > [ 34.400860] mtk_soc_eth 15100000.ethernet eth1: phylink_mac_config: mode=inband/2500base-x/Unknown/Unknown/none adv=00,00000000,00000000,0000e400 pause=04 link=0 an=1
>
> Looking good - apart from that pesky an=1 (which isn't used by the PCS
> driver, and I've been thinking of killing it off anyway.) Until such
> time that happens, we really ought to set that correctly, which means
> an extra bit is needed in phylink_sfp_set_config(). However, this
> should not affect anything.
>
> > root@bpi-r3:~#
> > root@bpi-r3:~# ethtool -s eth1 autoneg off
> > root@bpi-r3:~# [ 131.031902] mtk_soc_eth 15100000.ethernet eth1: Link is Up - 2.5Gbps/Full - flow control off
> > [ 131.040366] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
> >
> > full log here:
> > https://pastebin.com/yDC7PuM2
> >
> > i see that an is still 1..maybe because of the fixed value here?
> >
> > https://elixir.bootlin.com/linux/v6.3-rc1/source/drivers/net/phy/phylink.c#L3038
>
> Not sure what that line has to do with it - this is what the above
> points to:
>
> phylink_sfp_set_config(pl, MLO_AN_INBAND, pl->sfp_support, &config);

MLO_AN_INBAND => may cause the an=1 and mode=inband if previously (?) disabled :)

> Anyway, the important thing is the Autoneg bit in the advertising mask
> is now zero, which is what we want. That should set the PCS to disable
> negotiation when in 2500baseX mode, the same as ethtool -s eth1 autoneg
> off.
>
> So I think the question becomes - what was the state that ethtool was
> reporting before asking ethtool to set autoneg off, and why does that
> make a difference.

ok, i do ethtool output before and after on next test.

> > and yes, module seems to do rate adaption (it is labeled with 100M/1G/2.5G), i tried it on a 1G-Port and link came up (with workaround patch from daniel),
> > traffic "works" but in tx-direction with massive retransmitts (i guess because pause-frames are ignored - pause was 00).
>
> We'll see about addressing that later once we've got the module working
> at 2.5G. However, thanks for the information.

of course...step by step, just wanted to tell this behaviour

> The patch below should result in ethtool reporting 2500baseT rather than
> 2500baseX, and that an=1 should now be an=0. Please try it, and dump the
> ethtool eth1 before asking for autoneg to be manually disabled, and also
> report the kernel messages.

i see no Patch below ;)

regards Frank