All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>, netdev@vger.kernel.org
Cc: davem@davemloft.net, andrew@lunn.ch, mkubecek@suse.cz,
	idosch@nvidia.com, Ariel Almog <ariela@nvidia.com>
Subject: Re: [RFC net-next 0/6] ethtool: add uAPI for reading standard stats
Date: Wed, 14 Apr 2021 22:51:39 -0700	[thread overview]
Message-ID: <4425ee5839ac86270542ffa3d40cda67dc5068e1.camel@kernel.org> (raw)
In-Reply-To: <20210414202325.2225774-1-kuba@kernel.org>

On Wed, 2021-04-14 at 13:23 -0700, Jakub Kicinski wrote:
> This series adds a new ethtool command to read well defined
> device statistics. 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). Stats are dumped directly
> into netlink with netlink attributes used as IDs. This is
> perhaps where the biggest question mark is. We could instead
> pack the stats into individual wrappers:
> 
>  [grp]
>    [stat] // nest
>      [id]    // u32
>      [value] // u64
>    [stat] // nest
>      [id]    // u32
>      [value] // u64
> 
> which would increase the message size 2x but allow
> to ID the stats from 0, saving strset space as well as

don't you need to translate such ids to strs in userspace ? 
I am not fond of upgrading userspace every time we add new stat.. 

Just throwing crazy ideas.. BTF might be a useful tool here! :)) 

> allow seamless adding of legacy stats to this API
which legacy stats ? 

> (which are IDed from 0).
> 
> 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 rmon eth-ctrl

Deja-vu, I honestly remember someone in mlnx suggsting this exact
command a couple of years ago.. :) 

> 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
> 
> Jakub Kicinski (6):
>   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
> 
>  Documentation/networking/ethtool-netlink.rst |  74 ++++
>  Documentation/networking/statistics.rst      |  44 ++-
>  include/linux/ethtool.h                      |  95 +++++
>  include/uapi/linux/ethtool.h                 |  10 +
>  include/uapi/linux/ethtool_netlink.h         | 134 +++++++
>  net/ethtool/Makefile                         |   2 +-
>  net/ethtool/netlink.c                        |  10 +
>  net/ethtool/netlink.h                        |   8 +
>  net/ethtool/stats.c                          | 374
> +++++++++++++++++++
>  net/ethtool/strset.c                         |  25 ++
>  10 files changed, 773 insertions(+), 3 deletions(-)
>  create mode 100644 net/ethtool/stats.c
> 



  parent reply	other threads:[~2021-04-15  5:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 20:23 [RFC net-next 0/6] ethtool: add uAPI for reading standard stats Jakub Kicinski
2021-04-14 20:23 ` [RFC net-next 1/6] docs: networking: extend the statistics documentation Jakub Kicinski
2021-04-14 20:23 ` [RFC net-next 2/6] docs: ethtool: document standard statistics Jakub Kicinski
2021-04-14 20:23 ` [RFC net-next 3/6] ethtool: add a new command for reading standard stats Jakub Kicinski
2021-04-14 20:23 ` [RFC net-next 4/6] ethtool: add interface to read standard MAC stats Jakub Kicinski
2021-04-15  6:12   ` Saeed Mahameed
2021-04-15 15:38     ` Jakub Kicinski
2021-04-15 22:46       ` Saeed Mahameed
2021-04-15 23:05         ` Jakub Kicinski
2021-04-15 23:52           ` Saeed Mahameed
2021-04-14 20:23 ` [RFC net-next 5/6] ethtool: add interface to read standard MAC Ctrl stats Jakub Kicinski
2021-04-14 20:23 ` [RFC net-next 6/6] ethtool: add interface to read RMON stats Jakub Kicinski
2021-04-15  5:51 ` Saeed Mahameed [this message]
2021-04-15 15:45   ` [RFC net-next 0/6] ethtool: add uAPI for reading standard stats 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=4425ee5839ac86270542ffa3d40cda67dc5068e1.camel@kernel.org \
    --to=saeed@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=ariela@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /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.