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 v5 5/6] ionic: report the operational FEC mode from ethtool --show-fec
Date: Mon, 23 Nov 2026 04:25:54 +0000 [thread overview]
Message-ID: <179540795477.3135.12412117957020578861@kernel.org> (raw)
In-Reply-To: <20261118-ionic-get-fec-stats-v5-5-c9c0ee63df4c@amd.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] ionic_active_fec_type()
(drivers/net/ethernet/pensando/ionic/ionic_ethtool.c) returns…
--
ionic: report the operational FEC mode from ethtool --show-fec
This patch changes ionic_get_fecparam() so that, on an autoneg link,
active_fec is taken from status.fec_type (the mode firmware reports as
operational) and not from config.fec_type. With autoneg disabled it
still reports config.fec_type. The commit message expects firmware older
than c4e7a75a096c to leave status.fec_type zero, so that it reads as
FEC off.
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
> index c55148f3ae8fa..d406d090d0eb7 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: Low]
Is status.fec_type always zero on firmware that predates it? That seems
to hold only right after port_info is first allocated, because
dma_alloc_coherent() returns zeroed memory.
ionic_port_init() allocates port_info only when it is NULL. After that
the same buffer is reused:
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);
...
}
The firmware reset recovery path runs port init again on that buffer:
ionic_lif_handle_fw_up()
ionic_port_identify()
ionic_port_init()
The extra_stats reset above guards against firmware that does not know
about newer fields. It does not clear status.fec_type, though.
Suppose firmware that fills status.fec_type (with RS, for example) is
running. A firmware reset then brings the device back on firmware older
than c4e7a75a096c, which treats that byte as reserved. Wouldn't
ethtool --show-fec on an autoneg link then report the stale RS value as
the active mode, even though the running firmware never reported it?
The later patch "ionic: Add .get_fec_stats ethtool handler" also uses
ionic_active_fec_type(). There it decides whether to report RS-FEC
stats, but it also requires IONIC_DEV_CAP_EXTRA_STATS. Nothing later in
the series clears status.fec_type.
Could ionic_port_init() zero status.fec_type before issuing PORT_INIT,
the same way extra_stats is reset?
> +
> + return READ_ONCE(port_info->config.fec_type);
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118-ionic-get-fec-stats-v5-0-c9c0ee63df4c%40amd.com
next prev parent reply other threads:[~2026-11-23 4:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 2:56 [PATCH net-next v5 0/6] ionic: FEC reporting fixes and .get_fec_stats handler Eric Joyner
2026-11-19 2:56 ` [PATCH net-next v5 1/6] ionic: write the extra_stats invalid markers one counter at a time Eric Joyner
2026-11-23 4:25 ` netdev-bot+sashiko
2026-11-19 2:56 ` [PATCH net-next v5 2/6] ionic: report FEC off as a supported link mode Eric Joyner
2026-11-19 2:56 ` [PATCH net-next v5 3/6] ionic: report the configured FEC mode in ethtool_fecparam.fec Eric Joyner
2026-11-19 2:56 ` [PATCH net-next v5 4/6] ionic: map the FEC type through a helper in ionic_get_fecparam() Eric Joyner
2026-11-23 4:25 ` netdev-bot+sashiko
2026-11-19 2:56 ` [PATCH net-next v5 5/6] ionic: report the operational FEC mode from ethtool --show-fec Eric Joyner
2026-11-23 4:25 ` netdev-bot+sashiko [this message]
2026-11-19 2:56 ` [PATCH net-next v5 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=179540795477.3135.12412117957020578861@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