summaryrefslogtreecommitdiff
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-04-15 15:53:13 -0700
committerDavid S. Miller <davem@davemloft.net>2021-04-15 17:08:29 -0700
commitc5797f8a64158f724238d13fa5a4b351b03fe42d (patch)
tree6c7ff7fefedee180046d87610b919e7a85bbaa8e /include/linux/ethtool.h
parent38ebcf5096a86762b82262e96b2c8b170fe79040 (diff)
ethtool: move ethtool_stats_init
We'll need it for FEC stats as well. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 9f6f323af59a..069100b252bd 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -244,6 +244,12 @@ bool ethtool_convert_link_mode_to_legacy_u32(u32 *legacy_u32,
#define ETHTOOL_STAT_NOT_SET (~0ULL)
+static inline void ethtool_stats_init(u64 *stats, unsigned int n)
+{
+ while (n--)
+ stats[n] = ETHTOOL_STAT_NOT_SET;
+}
+
/**
* struct ethtool_pause_stats - statistics for IEEE 802.3x pause frames
* @tx_pause_frames: transmitted pause frame count. Reported to user space