🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Vadim Fedorenko Sat, 28 Nov 2026 13:27
Re: [PATCH net-next v6 5/6] ionic: report the operational FEC mode from ethtool --show-fec
#23874
Author: Vadim Fedorenko
Date: Sat, 28 Nov 2026 13:27
63 lines
11007 bytes
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>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads