netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ethtool settings and SFP modules with PHYs
@ 2024-09-16 15:36 Daniel Golle
  2024-09-16 16:02 ` Maxime Chevallier
  2024-09-16 16:03 ` Andrew Lunn
  0 siblings, 2 replies; 9+ messages in thread
From: Daniel Golle @ 2024-09-16 15:36 UTC (permalink / raw)
  To: linux-kernel, netdev, Heiner Kallweit, Russell King,
	Maxime Chevallier, Kory Maincent, Edward Cree, Andrew Lunn,
	Paolo Abeni, Jakub Kicinski, Eric Dumazet, David S. Miller
  Cc: John Crispin

Hi,

I'm wondering how (or rahter: when?) one is supposed to apply ethtool
settings, such as modifying advertisement of speed, duplex, ..., with
SFP modules containing a PHY.

My first approach was to try catching the event of the PHY being
attached and then re-applying ethtool settings[1]. As there isn't a
dedicated event for that, I found that IFF_UP && !IFF_LOWER_UP is as
close as it gets.

However, that doesn't go well with some PHY drivers and the result seems
to depend on a race condition.

Simply ignoring the supported link modes and assuming the kernel would
filter them also doesn't work as also the advertised modes get reset
every time the SFP module is removed or inserted.

Do you think it would make sense to keep the user selection of
advertised modes for each networking device accross removal or insertion
of an SFP module?

The user selection would by default select all known link modes, using
ethtool (ioctl or nl) would modify it, while the actually advertised
modes would always be the intersection of user-selected modes and
supported modes.

Alternatively we could of course also introduce a dedicated NETLINK_ROUTE
event which fires exactly one time once a new is PHY attached.

If there is any way to automically apply user-configured ethtool
settings without any of the above, please be so kind and let me know how
that would work also for PHYs on SFP modules.

Thank you!

With Best Regards

Daniel

[1]: https://git.openwrt.org/?p=project/netifd.git;a=commitdiff;h=68c8a4f94cd3cfd654a52cbc8b57c5c9d99640dd

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-09-17 17:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-16 15:36 ethtool settings and SFP modules with PHYs Daniel Golle
2024-09-16 16:02 ` Maxime Chevallier
2024-09-16 16:12   ` Andrew Lunn
2024-09-16 16:29     ` Maxime Chevallier
2024-09-16 16:03 ` Andrew Lunn
2024-09-16 17:34   ` Russell King (Oracle)
2024-09-17 15:53     ` Maxime Chevallier
2024-09-17 16:38       ` Russell King (Oracle)
2024-09-17 17:16         ` Daniel Golle

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).