Skip to contentSkip to conversation

sfc: Fix reading non-legacy supported link modes

PATCH New Erik Ekman 2 participants 3 messages Nov 3, 2021 – Nov 4, 2021

Subsystems (3)
lore
Share & tools
lore

Erik Ekman

author
#0 lore raw

PATCH 1/1 sfc: Fix reading non-legacy supported link modes

Here is the backported patch for v5.4 and v4.19.

Cheers

author
#1 lore raw

PATCH 1/1 sfc: Fix reading non-legacy supported link modes

commit 041c61488236a5a84789083e3d9f0a51139b6edf upstream, with filename updated in backport to v5.4 and older.

Everything except the first 32 bits was lost when the pause flags were added. This makes the 50000baseCR2 mode flag (bit 34) not appear.

I have tested this with a 10G card (SFN5122F-R7) by modifying it to return a non-legacy link mode (10000baseCR).

---
 drivers/net/ethernet/sfc/ethtool.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/net/ethernet/sfc/ethtool.c +2 -8
index 86b965875540..d53e945dd08f 100644
@@ -128,20 +128,14 @@ efx_ethtool_get_link_ksettings(struct net_device *net_dev,
 {
 	struct efx_nic *efx = netdev_priv(net_dev);
 	struct efx_link_state *link_state = &efx->link_state;
-	u32 supported;
 
 	mutex_lock(&efx->mac_lock);
 	efx->phy_op->get_link_ksettings(efx, cmd);
 	mutex_unlock(&efx->mac_lock);
 
 	/* Both MACs support pause frames (bidirectional and respond-only) */
-	ethtool_convert_link_mode_to_legacy_u32(&supported,
-						cmd->link_modes.supported);
-
-	supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
-
-	ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
-						supported);
+	ethtool_link_ksettings_add_link_mode(cmd, supported, Pause);
+	ethtool_link_ksettings_add_link_mode(cmd, supported, Asym_Pause);
 
 	if (LOOPBACK_INTERNAL(efx)) {
 		cmd->base.speed = link_state->speed;
Signature · 1 line
2.33.1
maintainer
#2 lore raw
Quoted 2 lines · Erik Ekman

commit 041c61488236a5a84789083e3d9f0a51139b6edf upstream, with filename updated in backport to v5.4 and older.

Thank you, now queued up.

greg k-h