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 1/3] net/mlx4: Track RX allocation failures in a stat
Date: Thu, 30 May 2024 14:08:59 -0700	[thread overview]
Message-ID: <e1efc17f-e4a9-4952-9ad0-7671b72fd37c@intel.com> (raw)
In-Reply-To: <20240528181139.515070-2-jdamato@fastly.com>



On 5/28/2024 11:11 AM, Joe Damato wrote:
> mlx4_en_alloc_frags currently returns -ENOMEM when mlx4_alloc_page
> fails but does not increment a stat field when this occurs.
> 
> A new field called alloc_fail has been added to struct mlx4_en_rx_ring
> which is now incremented in mlx4_en_rx_ring when -ENOMEM occurs.
> 
> Signed-off-by: Joe Damato <jdamato@fastly.com>
> Tested-by: Martin Karsten <mkarsten@uwaterloo.ca>
> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
> ---
>  drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 1 +
>  drivers/net/ethernet/mellanox/mlx4/en_rx.c     | 4 +++-
>  drivers/net/ethernet/mellanox/mlx4/mlx4_en.h   | 1 +
>  3 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index 4c089cfa027a..4d2f8c458346 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -2073,6 +2073,7 @@ static void mlx4_en_clear_stats(struct net_device *dev)
>  		priv->rx_ring[i]->csum_ok = 0;
>  		priv->rx_ring[i]->csum_none = 0;
>  		priv->rx_ring[i]->csum_complete = 0;
> +		priv->rx_ring[i]->alloc_fail = 0;
>  	}
>  }
>  
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> index 8328df8645d5..15c57e9517e9 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> @@ -82,8 +82,10 @@ static int mlx4_en_alloc_frags(struct mlx4_en_priv *priv,
>  
>  	for (i = 0; i < priv->num_frags; i++, frags++) {
>  		if (!frags->page) {
> -			if (mlx4_alloc_page(priv, frags, gfp))
> +			if (mlx4_alloc_page(priv, frags, gfp)) {
> +				ring->alloc_fail++;
>  				return -ENOMEM;
> +			}
>  			ring->rx_alloc_pages++;
>  		}
>  		rx_desc->data[i].addr = cpu_to_be64(frags->dma +
> diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> index efe3f97b874f..cd70df22724b 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
> @@ -355,6 +355,7 @@ struct mlx4_en_rx_ring {
>  	unsigned long xdp_tx;
>  	unsigned long xdp_tx_full;
>  	unsigned long dropped;
> +	unsigned long alloc_fail;
>  	int hwtstamp_rx_filter;
>  	cpumask_var_t affinity_mask;
>  	struct xdp_rxq_info xdp_rxq;

This patch does not appear to extend either a netdev, ethtool, devlink,
or any other interface to report this new counter.

How is a user supposed to obtain this information from the driver?

  reply	other threads:[~2024-05-30 21:09 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 [this message]
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
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=e1efc17f-e4a9-4952-9ad0-7671b72fd37c@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