From: Joe Damato <jdamato@fastly.com>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
netdev@vger.kernel.org, Saeed Mahameed <saeedm@nvidia.com>,
Gal Pressman <gal@nvidia.com>,
Leon Romanovsky <leonro@nvidia.com>
Subject: Re: [PATCH net 5/5] net/mlx5e: Fix queue stats access to non-existing channels splat
Date: Thu, 8 Aug 2024 15:52:27 +0100 [thread overview]
Message-ID: <ZrTbqxRflu5HVMSY@LQ3V64L9R2> (raw)
In-Reply-To: <20240808144107.2095424-6-tariqt@nvidia.com>
On Thu, Aug 08, 2024 at 05:41:06PM +0300, Tariq Toukan wrote:
> From: Gal Pressman <gal@nvidia.com>
>
> The queue stats API queries the queues according to the
> real_num_[tr]x_queues, in case the device is down and channels were not
> yet created, don't try to query their statistics.
[...]
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index f04decca39f2..5df904639b0c 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -5296,7 +5296,7 @@ static void mlx5e_get_queue_stats_rx(struct net_device *dev, int i,
> struct mlx5e_rq_stats *rq_stats;
>
> ASSERT_RTNL();
> - if (mlx5e_is_uplink_rep(priv))
> + if (mlx5e_is_uplink_rep(priv) || !priv->stats_nch)
> return;
>
> channel_stats = priv->channel_stats[i];
> @@ -5316,6 +5316,9 @@ static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i,
> struct mlx5e_sq_stats *sq_stats;
>
> ASSERT_RTNL();
> + if (!priv->stats_nch)
> + return;
> +
> /* no special case needed for ptp htb etc since txq2sq_stats is kept up
> * to date for active sq_stats, otherwise get_base_stats takes care of
> * inactive sqs.
> --
> 2.44.0
Reviewed-by: Joe Damato <jdamato@fastly.com>
next prev parent reply other threads:[~2024-08-08 14:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 14:41 [PATCH net 0/5] mlx5 misc fixes 2024-08-08 Tariq Toukan
2024-08-08 14:41 ` [PATCH net 1/5] net/mlx5: SD, Do not query MPIR register if no sd_group Tariq Toukan
2024-08-08 14:41 ` [PATCH net 2/5] net/mlx5e: SHAMPO, Increase timeout to improve latency Tariq Toukan
2024-08-08 14:41 ` [PATCH net 3/5] net/mlx5e: Take state lock during tx timeout reporter Tariq Toukan
2024-08-08 14:41 ` [PATCH net 4/5] net/mlx5e: Correctly report errors for ethtool rx flows Tariq Toukan
2024-08-08 14:41 ` [PATCH net 5/5] net/mlx5e: Fix queue stats access to non-existing channels splat Tariq Toukan
2024-08-08 14:52 ` Joe Damato [this message]
2024-08-10 5:30 ` [PATCH net 0/5] mlx5 misc fixes 2024-08-08 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=ZrTbqxRflu5HVMSY@LQ3V64L9R2 \
--to=jdamato@fastly.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=leonro@nvidia.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