netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Damato <joe@dama.to>
To: Breno Leitao <leitao@debian.org>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH net-next 1/2] netdevsim: migrate to dstats stats collection
Date: Thu, 12 Jun 2025 17:12:48 +0300	[thread overview]
Message-ID: <aErgYLGwLjoHxCLv@MacBook-Air.local> (raw)
In-Reply-To: <20250611-netdevsim_stat-v1-1-c11b657d96bf@debian.org>

On Wed, Jun 11, 2025 at 08:06:19AM -0700, Breno Leitao wrote:
> Replace custom statistics tracking with the kernel's dstats infrastructure
> to simplify code and improve consistency with other network drivers.
> 
> This change:
> - Sets dev->pcpu_stat_type = NETDEV_PCPU_STAT_DSTATS for automatic
>   automatic allocation and deallocation.

Ignorable minor nits: "automatic" repeated twice in the list item above and the
other items in the list below do not end with periods.

> - Removes manual stats fields and their update
> - Replaces custom nsim_get_stats64() with dev_get_stats()
> - Uses dev_dstats_tx_add() and dev_dstats_tx_dropped() helpers
> - Eliminates the need for manual synchronization primitives
> 
> The dstats framework provides the same functionality with less code.
> 
> Suggested-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Breno Leitao <leitao@debian.org>
> ---
>  drivers/net/netdevsim/netdev.c    | 33 ++++++---------------------------
>  drivers/net/netdevsim/netdevsim.h |  5 -----
>  2 files changed, 6 insertions(+), 32 deletions(-)


Reviewed-by: Joe Damato <joe@dama.to>

  reply	other threads:[~2025-06-12 14:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 15:06 [PATCH net-next 0/2] netdevsim: implement RX statistics using NETDEV_PCPU_STAT_DSTATS Breno Leitao
2025-06-11 15:06 ` [PATCH net-next 1/2] netdevsim: migrate to dstats stats collection Breno Leitao
2025-06-12 14:12   ` Joe Damato [this message]
2025-06-11 15:06 ` [PATCH net-next 2/2] netdevsim: collect statistics at RX side Breno Leitao
2025-06-12 14:25   ` Joe Damato
2025-06-12 14:45     ` Jakub Kicinski
2025-06-12 18:04       ` Breno Leitao

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=aErgYLGwLjoHxCLv@MacBook-Air.local \
    --to=joe@dama.to \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).