Thread (2 messages) 2 messages, 2 authors, 23d ago

Re: [PATCH net-next] net: phylink: reject unsupported speed/duplex in ksettings_set() with PHY

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-07-07 15:52:19
Also in: lkml

On Mon, Jul 06, 2026 at 11:27:35PM -0700, muhammad.nazim.amirul.nazle.asmade@altera.com wrote:
From: Nazim Amirul <redacted>

When using ethtool to change speed and duplex on a phylink-managed
interface with a PHY attached, the requested speed/duplex combination
is not validated against the MAC's supported capabilities before being
passed down to the PHY layer.
How are you invoking ethtool here? And what other invocations have you
tested, with this patch in place?
quoted hunk ↗ jump to hunk
@@ -2989,6 +2989,10 @@ int phylink_ethtool_ksettings_set(struct phylink *pl,
 	if (pl->phydev) {
 		struct ethtool_link_ksettings phy_kset = *kset;
 
+		if (!phy_caps_lookup(kset->base.speed, kset->base.duplex,
+				     pl->supported, true))
+			return -EINVAL;
Are base.speed and base.duplex always set? When looking at
phy_ethtool_ksettings_set() the values are only used when base.autoneg
is false. So maybe they are not always valid?

   Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help