lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c2b6af56-57f7-4658-9e6f-e671be19e300@solid-run.com>
Date: Mon, 19 Jan 2026 08:30:12 +0000
From: Josua Mayer <josua@...id-run.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
CC: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC net-next v2 1/2] net: phy: marvell: 88e1111: define
 gigabit features

Hi Russell,

Thank you for the extensive feedback!

On 02/01/2026 15:55, Russell King (Oracle) wrote:
> On Fri, Jan 02, 2026 at 12:47:06PM +0000, Russell King (Oracle) wrote:
>> I do have patches that add phydev->supported_interfaces which are
>> populated at probe time to inform phylink which host interface modes
>> that the PHY can be reconfigured between - and this overrides the
>> linkmode-derivation of that information - it basically becomes:
>>
>>          phy_interface_and(interfaces, phy->supported_interfaces,
>>                            pl->config->supported_interfaces);
>>          interface = phylink_choose_sfp_interface(pl, interfaces);
>>          if (interface == PHY_INTERFACE_MODE_NA) {
>>                  phylink_err(pl, "selection of interface for PHY failed\n");
>>                  return -EINVAL;
>>          }
>>
>>          phylink_dbg(pl, "copper SFP: chosen %s interface\n",
>>                      phy_modes(interface));
>>
>>          ret = phylink_attach_phy(pl, phy, interface);
>>
>> and phylink_attach_phy() will result in the PHY driver's config_init
>> being called, configuring the appropriate operating mode for the
>> PHY, which can then be used to update phydev->supported as appropriate.
>>
>> phylink will then look at phydev->supported once the above has
>> completed when it will do so in phylink_bringup_phy().
>>
>> Deriving the host side PHY interface mode from the link modes has
>> always been rather sketchy.
> These patches can be found at:
>
> http://git.armlinux.org.uk/cgit/linux-arm.git/log/?h=net-queue
>
> See:
>
> net: phylink: use phy interface mode bitmaps for SFP PHYs
> net: phy: add supported_interfaces to Aquantia AQR113C
> net: phy: add supported_interfaces to marvell10g PHYs
> net: phy: add supported_interfaces to marvell PHYs
> net: phy: add supported_interfaces to bcm84881
> net: phy: add supported_interfaces to phylib
>
> The reason I didn't end up pushing them (they're almost six years old)
> is because I decided that the host_interfaces approach wasn't a good
> idea, and dropped those patches. Marek Behún took my patches for
> host_interfaces and they were merged in 2022. I had already junked
> the host_interfaces approach.
>
> The problem is that we now have two ways that PHY drivers configure
> their interface mode - one where config_init() decides on its own
> based on the host_interfaces supplied to it, and this approach above
> where phylink attempts to choose the interface based on what the
> PHY and host (and datapath) can support. These two approaches are
> mutually incompatible if we get both phylink _and_ the PHY driver
> attempting to do the same thing.

All this left me puzzled.

I understand that .features / get_features happens too early
and doesn't account for different host interfaces.

Further populating supported bitmask before config_init is wrong
at least for this module where supported link-modes are different
per host interface.

The marvell10g.c driver which now uses the host_interfaces bitmask
is now extending the supported_interfaces bitmask in config_init.
Yet I didn't understand what it means.

 From phy.h:

  * @possible_interfaces: bitmap if interface modes that the attached PHY
  *             will switch between depending on media speed.

So does this mean the host side? Or the copper side?

If it means host side, would it be okay for the 88E1111 phy to populate
possible_interfaces from its config_init for 10/100/1000 link-modes,
if host side is configured for sgmii?
Or populate possible_interfaces from BMSR at this point?

Unfortunately I do not have the affected SFPs near me for a few weeks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ