netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Baruch Siach <baruch@tkos.co.il>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: Get MAC supported link modes for SFP port
Date: Thu, 26 Nov 2020 15:45:53 +0000	[thread overview]
Message-ID: <20201126154553.GN1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <87pn40uo25.fsf@tarshish>

On Thu, Nov 26, 2020 at 05:37:22PM +0200, Baruch Siach wrote:
> Hi netdev list,
> 
> I am trying to retrieve all MAC supported link modes
> (ETHTOOL_LINK_MODE_*) for network interfaces with SFP port. The
> 'supported' bit mask that ETHTOOL_GLINKSETTINGS provides in
> link_mode_masks[] changes to match the SFP module that happens to be
> plugged in. When no SFP module is plugged, the bit mask looks
> meaningless.
> 
> I understand that ETHTOOL_LINK_MODE_* bits are meant to describe PHY
> level capabilities. So I would settle for a MAC level "supported rates"
> list.
> 
> Is there anything like that?

No, because there's a problem: the link modes that the MAC supports
is not a particularly certain thing. When there's no module inserted,
we don't know what interface mode may be in operation, and the
interface mode has a big handle in determining which link modes can
be supported.

For example, if it's operating as 1000BASE-X or 10GBASE-R, then we're
pretty limited to a single link mode if there's nothing else present.
If it's in SGMII, then 10/100/1000 speeds are possible but there's
no link mode to describe that - no PHY, therefore there's no copper
and therefore BASE-T is meaningless.

The ethtool link modes are, in reality, _media_ link modes. If there
is no media or socket that defines the media, there are no link modes.

-- 
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:[~2020-11-26 15:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 15:37 Get MAC supported link modes for SFP port Baruch Siach
2020-11-26 15:45 ` Russell King - ARM Linux admin [this message]
2020-11-26 15:47 ` Andrew Lunn
2020-11-26 16:01   ` Baruch Siach
2020-11-26 16:13     ` Russell King - ARM Linux admin

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=20201126154553.GN1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=baruch@tkos.co.il \
    --cc=hkallweit1@gmail.com \
    --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).