From: "Creeley, Brett" <bcreeley@amd.com>
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>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
"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 0/6] ionic: FEC reporting fixes and .get_fec_stats handler
Date: Tue, 1 Dec 2026 08:01:20 -0800 [thread overview]
Message-ID: <69dac0ef-63ec-492c-8b5a-781b4bc0c4e7@amd.com> (raw)
In-Reply-To: <20261125-ionic-get-fec-stats-v6-0-1ab49c729c00@amd.com>
On 11/25/2026 3:22 PM, Brett Creeley wrote:
> Add a .get_fec_stats ethtool handler, and fix the FEC reporting it
> depends on.
>
> Patch 1 makes the driver write the IONIC_STAT_INVALID markers in
> extra_stats, and take the ethtool -S snapshot of that block, one
> counter at a time, so a reader that tests a single counter cannot see a
> torn value.
>
> Patch 2 adds FEC off to the supported and advertised link modes.
> Firmware does not report which FEC modes a port supports, so the
> supported list holds every mode an ionic device can use, and firmware
> rejects a request for a mode the port cannot run.
>
> Patches 3-5 fix ionic_get_fecparam(). fec->fec reported the constant
> set of supported modes instead of the configured mode, and
> fec->active_fec reported the requested mode instead of the operational
> one. Patches 2, 3 and 5 have Fixes: tags, but the later patches build on
> the lines they change, so they are sent to net-next with them rather
> than to net. The bugs only affect what ethtool reports.
>
> Patch 6 adds the handler. It reports statistics only while the active
> FEC mode is RS.
>
> The netdev AI review of v2, which Simon forwarded, asked whether the
> per-bin local really guarantees a single read of each counter. It does
> not, so v3 reads every counter with READ_ONCE() and drops the struct
> copy. The port_info lifetime problem that the AI review raised on v1
> and v2 is fixed in net-next by commit d90d1a768b3b ("ionic: fix
> port_info use-after-free on firmware recovery"). The netdev AI review
> of v3, which Jakub forwarded, found that FEC off was not listed as a
> supported link mode, which the new patch 2 fixes, and that patch 5 made
> old firmware report forced-FEC links as FEC off, which v4 also fixes.
>
> The netdev AI review of v5 asked whether status.fec_type can keep a
> stale value after a firmware reset brings up firmware that predates the
> field. It cannot: firmware copies the whole port status block to the
> host, reserved bytes included, at LIF init and on every link event, and
> firmware that predates the field leaves those bytes zero.
>
> Claude was used while developing this series, to investigate the
> review questions and to help write the code changes and commit
> messages. The series was tested on AMD Pensando NICs: ethtool --show-fec
> with and without statistics, the FEC link modes, and ethtool -S, before
> and after PCI resets run while those queries were looping.
>
> ---
> Changes in v6:
> - rebase on net-next
> - patch 1:
> - take the ethtool -S snapshot of extra_stats one counter at a time
> with READ_ONCE() too, and retitle the patch (netdev AI review of v5)
> - patch 2:
> - read config.fec_type once in ionic_get_link_ksettings()
> - drop the comment that repeated the commit message
> - describe the devices generically in the commit message
> - patch 4:
> - read config.fec_type once in ionic_get_fecparam() (netdev AI review
> of v5)
> - patch 5:
> - drop the comment that repeated the commit message
> - patches 5 and 6:
> - pass the configured FEC type to ionic_active_fec_type() so that it
> is read once (netdev AI review of v5)
> - Link to v5: https://patch.msgid.link/20261118-ionic-get-fec-stats-v5-0-c9c0ee63df4c@amd.com
>
> Changes in v5:
> - Patch 2: say that firmware leaves the supported FEC types in the port
> identity unset (netdev AI review of v4).
> - Link to v4: https://lore.kernel.org/r/20261116-ionic-get-fec-stats-v4-0-d25cae9f1e87@amd.com
>
> Changes in v4:
> - Add patch 2, which reports FEC off as a supported link mode (netdev
> AI review of v3).
> - Patch 5: with autoneg off, report the configured FEC mode as active,
> so firmware that predates status.fec_type no longer reports forced-FEC
> links as FEC off, and add a Fixes: tag (netdev AI review of v3).
> - Patch 6: gate the statistics on the same active FEC mode as patch 5.
> - Patch 6: explain why an RS check is enough for the histogram (netdev
> AI review of v3).
> - Rebase onto current net-next.
> - Link to v3: https://lore.kernel.org/r/20261104-ionic-get-fec-stats-v3-0-b261fd53d0a7@amd.com
>
> Changes in v3:
> - Read each counter with READ_ONCE() and drop the struct copy of
> extra_stats (netdev AI review of v2).
> - Report statistics based on status.fec_type, the operational FEC mode,
> instead of config.fec_type, matching the active FEC mode that patch 4
> reports.
> - Add patches 1-4, which fix the FEC reporting the handler depends on.
> Patches 1-4 are by Nikhil, who is also a Co-developed-by on patch 5.
> - Drop Vadim's Reviewed-by from v1, since the code has changed.
> - Rebase onto current net-next.
> - Link to v2: https://lore.kernel.org/r/20260814-ionic-get-fec-stats-v2-1-13f0e7d2e702@amd.com
>
> Changes in v2:
> - Latch each histogram bin into a local before testing it against
> IONIC_STAT_INVALID, so the sentinel check and the store cannot be
> folded into two separate reads of the firmware-updated DMA buffer.
> - Explain in the commit message why the RS FEC check gates every
> reported counter rather than just the histogram: they all come from
> the RS decoder, including fec_corrected_bits_total despite its name.
> - Rebased onto current net-next.
> - Link to v1: https://lore.kernel.org/r/20260731214021.15279-1-eric.joyner@amd.com
>
> ---
> Eric Joyner (2):
> ionic: report FEC off as a supported link mode
> ionic: Add .get_fec_stats ethtool handler
>
> Nikhil P. Rao (4):
> ionic: access the extra_stats counters one at a time
> ionic: report the configured FEC mode in ethtool_fecparam.fec
> ionic: map the FEC type through a helper in ionic_get_fecparam()
> ionic: report the operational FEC mode from ethtool --show-fec
>
> .../net/ethernet/pensando/ionic/ionic_ethtool.c | 139 ++++++++++++++++++---
> drivers/net/ethernet/pensando/ionic/ionic_main.c | 8 +-
> drivers/net/ethernet/pensando/ionic/ionic_stats.c | 8 +-
> drivers/net/ethernet/pensando/ionic/ionic_stats.h | 2 +
> 4 files changed, 140 insertions(+), 17 deletions(-)
> ---
> base-commit: e20f88c4f08bc9dba09c48ddc9806015f79fb20b
> change-id: 20260814-ionic-get-fec-stats-990736964908
>
> Best regards,
> --
> Brett Creeley <brett.creeley@amd.com>
pw-bot: cr
>
prev parent reply other threads:[~2026-12-01 16:01 UTC|newest]
Thread overview: 18+ 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-30 16:46 ` Creeley, Brett
2026-12-01 6:47 ` Eric Joyner
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
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
2026-12-01 16:01 ` Creeley, Brett [this message]
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=69dac0ef-63ec-492c-8b5a-781b4bc0c4e7@amd.com \
--to=bcreeley@amd.com \
--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 \
--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