Netdev List
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
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>,
	"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: Re: [PATCH net-next v6 5/6] ionic: report the operational FEC mode from ethtool --show-fec
Date: Sat, 28 Nov 2026 13:27:03 +0000	[thread overview]
Message-ID: <be432c81-2337-444f-94bd-bf7f9660f181@linux.dev> (raw)
In-Reply-To: <20261125-ionic-get-fec-stats-v6-5-1ab49c729c00@amd.com>

On 25/11/2026 23:22, Brett Creeley wrote:
> From: "Nikhil P. Rao" <nikhil.rao@amd.com>
> 
> ionic_get_fecparam() fills fec->active_fec from config.fec_type, the mode
> the host requested, which on an autoneg link is whatever was last
> programmed while the link negotiates something else.  On an autoneg
> link, read it from status.fec_type, where firmware reports the
> operational mode.
> 
> status.fec_type was carved out of the reserved area by commit
> c4e7a75a096c ("ionic: updates to ionic FW api description"), and
> firmware older than that leaves the byte zero, which reads as FEC off.
> With autoneg disabled the port runs the configured mode, so keep
> reporting config.fec_type there; only autoneg links on such old
> firmware report FEC off.
> 
> Fixes: e95f922f4c2f ("ionic: implement ethtool set-fec")
> Signed-off-by: Nikhil P. Rao <nikhil.rao@amd.com>
> 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 | 15 +++++++++++++--
>   1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> index 312cd3e5e404..3b6c436104d1 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> @@ -438,18 +438,29 @@ static u32 ionic_fec_type_to_ethtool(u8 fec_type)
>   	}
>   }
>   
> +static u8 ionic_active_fec_type(const struct ionic_port_info *port_info,
> +				u8 config_fec_type)
> +{
> +	if (READ_ONCE(port_info->config.an_enable))
> +		return READ_ONCE(port_info->status.fec_type);
> +
> +	return config_fec_type;
> +}
> +
>   static int ionic_get_fecparam(struct net_device *netdev,
>   			      struct ethtool_fecparam *fec)
>   {
>   	struct ionic_port_info *port_info;
>   	struct ionic_lif *lif;
>   	u8 config_fec_type;
> +	u8 active_fec_type;
>   
>   	lif = netdev_priv(netdev);
>   	port_info = lif->ionic->idev.port_info;
> -	config_fec_type = port_info->config.fec_type;
> +	config_fec_type = READ_ONCE(port_info->config.fec_type);
> +	active_fec_type = ionic_active_fec_type(port_info, config_fec_type);
>   
> -	fec->active_fec = ionic_fec_type_to_ethtool(config_fec_type);
> +	fec->active_fec = ionic_fec_type_to_ethtool(active_fec_type);
>   	fec->fec = ionic_fec_type_to_ethtool(config_fec_type);
>   
>   	return 0;
> 
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

  reply	other threads:[~2026-11-28 13:27 UTC|newest]

Thread overview: 15+ 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-28 13:21   ` Vadim Fedorenko
2026-11-25 23:22 ` [PATCH net-next v6 2/6] ionic: report FEC off as a supported link mode Brett Creeley
2026-11-28 13:22   ` Vadim Fedorenko
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-28 13:23   ` Vadim Fedorenko
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-28 13:26   ` Vadim Fedorenko
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-28 13:27   ` Vadim Fedorenko [this message]
2026-11-25 23:22 ` [PATCH net-next v6 6/6] ionic: Add .get_fec_stats ethtool handler Brett Creeley
2026-11-28 10:06   ` Vadim Fedorenko

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=be432c81-2337-444f-94bd-bf7f9660f181@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=ArunKumar.Prakash@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=brett.creeley@amd.com \
    --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 \
    /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