public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@google•com>
To: Jakub Kicinski <kuba@kernel•org>
Cc: davem@davemloft•net, netdev@vger•kernel.org, edumazet@google•com,
	 pabeni@redhat•com, amritha.nambiar@intel•com,
	danielj@nvidia•com,  mst@redhat•com, michael.chan@broadcom•com,
	vadim.fedorenko@linux•dev
Subject: Re: [PATCH net-next 1/3] netdev: add per-queue statistics
Date: Mon, 26 Feb 2024 13:35:34 -0800	[thread overview]
Message-ID: <Zd0EJq3gS2_p9NQ8@google.com> (raw)
In-Reply-To: <20240226211015.1244807-2-kuba@kernel.org>

On 02/26, Jakub Kicinski wrote:
> The ethtool-nl family does a good job exposing various protocol
> related and IEEE/IETF statistics which used to get dumped under
> ethtool -S, with creative names. Queue stats don't have a netlink
> API, yet, and remain a lion's share of ethtool -S output for new
> drivers. Not only is that bad because the names differ driver to
> driver but it's also bug-prone. Intuitively drivers try to report
> only the stats for active queues, but querying ethtool stats
> involves multiple system calls, and the number of stats is
> read separately from the stats themselves. Worse still when user
> space asks for values of the stats, it doesn't inform the kernel
> how big the buffer is. If number of stats increases in the meantime
> kernel will overflow user buffer.
> 
> Add a netlink API for dumping queue stats. Queue information is
> exposed via the netdev-genl family, so add the stats there.
> Support per-queue and sum-for-device dumps. Latter will be useful
> when subsequent patches add more interesting common stats than
> just bytes and packets.
> 
> The API does not currently distinguish between HW and SW stats.
> The expectation is that the source of the stats will either not
> matter much (good packets) or be obvious (skb alloc errors).
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel•org>
> ---
>  Documentation/netlink/specs/netdev.yaml |  84 +++++++++
>  Documentation/networking/statistics.rst |  17 +-
>  include/linux/netdevice.h               |   3 +
>  include/net/netdev_queues.h             |  54 ++++++
>  include/uapi/linux/netdev.h             |  19 +++
>  net/core/netdev-genl-gen.c              |  12 ++
>  net/core/netdev-genl-gen.h              |   2 +
>  net/core/netdev-genl.c                  | 217 ++++++++++++++++++++++++
>  tools/include/uapi/linux/netdev.h       |  19 +++
>  9 files changed, 426 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/netlink/specs/netdev.yaml b/Documentation/netlink/specs/netdev.yaml
> index 3addac970680..2570cc371fc8 100644
> --- a/Documentation/netlink/specs/netdev.yaml
> +++ b/Documentation/netlink/specs/netdev.yaml
> @@ -74,6 +74,10 @@ name: netdev
>      name: queue-type
>      type: enum
>      entries: [ rx, tx ]
> +  -
> +    name: stats-scope
> +    type: flags
> +    entries: [ queue ]

IIUC, in order to get netdev-scoped stats in v1 (vs rfc) is to not set
stats-scope, right? Any reason we dropped the explicit netdev entry?
It seems more robust with a separate entry and removes the ambiguity about
which stats we're querying.

  reply	other threads:[~2024-02-26 21:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 21:10 [PATCH net-next 0/3] netdev: add per-queue statistics Jakub Kicinski
2024-02-26 21:10 ` [PATCH net-next 1/3] " Jakub Kicinski
2024-02-26 21:35   ` Stanislav Fomichev [this message]
2024-02-26 22:19     ` Jakub Kicinski
2024-02-27  3:37       ` Stanislav Fomichev
2024-02-27 15:24         ` Jakub Kicinski
2024-02-27 18:09           ` Stanislav Fomichev
2024-02-27 19:49           ` Nambiar, Amritha
2024-02-27 10:29   ` Przemek Kitszel
2024-02-27 15:00     ` Jakub Kicinski
2024-02-27 16:17       ` Przemek Kitszel
2024-02-27 23:01         ` Jakub Kicinski
2024-02-26 21:10 ` [PATCH net-next 2/3] netdev: add queue stat for alloc failures Jakub Kicinski
2024-02-26 21:10 ` [PATCH net-next 3/3] eth: bnxt: support per-queue statistics 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=Zd0EJq3gS2_p9NQ8@google.com \
    --to=sdf@google$(echo .)com \
    --cc=amritha.nambiar@intel$(echo .)com \
    --cc=danielj@nvidia$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=michael.chan@broadcom$(echo .)com \
    --cc=mst@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=vadim.fedorenko@linux$(echo .)dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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