Netdev List
 help / color / mirror / Atom feed
* [PATCH net] ethtool: Set histogram ranges to NULL before querying FEC data
@ 2026-06-04 22:54 Eric Joyner
  0 siblings, 0 replies; only message in thread
From: Eric Joyner @ 2026-06-04 22:54 UTC (permalink / raw)
  To: netdev
  Cc: Brett Creeley, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Jacob Keller,
	Eric Joyner

If this field isn't set to NULL, then drivers that set the non-histogram
FEC statistics and don't support/modify the histogram fields will
trigger a WARN_ON() in fec_put_hist(). Drivers shouldn't be forced to
set this field to NULL if they don't have a need to touch FEC histogram
reporting, so set this field before the driver gets the data structure.

Fixes: cc2f08129925 ("ethtool: add FEC bins histogram report")
Signed-off-by: Eric Joyner <eric.joyner@amd.com>
---
 net/ethtool/fec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ethtool/fec.c b/net/ethtool/fec.c
index e2d539271060..640d7f264919 100644
--- a/net/ethtool/fec.c
+++ b/net/ethtool/fec.c
@@ -116,6 +116,7 @@ static int fec_prepare_data(const struct ethnl_req_info *req_base,
 		ethtool_stats_init((u64 *)&stats, sizeof(stats) / 8);
 		ethtool_stats_init((u64 *)data->fec_stat_hist.values,
 				   sizeof(data->fec_stat_hist.values) / 8);
+		data->fec_stat_hist.ranges = NULL;
 		dev->ethtool_ops->get_fec_stats(dev, &stats,
 						&data->fec_stat_hist);
 

base-commit: b6197b386677ae5268d4702e23849d9ad53051ad
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-04 22:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-04 22:54 [PATCH net] ethtool: Set histogram ranges to NULL before querying FEC data Eric Joyner

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