From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
netdev@vger.kernel.org, hkallweit1@gmail.com,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com
Subject: Re: [net PATCH 1/2] net: phy: Cleanup handling of recent changes to phy_lookup_setting
Date: Fri, 4 Apr 2025 00:19:02 +0100 [thread overview]
Message-ID: <Z-8XZiNHDoEawqww@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAKgT0UdhTT=g+ODpzR5uoTEOkC8u+cfCp7H-8718Zphd=24buw@mail.gmail.com>
On Thu, Apr 03, 2025 at 02:53:22PM -0700, Alexander Duyck wrote:
> On Thu, Apr 3, 2025 at 9:34 AM Andrew Lunn <andrew@lunn.ch> wrote:
> > Maybe go back to why fixed-link exists? It is basically a hack to make
> > MAC configuration easier. It was originally used for MAC to MAC
> > connections, e.g. a NIC connected to a switch, without PHYs in the
> > middle. By faking a PHY, there was no need to add any special
> > configuration API to the MAC, the phylib adjust_link callback would be
> > sufficient to tell the MAC to speed and duplex to use. For {R}{G}MII,
> > or SGMII, that is all you need to know. The phy-mode told you to
> > configure the MAC to MII, GMII, SGMII.
>
> Another issue is that how you would define the connection between the
> two endpoints is changing. Maxime is basing his data off of
> speed/duplex however to source that he is pulling data from
> link_mode_params that is starting to broaden including things like
> lanes.
Just a quick correction - this is not entirely correct. It's speed,
duplex and "lanes" is defined by interface mode.
For example, 10GBASER is a single lane, as is SGMII, 1000BASE-X,
2500BASE-X. XLGMII and CGMII are defined by 802.3 as 8 lanes (clause
81.)
speed and duplex just define the speed operated over the link defined
by the PHY interface mode.
(I've previously described why we don't go to that depth with fixed
links, but to briefly state it, it's what we've done in the past and
it's visible to the user, and we try to avoid breaking userspace.)
> I really think going forward lanes is going to start playing a
> role as we get into the higher speeds and it is already becoming a
> standard config item to use to strip out unsupported modes when
> configuring the interface via autoneg.
Don't vendors already implement downshift for cases where there are
problems with lanes/cabling?
> I am wondering about that. I know I specified we were XLGMII for fbnic
> but that has proven problematic since we aren't actually 40G.
If you aren't actually 40G, then you aren't actually XLGMII as
defined by 802.3... so that begs the question - what are you!
> So we
> are still essentially just reporting link up/down using that. That is
> why I was looking at going with a fixed mode as I can at least specify
> the correct speed duplex for the one speed I am using if I want to use
> ethtool_ksettings_get.
>
> I have a patch to add the correct phy_interface_t modes for 50, and
> 100G links. However one thing I am seeing is that after I set the
> initial interface type I cannot change the interface type without the
> SFP code added. One thing I was wondering. Should I just ignore the
> phy_interface_t on the pcs_config call and use the link mode mask
> flags in autoneg and the speed/duplex/lanes in non-autoneg to
> configure the link? It seems like that is what the SFP code itself is
> doing based on my patch 2 in the set.
That is most certainly *not* what the SFP code is doing. As things stand
today, everything respects the PHY interface mode, if it says SGMII then
we get SGMII. If it says 1000BASE-X, we get 1000BASE-X. If it says
2500BASE-X, then that's what we get... and so on.
The SFP code has added support to switch between 2500BASE-X and
1000BASE-X because this is a use case with optical SFPs that can operate
at either speed. That's why this happens for the SFP case.
For PHYs, modern PHYs switch their host facing interface, so we support
the interface mode changing there - under the control of the PHY and
most certainly not under user control (the user doesn't know how the
PHY has been configured and whether the PHY does switch or rate
adapt.)
For everything else, we're in fixed host interface mode, because that
is how we've been - and to do anything else is new development.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2025-04-03 23:19 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 21:29 [net PATCH 0/2] Fixes for net/phy/phylink.c Alexander Duyck
2025-04-01 21:30 ` [net PATCH 1/2] net: phy: Cleanup handling of recent changes to phy_lookup_setting Alexander Duyck
2025-04-02 7:00 ` Maxime Chevallier
2025-04-02 14:21 ` Alexander H Duyck
2025-04-02 17:17 ` Jakub Kicinski
2025-04-02 17:30 ` Russell King (Oracle)
2025-04-02 22:37 ` Alexander Duyck
2025-04-03 14:55 ` Russell King (Oracle)
2025-04-03 15:29 ` Maxime Chevallier
2025-04-03 16:34 ` Andrew Lunn
2025-04-03 21:53 ` Alexander Duyck
2025-04-03 23:19 ` Russell King (Oracle) [this message]
2025-04-04 15:56 ` Alexander Duyck
2025-04-04 16:33 ` Andrew Lunn
2025-04-04 22:46 ` Alexander Duyck
2025-04-05 9:43 ` Russell King (Oracle)
2025-04-05 14:51 ` Andrew Lunn
2025-04-05 20:41 ` Alexander Duyck
2025-04-05 20:53 ` Andrew Lunn
2025-04-05 9:10 ` Russell King (Oracle)
2025-04-05 15:43 ` Andrew Lunn
2025-04-05 15:52 ` Andrew Lunn
2025-04-05 16:19 ` Alexander Duyck
2025-04-05 20:23 ` Alexander Duyck
2025-04-03 23:26 ` Russell King (Oracle)
2025-04-04 1:46 ` Andrew Lunn
2025-04-04 7:16 ` Russell King (Oracle)
2025-04-04 16:18 ` Alexander Duyck
2025-04-07 17:01 ` Jakub Kicinski
2025-04-07 18:20 ` Alexander Duyck
2025-04-07 19:34 ` Andrew Lunn
2025-04-07 23:01 ` Alexander Duyck
2025-04-01 21:30 ` [net PATCH 2/2] net: phylink: Set advertising based on phy_lookup_setting in ksettings_set Alexander Duyck
2025-04-02 18:02 ` Russell King (Oracle)
2025-04-02 22:34 ` Alexander Duyck
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=Z-8XZiNHDoEawqww@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=alexander.duyck@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).