[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240624095331.351039-1-ihuguet@redhat.com>
Date: Mon, 24 Jun 2024 11:53:31 +0200
From: Íñigo Huguet <ihuguet@...hat.com>
To: jesse.brandeburg@...el.com,
anthony.l.nguyen@...el.com
Cc: davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
intel-wired-lan@...ts.osuosl.org,
netdev@...r.kernel.org,
Íñigo Huguet <ihuguet@...hat.com>
Subject: [PATCH net-next] net: igc: return error for link autoneg=off
The driver doesn't support force mode for the link settings. However, if
the user request it, it's just ignored and success is returned. Return
ENOTSUPP instead.
Signed-off-by: Íñigo Huguet <ihuguet@...hat.com>
---
drivers/net/ethernet/intel/igc/igc_ethtool.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index 93bce729be76..b7b32344d074 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -1832,6 +1832,12 @@ igc_ethtool_set_link_ksettings(struct net_device *netdev,
}
}
+ /* The driver does not support force mode yet */
+ if (cmd->base.autoneg == AUTONEG_DISABLE) {
+ netdev_err(dev, "Force mode currently not supported\n");
+ return -EOPNOTSUPP;
+ }
+
while (test_and_set_bit(__IGC_RESETTING, &adapter->state))
usleep_range(1000, 2000);
@@ -1844,14 +1850,10 @@ igc_ethtool_set_link_ksettings(struct net_device *netdev,
if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 2500baseT_Full))
advertising |= ADVERTISE_2500_FULL;
- if (cmd->base.autoneg == AUTONEG_ENABLE) {
- hw->mac.autoneg = 1;
- hw->phy.autoneg_advertised = advertising;
- if (adapter->fc_autoneg)
- hw->fc.requested_mode = igc_fc_default;
- } else {
- netdev_info(dev, "Force mode currently not supported\n");
- }
+ hw->mac.autoneg = 1;
+ hw->phy.autoneg_advertised = advertising;
+ if (adapter->fc_autoneg)
+ hw->fc.requested_mode = igc_fc_default;
/* MDI-X => 2; MDI => 1; Auto => 3 */
if (cmd->base.eth_tp_mdix_ctrl) {
--
2.44.0
Powered by blists - more mailing lists