From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
netdev@vger.kernel.org, Gal Pressman <gal@nvidia.com>,
Tariq Toukan <tariqt@nvidia.com>
Subject: [net 8/9] net/mlx5e: Fix capability check for updating vnic env counters
Date: Wed, 6 Jul 2022 16:13:08 -0700 [thread overview]
Message-ID: <20220706231309.38579-9-saeed@kernel.org> (raw)
In-Reply-To: <20220706231309.38579-1-saeed@kernel.org>
From: Gal Pressman <gal@nvidia.com>
The existing capability check for vnic env counters only checks for
receive steering discards, although we need the counters update for the
exposed internal queue oob counter as well. This could result in the
latter counter not being updated correctly when the receive steering
discards counter is not supported.
Fix that by checking whether any counter is supported instead of only
the steering counter capability.
Fixes: 0cfafd4b4ddf ("net/mlx5e: Add device out of buffer counter")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
index 57fa0489eeb8..1e87bb2b7541 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
@@ -688,7 +688,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vnic_env)
u32 in[MLX5_ST_SZ_DW(query_vnic_env_in)] = {};
struct mlx5_core_dev *mdev = priv->mdev;
- if (!MLX5_CAP_GEN(priv->mdev, nic_receive_steering_discard))
+ if (!mlx5e_stats_grp_vnic_env_num_stats(priv))
return;
MLX5_SET(query_vnic_env_in, in, opcode, MLX5_CMD_OP_QUERY_VNIC_ENV);
--
2.36.1
next prev parent reply other threads:[~2022-07-06 23:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 23:13 [pull request][net 0/9] mlx5 fixes 2022-07-06 Saeed Mahameed
2022-07-06 23:13 ` [net 1/9] net/mlx5: TC, allow offload from uplink to other PF's VF Saeed Mahameed
2022-07-08 1:00 ` patchwork-bot+netdevbpf
2022-07-06 23:13 ` [net 2/9] net/mlx5: Lag, decouple FDB selection and shared FDB Saeed Mahameed
2022-07-06 23:13 ` [net 3/9] net/mlx5e: kTLS, Fix build time constant test in TX Saeed Mahameed
2022-07-06 23:13 ` [net 4/9] net/mlx5e: kTLS, Fix build time constant test in RX Saeed Mahameed
2022-07-06 23:13 ` [net 5/9] net/mlx5e: Fix enabling sriov while tc nic rules are offloaded Saeed Mahameed
2022-07-06 23:13 ` [net 6/9] net/mlx5: Lag, correct get the port select mode str Saeed Mahameed
2022-07-06 23:13 ` [net 7/9] net/mlx5e: CT: Use own workqueue instead of mlx5e priv Saeed Mahameed
2022-07-06 23:13 ` Saeed Mahameed [this message]
2022-07-06 23:13 ` [net 9/9] net/mlx5e: Ring the TX doorbell on DMA errors Saeed Mahameed
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=20220706231309.38579-9-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--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 NNTP newsgroup(s).