From: Eric Joyner <eric.joyner@amd.com>
To: <netdev@vger.kernel.org>
Cc: Brett Creeley <brett.creeley@amd.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Jacob Keller <jacob.e.keller@intel.com>,
Eric Joyner <eric.joyner@amd.com>
Subject: [PATCH net] ethtool: Set histogram ranges to NULL before querying FEC data
Date: Thu, 4 Jun 2026 15:54:40 -0700 [thread overview]
Message-ID: <20260604225440.11083-1-eric.joyner@amd.com> (raw)
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
next reply other threads:[~2026-06-04 22:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 22:54 Eric Joyner [this message]
2026-06-05 2:46 ` [PATCH net] ethtool: Set histogram ranges to NULL before querying FEC data Jakub Kicinski
2026-06-05 16:28 ` Eric Joyner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260604225440.11083-1-eric.joyner@amd.com \
--to=eric.joyner@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.