[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250912202201.3957338-1-alok.a.tiwari@oracle.com>
Date: Fri, 12 Sep 2025 13:21:59 -0700
From: Alok Tiwari <alok.a.tiwari@...cle.com>
To: shayagr@...zon.com, akiyano@...zon.com, saeedb@...zon.com,
darinzon@...zon.com, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
horms@...nel.org, netdev@...r.kernel.org
Cc: alok.a.tiwari@...cle.com
Subject: [PATCH v2 net] net: ena: fix duplicate Autoneg setting in get_link_ksettings
The ENA ethtool implementation is setting Autoneg twice in the
'supported' bitfield, leaving 'advertising' unset.
ENA devices always support Autoneg, so 'supported' should always have
the bit set unconditionally. 'advertising' should only be set when
ENA_ADMIN_GET_FEATURE_LINK_DESC_AUTONEG_MASK is present, since that
reflects runtime enablement.
Fix by unconditionally setting Autoneg in 'supported' and moving the
conditional flag check to 'advertising'
Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Alok Tiwari <alok.a.tiwari@...cle.com>
---
v1 -> v2
set autoneg unconditionally in 'supported' and
move advertising under AUTONEG_MASK check, as
discussed with Andrew
https://lore.kernel.org/all/20250911113727.3857978-1-alok.a.tiwari@oracle.com/
---
drivers/net/ethernet/amazon/ena/ena_ethtool.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_ethtool.c b/drivers/net/ethernet/amazon/ena/ena_ethtool.c
index a81d3a7a3bb9..10405949cea2 100644
--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c
+++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c
@@ -467,12 +467,13 @@ static int ena_get_link_ksettings(struct net_device *netdev,
link = &feat_resp.u.link;
link_ksettings->base.speed = link->speed;
- if (link->flags & ENA_ADMIN_GET_FEATURE_LINK_DESC_AUTONEG_MASK) {
- ethtool_link_ksettings_add_link_mode(link_ksettings,
- supported, Autoneg);
+ /* Autoneg is always supported */
+ ethtool_link_ksettings_add_link_mode(link_ksettings,
+ supported, Autoneg);
+
+ if (link->flags & ENA_ADMIN_GET_FEATURE_LINK_DESC_AUTONEG_MASK)
ethtool_link_ksettings_add_link_mode(link_ksettings,
- supported, Autoneg);
- }
+ advertising, Autoneg);
link_ksettings->base.autoneg =
(link->flags & ENA_ADMIN_GET_FEATURE_LINK_DESC_AUTONEG_MASK) ?
--
2.50.1
Powered by blists - more mailing lists