* [PATCH net] ethtool: Set histogram ranges to NULL before querying FEC data
@ 2026-06-04 22:54 Eric Joyner
2026-06-05 2:46 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* Re: [PATCH net] ethtool: Set histogram ranges to NULL before querying FEC data
2026-06-04 22:54 [PATCH net] ethtool: Set histogram ranges to NULL before querying FEC data Eric Joyner
@ 2026-06-05 2:46 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2026-06-05 2:46 UTC (permalink / raw)
To: Eric Joyner
Cc: netdev, Brett Creeley, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Simon Horman, Jacob Keller
On Thu, 4 Jun 2026 15:54:40 -0700 Eric Joyner wrote:
> 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.
&data should be zero-initialized, how is this patch not a nop?
Are you sure this can trigger unless the driver is buggy and sets
ranges without reporting any values?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-05 2:46 UTC | newest]
Thread overview: 2+ messages (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
2026-06-05 2:46 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox