From: Jakub Kicinski <kuba@kernel.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, andrew@lunn.ch, mkubecek@suse.cz,
idosch@nvidia.com, saeedm@nvidia.com, michael.chan@broadcom.com,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v2 0/9] ethtool: add uAPI for reading standard stats
Date: Fri, 16 Apr 2021 12:27:36 -0700 [thread overview]
Message-ID: <20210416192745.2851044-1-kuba@kernel.org> (raw)
Continuing the effort of providing a unified access method
to standard stats, and explicitly tying the definitions to
the standards this series adds an API for general stats
which do no fit into more targeted control APIs.
There is nothing clever here, just a netlink API for dumping
statistics defined by standards and RFCs which today end up
in ethtool -S under infinite variations of names.
This series adds basic IEEE stats (for PHY, MAC, Ctrl frames)
and RMON stats. AFAICT other RFCs only duplicate the IEEE
stats.
This series does _not_ add a netlink API to read driver-defined
stats. There seems to be little to gain from moving that part
to netlink.
The netlink message format is very simple, and aims to allow
adding stats and groups with no changes to user tooling (which
IIUC is expected for ethtool).
On user space side we can re-use -S, and make it dump
standard stats if --groups are defined.
$ ethtool -S eth0 --groups eth-phy eth-mac eth-ctrl rmon
Stats for eth0:
eth-phy-SymbolErrorDuringCarrier: 0
eth-mac-FramesTransmittedOK: 0
eth-mac-FrameTooLongErrors: 0
eth-ctrl-MACControlFramesTransmitted: 0
eth-ctrl-MACControlFramesReceived: 1
eth-ctrl-UnsupportedOpcodesReceived: 0
rmon-etherStatsUndersizePkts: 0
rmon-etherStatsJabbers: 0
rmon-rx-etherStatsPkts64Octets: 1
rmon-rx-etherStatsPkts128to255Octets: 0
rmon-rx-etherStatsPkts1024toMaxOctets: 1
rmon-tx-etherStatsPkts64Octets: 1
rmon-tx-etherStatsPkts128to255Octets: 0
rmon-tx-etherStatsPkts1024toMaxOctets: 1
v1:
Driver support for mlxsw, mlx5 and bnxt included.
Compared to the RFC I went ahead with wrapping the stats into
a 1:1 nest. Now IDs of stats can start from 0, at a cost of
slightly "careful" u64 alignment handling.
v2:
Add missing kdoc in patch 5.
Jakub Kicinski (9):
docs: networking: extend the statistics documentation
docs: ethtool: document standard statistics
ethtool: add a new command for reading standard stats
ethtool: add interface to read standard MAC stats
ethtool: add interface to read standard MAC Ctrl stats
ethtool: add interface to read RMON stats
mlxsw: implement ethtool standard stats
bnxt: implement ethtool standard stats
mlx5: implement ethtool standard stats
Documentation/networking/ethtool-netlink.rst | 82 ++++
Documentation/networking/statistics.rst | 44 +-
.../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 125 ++++++
.../ethernet/mellanox/mlx5/core/en_ethtool.c | 37 ++
.../ethernet/mellanox/mlx5/core/en_stats.c | 142 +++++-
.../ethernet/mellanox/mlx5/core/en_stats.h | 10 +
.../mellanox/mlxsw/spectrum_ethtool.c | 129 ++++++
include/linux/ethtool.h | 96 ++++
include/uapi/linux/ethtool.h | 10 +
include/uapi/linux/ethtool_netlink.h | 137 ++++++
net/ethtool/Makefile | 2 +-
net/ethtool/netlink.c | 10 +
net/ethtool/netlink.h | 8 +
net/ethtool/stats.c | 410 ++++++++++++++++++
net/ethtool/strset.c | 25 ++
15 files changed, 1257 insertions(+), 10 deletions(-)
create mode 100644 net/ethtool/stats.c
--
2.30.2
next reply other threads:[~2021-04-16 19:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-16 19:27 Jakub Kicinski [this message]
2021-04-16 19:27 ` [PATCH net-next v2 1/9] docs: networking: extend the statistics documentation Jakub Kicinski
2021-04-16 19:27 ` [PATCH net-next v2 2/9] docs: ethtool: document standard statistics Jakub Kicinski
2021-04-16 19:27 ` [PATCH net-next v2 3/9] ethtool: add a new command for reading standard stats Jakub Kicinski
2021-04-17 17:15 ` Ido Schimmel
2021-04-17 17:57 ` Jakub Kicinski
2021-04-17 18:13 ` Jakub Kicinski
2021-04-17 18:53 ` Ido Schimmel
2021-04-17 19:15 ` Jakub Kicinski
2021-04-17 19:18 ` Jakub Kicinski
2021-04-17 19:27 ` Ido Schimmel
2021-04-17 20:10 ` Michal Kubecek
2021-04-19 19:20 ` Jakub Kicinski
2021-04-18 8:20 ` Ido Schimmel
2021-04-16 19:27 ` [PATCH net-next v2 4/9] ethtool: add interface to read standard MAC stats Jakub Kicinski
2021-04-16 19:27 ` [PATCH net-next v2 5/9] ethtool: add interface to read standard MAC Ctrl stats Jakub Kicinski
2021-04-16 19:27 ` [PATCH net-next v2 6/9] ethtool: add interface to read RMON stats Jakub Kicinski
2021-04-18 8:04 ` Ido Schimmel
2021-04-19 18:55 ` Jakub Kicinski
2021-04-16 19:27 ` [PATCH net-next v2 7/9] mlxsw: implement ethtool standard stats Jakub Kicinski
2021-04-16 19:27 ` [PATCH net-next v2 8/9] bnxt: " Jakub Kicinski
2021-04-19 0:27 ` Michael Chan
2021-04-16 19:27 ` [PATCH net-next v2 9/9] mlx5: " Jakub Kicinski
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=20210416192745.2851044-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=idosch@nvidia.com \
--cc=michael.chan@broadcom.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=saeedm@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 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.