Linux-RDMA Archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Joe Damato <jdamato@fastly.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	tariqt@nvidia.com, saeedm@nvidia.com, mkarsten@uwaterloo.ca,
	gal@nvidia.com, nalramli@fastly.com,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	"open list:MELLANOX MLX4 core VPI driver"
	<linux-rdma@vger.kernel.org>
Subject: Re: [PATCH net-next 3/3] net/mlx4: support per-queue statistics via netlink
Date: Tue, 23 Apr 2024 17:57:18 -0700	[thread overview]
Message-ID: <20240423175718.4ad4dc5a@kernel.org> (raw)
In-Reply-To: <Zig5RZOkzhGITL7V@LQ3V64L9R2>

On Tue, 23 Apr 2024 12:42:13 -1000 Joe Damato wrote:
> I realized in this case, I'll need to set the fields initialized to 0xff
> above to 0 before doing the increments below.

I don't know mlx4 very well, but glancing at the code - are you sure we
need to loop over the queues is the "base" callbacks?

The base callbacks are for getting "historical" data, i.e. info which
was associated with queues which are no longer present. You seem to
sweep all queues, so I'd have expected "base" to just set the values 
to 0. And the real values to come from the per-queue callbacks.

The init to 0xff looks quite sus.

Also what does this:

>	if (!priv->port_up || mlx4_is_master(priv->mdev->dev))

do? 🤔️ what's a "master" in this context?

> Sorry about that; just realized that now and will fix that in the v2 (along
> with any other feedback I get), probably something:
> 
>   if (priv->rx_ring_num) {
>           rx->packets = 0;
>           rx->bytes = 0;
>           rx->alloc_fail = 0;
>   }
> 
> Here for the RX side and see below for the TX side.

FWIW I added a simple test for making sure queue stats match interface
stats, it's tools/testing/selftests/drivers/net/stats.py

You have to export NETIF=$name to make it run on a real interface.

To copy the tests to a remote machine I do:

make -C tools/testing/selftests/ TARGETS="net drivers/net drivers/net/hw" install INSTALL_PATH=/tmp/ksft-net-drv
rsync -ra --delete /tmp/ksft-net-drv root@${machine}:/root/

HTH

  reply	other threads:[~2024-04-24  0:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 19:49 [PATCH net-next 0/3] mlx4: Add support for netdev-genl API Joe Damato
2024-04-23 19:49 ` [PATCH net-next 1/3] net/mlx4: Track RX allocation failures in a stat Joe Damato
2024-04-23 22:38   ` Joe Damato
2024-04-24  6:27   ` kernel test robot
2024-04-23 19:49 ` [PATCH net-next 2/3] net/mlx4: link NAPI instances to queues and IRQs Joe Damato
2024-04-24  7:41   ` kernel test robot
2024-04-23 19:49 ` [PATCH net-next 3/3] net/mlx4: support per-queue statistics via netlink Joe Damato
2024-04-23 22:42   ` Joe Damato
2024-04-24  0:57     ` Jakub Kicinski [this message]
2024-04-24  5:54       ` Joe Damato
2024-04-24 14:28         ` Jakub Kicinski
2024-04-24 16:39           ` Joe Damato
2024-04-25  3:46             ` Jakub Kicinski
2024-04-25 16:31             ` Joe Damato
2024-04-30 12:33               ` Leon Romanovsky
2024-04-30 16:18                 ` Joe Damato

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=20240423175718.4ad4dc5a@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=jdamato@fastly.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mkarsten@uwaterloo.ca \
    --cc=nalramli@fastly.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).