netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Frank Wunderlich <frank-w@public-files.de>
Cc: Daniel Golle <daniel@makrotopia.org>,
	netdev@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH net-next v12 08/18] net: ethernet: mtk_eth_soc: fix 1000Base-X and 2500Base-X modes
Date: Tue, 14 Mar 2023 14:11:09 +0000	[thread overview]
Message-ID: <ZBCAfUK+YkRq3wfK@shell.armlinux.org.uk> (raw)
In-Reply-To: <trinity-99c1353c-98c3-4608-8079-9a818909e6c4-1678802351739@3c-app-gmx-bap50>

On Tue, Mar 14, 2023 at 02:59:11PM +0100, Frank Wunderlich wrote:
> Hi
> 
> very good...do not need the manual autoneg with the last Patch :)

Great news! Thanks for your patience.

> > Gesendet: Dienstag, 14. März 2023 um 11:10 Uhr
> > Von: "Russell King (Oracle)" <linux@armlinux.org.uk>
> 
> > For 802.3z modes, MLO_AN_INBAND with Autoneg clear in the advertising mode
> > disables in-band negotiation. This is exactly how "ethtool -s ethX
> > autoneg off" works.
> 
> ok, this seems now correctly set.
> 
> > > > 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.
> 
> root@bpi-r3:~# ip link set eth1 up
> [   91.624075] mtk_soc_eth 15100000.ethernet eth1: configuring for inband/2500base-x link mode
> [   91.632485] mtk_soc_eth 15100000.ethernet eth1: major config 2500base-x
> [   91.639094] mtk_soc_eth 15100000.ethernet eth1: phylink_mac_config: mode=inband/2500base-x/Unknown/Unknown/none adv=00,00000000,00008000,00006400 pause=00 link=0 an=0
> root@bpi-r3:~# [   95.808983] mtk_soc_eth 15100000.ethernet eth1: Link is Up - Unknown/Unknown - flow control off
> [   95.817706] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
>
> root@bpi-r3:~# ethtool eth1
> Settings for eth1:
>         Supported ports: [ FIBRE ]
>         Supported link modes:   2500baseT/Full
>         Supported pause frame use: Symmetric Receive-only
>         Supports auto-negotiation: No
>         Supported FEC modes: Not reported
>         Advertised link modes:  2500baseT/Full
>         Advertised pause frame use: Symmetric Receive-only
>         Advertised auto-negotiation: No
>         Advertised FEC modes: Not reported
>         Speed: Unknown!
>         Duplex: Unknown! (255)
>         Auto-negotiation: off
>         Port: FIBRE
>         PHYAD: 0
>         Transceiver: internal
>         Current message level: 0x000000ff (255)
>                                drv probe link timer ifdown ifup rx_err tx_err
>         Link detected: yes 
> 
> root@bpi-r3:~# dmesg | grep -i 'sfp\|eth1'
> [    0.000000] Linux version 6.3.0-rc1-bpi-r3-sfp13 (frank@frank-G5) (aarch64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #2 SMP Tue Mar 143
> [    1.658048] sfp sfp-1: Host maximum power 1.0W
> [    1.663128] sfp sfp-2: Host maximum power 1.0W
> [    1.812401] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc00af80000, irq 123
> [    2.001796] sfp sfp-1: module OEM              SFP-2.5G-T       rev 1.0  sn SK2301110008     dc 230110
> [    2.011307] mtk_soc_eth 15100000.ethernet eth1: optical SFP: interfaces=[mac=2-4,21-22, sfp=22]
> [    2.020000] mtk_soc_eth 15100000.ethernet eth1: optical SFP: chosen 2500base-x interface
> [    2.028080] mtk_soc_eth 15100000.ethernet eth1: requesting link mode inband/2500base-x with support 00,00000000,00008000,00006400
> [   91.624075] mtk_soc_eth 15100000.ethernet eth1: configuring for inband/2500base-x link mode
> [   91.632485] mtk_soc_eth 15100000.ethernet eth1: major config 2500base-x
> [   91.639094] mtk_soc_eth 15100000.ethernet eth1: phylink_mac_config: mode=inband/2500base-x/Unknown/Unknown/none adv=00,00000000,00008000,00006400 pause=00 link=0 an=0
> [   95.808983] mtk_soc_eth 15100000.ethernet eth1: Link is Up - Unknown/Unknown - flow control off
> [   95.817706] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
> 
> so you can see the link-up comes directly after the interface up
> 
> does the ethtool-output look like expected? i see speed/duplex is set as supported/advertised but not active
> 
>         Supported link modes:   2500baseT/Full
>         Advertised link modes:  2500baseT/Full
> vs.
>         Speed: Unknown!
>         Duplex: Unknown! (255) 

Yes, and I think that's reasonable given that the PHY is inaccessible,
and therefore we have no way to know what the PHY is actually doing.

> imho ETHTOOL_LINK_MODE_2500baseT_Full_BIT sets only the supported which intersected with the advertised from the other side maximum should be taken as actual mode...so this part seems not correctly working at the moment.

... except we don't know what "the other side" is doing because we
need to read that from the PHY in the SFP.

> the "Supported ports: [ FIBRE ]" is also misleading for copper sfp, but imho all SFP are shown like this.

... unless they have a PHY we can access.

> full log if needed:
> https://pastebin.com/6yWe4Kyi
> 
> next step:
> is it possible to have pause for rate adaption (handling rx pause frames correctly)?

That's certainly the next issue to sort out. I'll send a patch when I've
sorted that out.

Thanks!

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2023-03-14 14:12 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 15:52 [PATCH net-next v12 00/18] net: ethernet: mtk_eth_soc: various enhancements Daniel Golle
2023-03-07 15:52 ` [PATCH net-next v12 01/18] net: ethernet: mtk_eth_soc: add support for MT7981 SoC Daniel Golle
2023-03-07 15:52 ` [PATCH net-next v12 02/18] dt-bindings: net: mediatek,net: add mt7981-eth binding Daniel Golle
2023-03-07 15:52 ` [PATCH net-next v12 03/18] dt-bindings: arm: mediatek: sgmiisys: Convert to DT schema Daniel Golle
2023-03-07 15:53 ` [PATCH net-next v12 04/18] dt-bindings: arm: mediatek: sgmiisys: add MT7981 SoC Daniel Golle
2023-03-07 15:53 ` [PATCH net-next v12 05/18] net: ethernet: mtk_eth_soc: set MDIO bus clock frequency Daniel Golle
2023-03-07 15:53 ` [PATCH net-next v12 06/18] net: ethernet: mtk_eth_soc: reset PCS state Daniel Golle
2023-03-07 18:49   ` Aw: " Frank Wunderlich
2023-03-07 15:53 ` [PATCH net-next v12 07/18] net: ethernet: mtk_eth_soc: only write values if needed Daniel Golle
2023-03-07 18:53   ` Aw: " Frank Wunderlich
2023-03-07 15:53 ` [PATCH net-next v12 08/18] net: ethernet: mtk_eth_soc: fix 1000Base-X and 2500Base-X modes Daniel Golle
2023-03-07 18:52   ` Aw: " Frank Wunderlich
2023-03-08 11:35   ` Russell King (Oracle)
2023-03-08 12:11     ` Daniel Golle
2023-03-08 12:41       ` Russell King (Oracle)
2023-03-08 12:53         ` Daniel Golle
2023-03-08 13:12           ` Russell King (Oracle)
2023-03-08 13:46             ` Vladimir Oltean
2023-03-08 14:12               ` Russell King (Oracle)
2023-03-08 14:32                 ` Daniel Golle
2023-03-08 15:01                   ` Russell King (Oracle)
2023-03-08 15:08                     ` Daniel Golle
2023-03-08 15:24                       ` Russell King (Oracle)
2023-03-11 12:05                         ` Aw: " Frank Wunderlich
2023-03-11 13:26                           ` Frank Wunderlich
2023-03-11 14:51                             ` Daniel Golle
2023-03-11 20:02                               ` Russell King (Oracle)
2023-03-11 20:34                                 ` Daniel Golle
2023-03-11 20:00                           ` Russell King (Oracle)
2023-03-11 20:21                             ` Frank Wunderlich
2023-03-11 20:30                               ` Russell King (Oracle)
2023-03-12 12:40                                 ` Aw: " Frank Wunderlich
2023-03-12 14:26                                   ` Frank Wunderlich
2023-03-12 16:50                                     ` Frank Wunderlich
2023-03-12 20:10                                       ` Russell King (Oracle)
2023-03-12 20:05                                   ` Russell King (Oracle)
2023-03-13 10:59                                     ` Russell King (Oracle)
2023-03-13 18:39                                       ` Aw: " Frank Wunderlich
2023-03-13 22:57                                         ` Russell King (Oracle)
2023-03-14  8:51                                           ` Aw: " Frank Wunderlich
2023-03-14  9:12                                             ` Russell King (Oracle)
2023-03-14 10:01                                               ` Aw: " Frank Wunderlich
2023-03-14 10:10                                                 ` Russell King (Oracle)
2023-03-14 13:59                                                   ` Aw: " Frank Wunderlich
2023-03-14 14:11                                                     ` Russell King (Oracle) [this message]
2023-03-07 15:54 ` [PATCH net-next v12 09/18] net: ethernet: mtk_eth_soc: Fix link status for none-SGMII modes Daniel Golle
2023-03-07 18:50   ` Aw: " Frank Wunderlich
2023-03-08 11:38   ` Russell King (Oracle)
2023-03-08 11:44     ` Frank Wunderlich
2023-03-08 12:05       ` Daniel Golle
2023-03-08 16:24         ` Russell King (Oracle)
2023-03-08 12:35       ` Russell King (Oracle)
2023-03-07 15:54 ` [PATCH net-next v12 10/18] net: ethernet: mtk_eth_soc: ppe: add support for flow accounting Daniel Golle
2023-03-07 15:54 ` [PATCH net-next v12 11/18] net: pcs: add driver for MediaTek SGMII PCS Daniel Golle
2023-03-07 18:52   ` Aw: " Frank Wunderlich
2023-03-07 15:54 ` [PATCH net-next v12 12/18] net: ethernet: mtk_eth_soc: switch to external PCS driver Daniel Golle
2023-03-07 15:55 ` [PATCH net-next v12 13/18] net: dsa: mt7530: use " Daniel Golle
2023-03-07 15:55 ` [PATCH net-next v12 14/18] net: ethernet: mtk_eth_soc: add MTK_NETSYS_V1 capability bit Daniel Golle
2023-03-07 15:55 ` [PATCH net-next v12 15/18] net: ethernet: mtk_eth_soc: move MAX_DEVS in mtk_soc_data Daniel Golle
2023-03-07 15:55 ` [PATCH v12 16/18] net: ethernet: mtk_eth_soc: rely on num_devs and remove MTK_MAC_COUNT Daniel Golle
2023-03-07 15:55 ` [PATCH v12 17/18] net: ethernet: mtk_eth_soc: add MTK_NETSYS_V3 capability bit Daniel Golle
2023-03-07 15:56 ` [PATCH v12 18/18] net: ethernet: mtk_eth_soc: convert caps in mtk_soc_data struct to u64 Daniel Golle

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=ZBCAfUK+YkRq3wfK@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=daniel@makrotopia.org \
    --cc=frank-w@public-files.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=netdev@vger.kernel.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).