From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
Michael Chan <michael.chan@broadcom.com>,
Pavan Chebbi <pavan.chebbi@broadcom.com>,
Tariq Toukan <tariqt@nvidia.com>, Gal Pressman <gal@nvidia.com>,
intel-wired-lan@lists.osuosl.org,
Donald Hunter <donald.hunter@gmail.com>,
Carolina Jubran <cjubran@nvidia.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>
Cc: Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org
Subject: [Intel-wired-lan] [PATCH net-next v5 0/5] add FEC bins histogram report via ethtool
Date: Mon, 22 Sep 2025 10:07:36 +0000 [thread overview]
Message-ID: <20250922100741.2167024-1-vadim.fedorenko@linux.dev> (raw)
IEEE 802.3ck-2022 defines counters for FEC bins and 802.3df-2024
clarifies it a bit further. Implement reporting interface through as
addition to FEC stats available in ethtool. NetDevSim driver has simple
implementation as an example while mlx5 has much more complex solution.
The example query is the same as usual FEC statistics while the answer
is a bit more verbose:
[vmuser@archvm9 linux]$ ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/ethtool.yaml --do fec-get --json '{"header":{"dev-index": 10, "flags": 4}}'
{'auto': 0,
'header': {'dev-index': 10, 'dev-name': 'eni10np1'},
'modes': {'bits': {}, 'nomask': True, 'size': 121},
'stats': {'corr-bits': [],
'corrected': [123],
'hist': [{'bin-high': 0,
'bin-low': 0,
'bin-val': 445,
'bin-val-per-lane': [125, 120, 100, 100]},
{'bin-high': 3, 'bin-low': 1, 'bin-val': 12},
{'bin-high': 7,
'bin-low': 4,
'bin-val': 2,
'bin-val-per-lane': [2, 0, 0, 0]}],
'uncorr': [4]}}
v4 -> v5:
* fix selftests error path
v3 -> v4:
* update spec to avoid using underscores
* make core accumulate per-lane errors into bin error counter
* adjust wording in Documentation
* improve FEC type check in mlx5
* add selftest to do sanity check of reported histogram
* partially carry-over Rb tags from Aleksandr because of logical changes
v3 Link - https://lore.kernel.org/netdev/20250916191257.13343-1-vadim.fedorenko@linux.dev/
v2 -> v3:
* fix yaml spec to use binary array for histogram per-lane values
* fix spelling
v1 -> v2:
* fix memset size of FEC histogram bins in mlx5
* adjust fbnic driver FEC stats callback
Links to RFC discussions:
v1 - https://lore.kernel.org/netdev/20250729102354.771859-1-vadfed@meta.com/
v2 - https://lore.kernel.org/netdev/20250731231019.1809172-1-vadfed@meta.com/
v3 - https://lore.kernel.org/netdev/20250802063024.2423022-1-vadfed@meta.com/
v4 - https://lore.kernel.org/netdev/20250807155924.2272507-1-vadfed@meta.com/
v5 - https://lore.kernel.org/netdev/20250815132729.2251597-1-vadfed@meta.com/
Carolina Jubran (3):
net/mlx5e: Don't query FEC statistics when FEC is disabled
net/mlx5e: Add logic to read RS-FEC histogram bin ranges from PPHCR
net/mlx5e: Report RS-FEC histogram statistics via ethtool
Vadim Fedorenko (2):
ethtool: add FEC bins histogram report
selftests: net-drv: stats: sanity check FEC histogram
Documentation/netlink/specs/ethtool.yaml | 26 ++++
Documentation/networking/ethtool-netlink.rst | 5 +
.../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 3 +-
.../ethernet/fungible/funeth/funeth_ethtool.c | 3 +-
.../ethernet/hisilicon/hns3/hns3_ethtool.c | 3 +-
drivers/net/ethernet/intel/ice/ice_ethtool.c | 4 +-
.../marvell/octeontx2/nic/otx2_ethtool.c | 3 +-
drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 +
.../ethernet/mellanox/mlx5/core/en_ethtool.c | 5 +-
.../net/ethernet/mellanox/mlx5/core/en_main.c | 8 ++
.../ethernet/mellanox/mlx5/core/en_stats.c | 125 +++++++++++++++++-
.../ethernet/mellanox/mlx5/core/en_stats.h | 3 +-
.../net/ethernet/meta/fbnic/fbnic_ethtool.c | 3 +-
drivers/net/ethernet/sfc/ethtool.c | 3 +-
drivers/net/ethernet/sfc/siena/ethtool.c | 3 +-
drivers/net/netdevsim/ethtool.c | 25 +++-
include/linux/ethtool.h | 25 +++-
.../uapi/linux/ethtool_netlink_generated.h | 11 ++
net/ethtool/fec.c | 75 ++++++++++-
tools/testing/selftests/drivers/net/stats.py | 35 ++++-
20 files changed, 345 insertions(+), 24 deletions(-)
--
2.47.3
next reply other threads:[~2025-09-22 10:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 10:07 Vadim Fedorenko [this message]
2025-09-22 10:07 ` [Intel-wired-lan] [PATCH net-next v5 1/5] ethtool: add FEC bins histogram report Vadim Fedorenko
2025-09-24 0:27 ` Jakub Kicinski
2025-09-22 10:07 ` [Intel-wired-lan] [PATCH net-next v5 2/5] net/mlx5e: Don't query FEC statistics when FEC is disabled Vadim Fedorenko
2025-09-22 10:07 ` [Intel-wired-lan] [PATCH net-next v5 3/5] net/mlx5e: Add logic to read RS-FEC histogram bin ranges from PPHCR Vadim Fedorenko
2025-09-24 0:34 ` Jakub Kicinski
2025-09-22 10:07 ` [Intel-wired-lan] [PATCH net-next v5 4/5] net/mlx5e: Report RS-FEC histogram statistics via ethtool Vadim Fedorenko
2025-09-22 10:07 ` [Intel-wired-lan] [PATCH net-next v5 5/5] selftests: net-drv: stats: sanity check FEC histogram Vadim Fedorenko
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=20250922100741.2167024-1-vadim.fedorenko@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew@lunn.ch \
--cc=cjubran@nvidia.com \
--cc=donald.hunter@gmail.com \
--cc=gal@nvidia.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=tariqt@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox