mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] octeontx2-pf: Fix autoneg reporting in ethtool
@ 2026-09-03 16:11 nshettyj
  2026-09-09  4:13 ` netdev-bot+sashiko
  2026-09-10  8:34 ` Paolo Abeni
  0 siblings, 2 replies; 3+ messages in thread
From: nshettyj @ 2026-09-03 16:11 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: Hariprasad Kelam, Nitin Shetty J, Sunil Goutham, Geetha sowjanya,
	Ratheesh Kannoth, Subbaraya Sundeep, Bharat Bhushan, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Christina Jacob, Jesse Brandeburg

From: Hariprasad Kelam <hkelam@marvell.com>

The driver adds the supported autoneg bit before copying the supported
link modes. The copy clears the bit, so ethtool does not report
supported autoneg correctly.

Add the supported autoneg bit after copying the supported link modes.
Also add the advertised autoneg bit when firmware reports it.

Fixes: 1a50280c25ec ("octeontx2-pf: ethtool physical link status")
Signed-off-by: Nitin Shetty J <nshettyj@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
---
 .../ethernet/marvell/octeontx2/nic/otx2_ethtool.c  | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
index 9bee1b91eeaa..612fefc41a17 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
@@ -1218,19 +1218,23 @@ static int otx2_get_link_ksettings(struct net_device *netdev,
 	if (IS_ERR(rsp))
 		return PTR_ERR(rsp);
 
-	if (rsp->fwdata.supported_an)
-		ethtool_link_ksettings_add_link_mode(cmd,
-						     supported,
-						     Autoneg);
-
 	otx2_get_link_mode_info(rsp->fwdata.advertised_link_modes,
 				OTX2_MODE_ADVERTISED, cmd);
 	otx2_get_fec_info(rsp->fwdata.advertised_fec,
 			  OTX2_MODE_ADVERTISED, cmd);
+	if (rsp->fwdata.advertised_an)
+		ethtool_link_ksettings_add_link_mode(cmd,
+						     advertising,
+						     Autoneg);
+
 	otx2_get_link_mode_info(rsp->fwdata.supported_link_modes,
 				OTX2_MODE_SUPPORTED, cmd);
 	otx2_get_fec_info(rsp->fwdata.supported_fec,
 			  OTX2_MODE_SUPPORTED, cmd);
+	if (rsp->fwdata.supported_an)
+		ethtool_link_ksettings_add_link_mode(cmd,
+						     supported,
+						     Autoneg);
 	return 0;
 }
 
-- 
2.48.1


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

end of thread, other threads:[~2026-09-10  8:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03 16:11 [PATCH net] octeontx2-pf: Fix autoneg reporting in ethtool nshettyj
2026-09-09  4:13 ` netdev-bot+sashiko
2026-09-10  8:34 ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®