|
|
Log in / Subscribe / Register

ionic: Expose more port stats to ethtool

From:  Eric Joyner <eric.joyner-AT-amd.com>
To:  <netdev-AT-vger.kernel.org>
Subject:  [PATCH net-next v4 0/5] ionic: Expose more port stats to ethtool
Date:  Tue, 09 Jun 2026 23:18:25 -0700
Message-ID:  <20260610061830.51037-1-eric.joyner@amd.com>
Cc:  Brett Creeley <brett.creeley-AT-amd.com>, Andrew Lunn <andrew+netdev-AT-lunn.ch>, "David S. Miller" <davem-AT-davemloft.net>, "Eric Dumazet" <edumazet-AT-google.com>, Jakub Kicinski <kuba-AT-kernel.org>, Paolo Abeni <pabeni-AT-redhat.com>, Jacob Keller <jacob.e.keller-AT-intel.com>, Eric Joyner <eric.joyner-AT-amd.com>
Archive-link:  Article

The primary aim of this patchset is to support the reporting of new port
statistics (and one old one) that firmware sends to the driver; these
include general FEC codeword stats and the FEC histogram. A scheme for
these extra stats is introduced in order to prevent devices that don't
support these new statistics from unconditionally setting them or
reporting them in ethtool.

---
v4:
- A big addition is a new scheme where the driver will only report the
  new statistics supported by firmware if the firmware sets the statistic
  value to something that isn't invalid; more details in patch 3, and this
  is used in patch 5 to prevent FEC stats from being unconditionally
  reported on devices/firmware versions that don't support these stats.
- The link_down_count from firmware mentioned in v2 was moved back to an
  entry in the general ethtool statistics; the existing driver-calculated
  value for the ethtool ext link is more appropriate due to the firmware
  value being a small size and not resetting between driver loads.
- Add netdev_err_once() call recommended by Sashiko for ethtool handler
- Drop devcmd retry logic patch from previous versions for now;
  explicitly include Brett's patch from another patchset to fix the
  ionic_get_link_ext_stats() PF/VF check

v3:
Address issues mostly found by Sashiko:
- Fix potential return of uninitialized variable in __ionic_dev_cmd_wait()
- Fix bounds of wait in __ionic_dev_cmd_wait() to prevent function from
  giving up prematurely now that the wait period has changed
- Add NULL check to ionic_get_link_ext_stats(), following the example set by
  ionic_get_link_ksettings()
- Add missing le16_to_cpu() when copying link_down_count from firmware

v2:
- Add missing cpu_to_le64() to FEC histogram stat assignment
- Remove unused pb_stats field that's replaced by the new FEC/extra stats
- Replace ethtool ext link stat with firmware stat instead of adding
  the firmware stat to general ethtool statistics; remove old driver
  calculated stat
- Add explanation for what EAGAIN return value could be used for in
  commit message

Brett Creeley (1):
  ionic: Fix check in ionic_get_link_ext_stats

Eric Joyner (4):
  ionic: Update ionic_if.h with new extra port stats
  ionic: Report "rx_bits_phy" stat to ethtool
  ionic: Report "link_down_events_phy" in ethtool statistics
  ionic: Add .get_fec_stats ethtool handler

 .../net/ethernet/pensando/ionic/ionic_dev.h   |  1 +
 .../ethernet/pensando/ionic/ionic_ethtool.c   | 83 ++++++++++++++++++-
 .../net/ethernet/pensando/ionic/ionic_if.h    | 39 +++------
 .../net/ethernet/pensando/ionic/ionic_main.c  |  6 ++
 .../net/ethernet/pensando/ionic/ionic_stats.c | 64 +++++++++++++-
 5 files changed, 164 insertions(+), 29 deletions(-)


base-commit: 93790c374b9d77f3db15786d7d432872d92751cf
-- 
2.17.1




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds