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, Tariq Toukan <tariqt@nvidia.com>,
Daniel Jurgens <danielj@nvidia.com>
Subject: [net 04/11] net/mlx5: Return correct EC_VF function ID
Date: Mon, 7 Aug 2023 14:26:00 -0700 [thread overview]
Message-ID: <20230807212607.50883-5-saeed@kernel.org> (raw)
In-Reply-To: <20230807212607.50883-1-saeed@kernel.org>
From: Daniel Jurgens <danielj@nvidia.com>
The ECVF function ID range is 1..max_ec_vfs. Currently
mlx5_vport_to_func_id returns 0..max_ec_vfs - 1. Which
results in a syndrome when querying the caps with more
recent firmware, or reading incorrect caps with older
firmware that supports EC VFs.
Fixes: 9ac0b128248e ("net/mlx5: Update vport caps query/set for EC VFs")
Signed-off-by: Daniel Jurgens <danielj@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
index c4be257c043d..682d3dc00dd1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
@@ -361,7 +361,7 @@ static inline bool mlx5_core_is_ec_vf_vport(const struct mlx5_core_dev *dev, u16
static inline int mlx5_vport_to_func_id(const struct mlx5_core_dev *dev, u16 vport, bool ec_vf_func)
{
- return ec_vf_func ? vport - mlx5_core_ec_vf_vport_base(dev)
+ return ec_vf_func ? vport - mlx5_core_ec_vf_vport_base(dev) + 1
: vport;
}
--
2.41.0
next prev parent reply other threads:[~2023-08-07 21:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-07 21:25 [pull request][net 00/11] mlx5 fixes 2023-08-07 Saeed Mahameed
2023-08-07 21:25 ` [net 01/11] net/mlx5e: Take RTNL lock when needed before calling xdp_set_features() Saeed Mahameed
2023-08-08 23:40 ` patchwork-bot+netdevbpf
2023-08-07 21:25 ` [net 02/11] net/mlx5e: TC, Fix internal port memory leak Saeed Mahameed
2023-08-07 21:25 ` [net 03/11] net/mlx5: DR, Fix wrong allocation of modify hdr pattern Saeed Mahameed
2023-08-07 21:26 ` Saeed Mahameed [this message]
2023-08-07 21:26 ` [net 05/11] net/mlx5: Allow 0 for total host VFs Saeed Mahameed
2023-08-07 21:26 ` [net 06/11] net/mlx5: Fix devlink controller number for ECVF Saeed Mahameed
2023-08-07 21:26 ` [net 07/11] net/mlx5e: Unoffload post act rule when handling FIB events Saeed Mahameed
2023-08-07 21:26 ` [net 08/11] net/mlx5: LAG, Check correct bucket when modifying LAG Saeed Mahameed
2023-08-07 21:26 ` [net 09/11] net/mlx5: Skip clock update work when device is in error state Saeed Mahameed
2023-08-07 21:26 ` [net 10/11] net/mlx5: Reload auxiliary devices in pci error handlers Saeed Mahameed
2023-08-07 21:26 ` [net 11/11] net/mlx5e: Add capability check for vnic counters 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=20230807212607.50883-5-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=danielj@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.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).