Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/5] ionic: FEC reporting fixes and .get_fec_stats handler
@ 2026-11-04 21:19 Eric Joyner
  2026-11-04 21:19 ` [PATCH net-next v3 1/5] ionic: write the extra_stats invalid markers one counter at a time Eric Joyner
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Eric Joyner @ 2026-11-04 21:19 UTC (permalink / raw)
  To: netdev
  Cc: Brett Creeley, Andrew Lunn, David S. Miller, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Vadim Fedorenko, Nikhil P. Rao,
	Eric Joyner, Eric Dumazet

Add a .get_fec_stats ethtool handler, and fix the FEC reporting it
depends on.

Patch 1 writes the IONIC_STAT_INVALID markers in extra_stats one
counter at a time, so a reader that tests a single counter cannot see a
torn value.

Patches 2-4 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. Patch 2 has a Fixes: tag, but patches 3 and 4 rework the lines it
changes, so it is sent to net-next with them rather than to net. The
bug only affects what ethtool reports.

Patch 5 adds the handler. It reports statistics only while the
operational 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").

Claude was used while developing this series: to investigate the v2
review questions, and to help write the code changes and commit
messages. The authors reviewed every change. The series was tested on
Pollara and Vulcano NICs.

Signed-off-by: Eric Joyner <eric.joyner@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 (1):
      ionic: Add .get_fec_stats ethtool handler

Nikhil P. Rao (4):
      ionic: write the extra_stats invalid markers one counter 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    | 116 ++++++++++++++++++---
 drivers/net/ethernet/pensando/ionic/ionic_main.c   |   8 +-
 drivers/net/ethernet/pensando/ionic/ionic_stats.h  |   2 +
 3 files changed, 112 insertions(+), 14 deletions(-)
---
base-commit: 7b6ab4dbc156e2f96419715130b3d5738a306c93
change-id: 20260814-ionic-get-fec-stats-990736964908

Best regards,
-- 
Eric Joyner <eric.joyner@amd.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-10 21:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04 21:19 [PATCH net-next v3 0/5] ionic: FEC reporting fixes and .get_fec_stats handler Eric Joyner
2026-11-04 21:19 ` [PATCH net-next v3 1/5] ionic: write the extra_stats invalid markers one counter at a time Eric Joyner
2026-11-04 21:19 ` [PATCH net-next v3 2/5] ionic: report the configured FEC mode in ethtool_fecparam.fec Eric Joyner
2026-11-10 21:26   ` Jakub Kicinski
2026-11-04 21:19 ` [PATCH net-next v3 3/5] ionic: map the FEC type through a helper in ionic_get_fecparam() Eric Joyner
2026-11-04 21:19 ` [PATCH net-next v3 4/5] ionic: report the operational FEC mode from ethtool --show-fec Eric Joyner
2026-11-10 21:26   ` Jakub Kicinski
2026-11-04 21:19 ` [PATCH net-next v3 5/5] ionic: Add .get_fec_stats ethtool handler Eric Joyner
2026-11-09 19:35 ` [PATCH net-next v3 0/5] ionic: FEC reporting fixes and .get_fec_stats handler Eric Joyner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox