From: netdev-bot+sashiko@kernel.org
To: eric.joyner@amd.com
Cc: netdev@vger.kernel.org, brett.creeley@amd.com,
andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, vadim.fedorenko@linux.dev,
nikhil.rao@amd.com, edumazet@kernel.org
Subject: Re: [PATCH net-next v4 5/6] ionic: report the operational FEC mode from ethtool --show-fec
Date: Tue, 17 Nov 2026 23:10:29 +0000 [thread overview]
Message-ID: <179495702938.3136.7315548716381258707@kernel.org> (raw)
In-Reply-To: <20261116-ionic-get-fec-stats-v4-5-d25cae9f1e87@amd.com>
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
next prev parent reply other threads:[~2026-11-17 23:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 23:06 [PATCH net-next v4 0/6] ionic: FEC reporting fixes and .get_fec_stats handler Eric Joyner
2026-11-16 23:06 ` [PATCH net-next v4 1/6] ionic: write the extra_stats invalid markers one counter at a time Eric Joyner
2026-11-16 23:06 ` [PATCH net-next v4 2/6] ionic: report FEC off as a supported link mode Eric Joyner
2026-11-17 23:10 ` netdev-bot+sashiko
2026-11-16 23:06 ` [PATCH net-next v4 3/6] ionic: report the configured FEC mode in ethtool_fecparam.fec Eric Joyner
2026-11-16 23:06 ` [PATCH net-next v4 4/6] ionic: map the FEC type through a helper in ionic_get_fecparam() Eric Joyner
2026-11-17 23:10 ` netdev-bot+sashiko
2026-11-16 23:06 ` [PATCH net-next v4 5/6] ionic: report the operational FEC mode from ethtool --show-fec Eric Joyner
2026-11-17 23:10 ` netdev-bot+sashiko [this message]
2026-11-16 23:06 ` [PATCH net-next v4 6/6] ionic: Add .get_fec_stats ethtool handler Eric Joyner
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=179495702938.3136.7315548716381258707@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--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=netdev@vger.kernel.org \
--cc=nikhil.rao@amd.com \
--cc=pabeni@redhat.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