๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Tue, 17 Nov 2026 23:10
Re: [PATCH net-next v4 5/6] ionic: report the operational FEC mode from ethtool --show-fec
#18168
Author: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 23:10
101 lines
11944 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The commit says old firmware "leaves the byte zero", so an
  autoneg link on that firmware reports FEC off.

--

ionic: report the operational FEC mode from ethtool --show-fec

On autoneg links, ionic_get_fecparam() now fills active_fec from
status.fec_type, the operational mode reported by firmware. Without
autoneg it keeps using config.fec_type. The commit message says firmware
that predates status.fec_type leaves that byte zero, so on such firmware
an autoneg link reports FEC off.

> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> index 8f0f1585116bc..ac728b8aa780e 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> @@ -440,6 +440,18 @@ static u32 ionic_fec_type_to_ethtool(u8 fec_type)
>  	}
>  }
>  
> +/* Firmware that predates status.fec_type leaves it zero, which reads as
> + * FEC off.  With autoneg disabled the port runs the configured mode, so
> + * only trust status.fec_type on an autoneg link.
> + */
> +static u8 ionic_active_fec_type(const struct ionic_port_info *port_info)
> +{
> +	if (READ_ONCE(port_info->config.an_enable))
> +		return READ_ONCE(port_info->status.fec_type);

[Severity: Medium]
Is status.fec_type actually guaranteed to be zero on older firmware once
the device has been through a firmware reset?

The commit message says:

    firmware older than that leaves the byte zero, which reads as FEC off.

The driver only zeroes that byte when it first allocates the port_info DMA
buffer. ionic_lif_handle_fw_up() calls ionic_port_init() again. That
function allocates only when idev->port_info is NULL, so after a reset it
reuses the old buffer:

drivers/net/ethernet/pensando/ionic/ionic_main.c:ionic_port_init() {
    ...
	if (!idev->port_info) {
		idev->port_info_sz = ALIGN(sizeof(*idev->port_info), PAGE_SIZE);
		idev->port_info = dma_alloc_coherent(ionic->dev,
    ...
	stat = (__le64 *)&idev->port_info->extra_stats;
	for (i = 0; i < sizeof(idev->port_info->extra_stats) / sizeof(*stat); i++)
		WRITE_ONCE(stat[i], IONIC_STAT_INVALID);
    ...
}

Before PORT_INIT, only extra_stats is reset, to cover fields the firmware
does not know about. Nothing clears status.fec_type. The buffer is freed
only by ionic_port_reset(), which runs from probe and remove.

Say a newer firmware has written IONIC_PORT_FEC_TYPE_RS into
status.fec_type. The device is then reset into firmware older than
c4e7a75a096c, for example by downgrading with devlink flash and
FW_CONTROL ACTIVATE, or by falling back to another image. In that case,
can ionic_get_fecparam() keep reporting the stale RS value as active_fec
on autoneg links until the driver is reloaded? That would hold even if the
link negotiated a different mode or no FEC.

This depends on the old firmware not writing the former reserved byte.
That hasn't been confirmed, but the extra_stats invalidation suggests
firmware writes only the fields it knows about.

Would it make sense to clear status.fec_type, or the whole status block,
in ionic_port_init() before PORT_INIT, the same way extra_stats is
handled?

The later commit "ionic: Add .get_fec_stats ethtool handler" also uses
ionic_active_fec_type(). That path is gated on IONIC_DEV_CAP_EXTRA_STATS,
so old firmware does not reach it, and the rest of the series does not
change this.

> +
> +	return READ_ONCE(port_info->config.fec_type);
> +}
> +

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-ionic-get-fec-stats-v4-0-d25cae9f1e87%40amd.com
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