This series introduces link_down_events counters to the ixgbe and ice drivers.
The counters are incremented each time the link transitions from up to down,
allowing better diagnosis of link stability issues such as port flapping or
unexpected link drops.

The counter increments only on actual physical link-down events visible
to the PHY. It does not increment when the user performs a software-only
interface down/up (e.g. ip link set dev down).
The counter does increment in cases where the interface is reinitialized
in a way that causes a real link drop — such as eg. when attaching
an XDP program, reconfiguring channels, or toggling certain priv-flags.

The values are exposed via ethtool using the get_link_ext_stats() interface.

Example output:
#ethtool --include-statistics <ethX>
Settings for <ethX>:
        [...]
        Link Down Events: 2

Martyna Szapar-Mudlaw (2):
  ice: add link_down_events statistic
  ixgbe: add link_down_events statistic

v4->v3:
only cover letter edits
v3 -> v2:
ixgbe patch: rebased on latest ixgbe changes; added statistic for E610
no changes to ice driver patch 
v2 -> v1:
used ethtool get_link_ext_stats() interface to expose counters

 drivers/net/ethernet/intel/ice/ice.h             |  1 +
 drivers/net/ethernet/intel/ice/ice_ethtool.c     | 10 ++++++++++
 drivers/net/ethernet/intel/ice/ice_main.c        |  3 +++
 drivers/net/ethernet/intel/ixgbe/ixgbe.h         |  1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |  9 +++++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c    |  2 ++
 6 files changed, 26 insertions(+)

-- 
2.47.0

Reply via email to