Netdev List
 help / color / mirror / Atom feed
From: Brett Creeley <brett.creeley@amd.com>
To: Brett Creeley <brett.creeley@amd.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Shannon Nelson <sln@onemain.com>
Cc: <netdev@vger.kernel.org>, Simon Horman <horms@kernel.org>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	"Nikhil P. Rao" <nikhil.rao@amd.com>,
	"Eric Joyner" <eric.joyner@amd.com>,
	Breno Leitao <leitao@debian.org>,
	"Arun Kumar Prakash" <ArunKumar.Prakash@amd.com>
Subject: [PATCH net-next v6 2/6] ionic: report FEC off as a supported link mode
Date: Wed, 25 Nov 2026 15:22:23 -0800	[thread overview]
Message-ID: <20261125-ionic-get-fec-stats-v6-2-1ab49c729c00@amd.com> (raw)
In-Reply-To: <20261125-ionic-get-fec-stats-v6-0-1ab49c729c00@amd.com>

From: Eric Joyner <eric.joyner@amd.com>

ionic_get_link_ksettings() lists BaseR and RS as supported FEC modes but
never lists FEC off, although ionic_set_fecparam() accepts it.  Add
FEC_NONE to the supported modes, and to the advertised modes when the
port is configured with FEC off.  Read config.fec_type once for that
chain: firmware updates it by DMA, and with a read per comparison a
change between them could leave no FEC mode advertised.

Firmware does not report which FEC modes a port supports: the port
identity has a field for them, but firmware leaves it unset.  So the
list holds every mode an ionic device can use, and firmware rejects a
request for a mode the port cannot run.  BaseR and RS are already
listed on every port this way.  Off follows the same rule: some
devices' firmware rejects it, others accept it.

Fixes: 4d03e00a2140 ("ionic: Add initial ethtool support")
Signed-off-by: Eric Joyner <eric.joyner@amd.com>
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
---
 drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
index 29b9a8502b8e..16c6e4c9852e 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
@@ -149,6 +149,7 @@ static int ionic_get_link_ksettings(struct net_device *netdev,
 	struct ionic_lif *lif = netdev_priv(netdev);
 	struct ionic_dev *idev = &lif->ionic->idev;
 	int copper_seen = 0;
+	u8 fec_type;
 
 	ethtool_link_ksettings_zero_link_mode(ks, supported);
 
@@ -298,11 +299,15 @@ static int ionic_get_link_ksettings(struct net_device *netdev,
 
 	linkmode_copy(ks->link_modes.advertising, ks->link_modes.supported);
 
+	ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE);
 	ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER);
 	ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);
-	if (idev->port_info->config.fec_type == IONIC_PORT_FEC_TYPE_FC)
+	fec_type = READ_ONCE(idev->port_info->config.fec_type);
+	if (fec_type == IONIC_PORT_FEC_TYPE_NONE)
+		ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE);
+	else if (fec_type == IONIC_PORT_FEC_TYPE_FC)
 		ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_BASER);
-	else if (idev->port_info->config.fec_type == IONIC_PORT_FEC_TYPE_RS)
+	else if (fec_type == IONIC_PORT_FEC_TYPE_RS)
 		ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);
 
 	ethtool_link_ksettings_add_link_mode(ks, supported, FIBRE);

-- 
2.43.0


  parent reply	other threads:[~2026-11-25 23:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 23:22 [PATCH net-next v6 0/6] ionic: FEC reporting fixes and .get_fec_stats handler Brett Creeley
2026-11-25 23:22 ` [PATCH net-next v6 1/6] ionic: access the extra_stats counters one at a time Brett Creeley
2026-11-26 23:24   ` netdev-bot+sashiko
2026-11-25 23:22 ` Brett Creeley [this message]
2026-11-25 23:22 ` [PATCH net-next v6 3/6] ionic: report the configured FEC mode in ethtool_fecparam.fec Brett Creeley
2026-11-26 23:24   ` netdev-bot+sashiko
2026-11-25 23:22 ` [PATCH net-next v6 4/6] ionic: map the FEC type through a helper in ionic_get_fecparam() Brett Creeley
2026-11-25 23:22 ` [PATCH net-next v6 5/6] ionic: report the operational FEC mode from ethtool --show-fec Brett Creeley
2026-11-25 23:22 ` [PATCH net-next v6 6/6] ionic: Add .get_fec_stats ethtool handler Brett Creeley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261125-ionic-get-fec-stats-v6-2-1ab49c729c00@amd.com \
    --to=brett.creeley@amd.com \
    --cc=ArunKumar.Prakash@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=eric.joyner@amd.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikhil.rao@amd.com \
    --cc=pabeni@redhat.com \
    --cc=sln@onemain.com \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox