Netdev List
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Joe Damato <jdamato@fastly.com>, <linux-kernel@vger.kernel.org>,
	<netdev@vger.kernel.org>
Cc: <nalramli@fastly.com>, <mkarsten@uwaterloo.ca>,
	Tariq Toukan <tariqt@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"open list:MELLANOX MLX4 core VPI driver"
	<linux-rdma@vger.kernel.org>
Subject: Re: [PATCH net-next v6 3/3] net/mlx4: support per-queue statistics via netlink
Date: Thu, 30 May 2024 14:11:19 -0700	[thread overview]
Message-ID: <3d1cf564-c77b-4c8b-95ba-e33658596a93@intel.com> (raw)
In-Reply-To: <20240528181139.515070-4-jdamato@fastly.com>



On 5/28/2024 11:11 AM, Joe Damato wrote:
> Make mlx4 compatible with the newly added netlink queue stats API.
> 
> Signed-off-by: Joe Damato <jdamato@fastly.com>
> Tested-by: Martin Karsten <mkarsten@uwaterloo.ca>
> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
> ---
>  .../net/ethernet/mellanox/mlx4/en_netdev.c    | 73 +++++++++++++++++++
>  1 file changed, 73 insertions(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index 4d2f8c458346..281b34af0bb4 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -43,6 +43,7 @@
>  #include <net/vxlan.h>
>  #include <net/devlink.h>
>  #include <net/rps.h>
> +#include <net/netdev_queues.h>
>  
>  #include <linux/mlx4/driver.h>
>  #include <linux/mlx4/device.h>
> @@ -3100,6 +3101,77 @@ void mlx4_en_set_stats_bitmap(struct mlx4_dev *dev,
>  	last_i += NUM_PHY_STATS;
>  }
>  
> +static void mlx4_get_queue_stats_rx(struct net_device *dev, int i,
> +				    struct netdev_queue_stats_rx *stats)
> +{
> +	struct mlx4_en_priv *priv = netdev_priv(dev);
> +	const struct mlx4_en_rx_ring *ring;
> +
> +	spin_lock_bh(&priv->stats_lock);
> +
> +	if (!priv->port_up || mlx4_is_master(priv->mdev->dev))
> +		goto out_unlock;
> +
> +	ring = priv->rx_ring[i];
> +	stats->packets = READ_ONCE(ring->packets);
> +	stats->bytes   = READ_ONCE(ring->bytes);
> +	stats->alloc_fail = READ_ONCE(ring->alloc_fail);
> +

Ahh, allocation failures is reported here. Ok. I probably would have
re-ordered patches so that the implementation of alloc_fail came after
and it was a bit more obvious how it would be used.

Either way, I don't think that deserves a resend.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

  reply	other threads:[~2024-05-30 21:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28 18:11 [PATCH net-next v6 0/3] mlx4: Add support for netdev-genl API Joe Damato
2024-05-28 18:11 ` [PATCH net-next v6 1/3] net/mlx4: Track RX allocation failures in a stat Joe Damato
2024-05-30 21:08   ` Jacob Keller
2024-05-30 21:12     ` Jacob Keller
2024-05-28 18:11 ` [PATCH net-next v6 2/3] net/mlx4: link NAPI instances to queues and IRQs Joe Damato
2024-05-30 21:10   ` Jacob Keller
2024-05-28 18:11 ` [PATCH net-next v6 3/3] net/mlx4: support per-queue statistics via netlink Joe Damato
2024-05-30 21:11   ` Jacob Keller [this message]
2024-05-31  0:20 ` [PATCH net-next v6 0/3] mlx4: Add support for netdev-genl API patchwork-bot+netdevbpf

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=3d1cf564-c77b-4c8b-95ba-e33658596a93@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --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=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