71 lines
2.6 KiB
Diff
71 lines
2.6 KiB
Diff
From 2817cd94836b1f849a6902fcab3c06edada5ad66 Mon Sep 17 00:00:00 2001
|
|
From: Kamal Heib <kheib@redhat.com>
|
|
Date: Sun, 19 Apr 2026 18:24:29 -0400
|
|
Subject: [PATCH] net/mlx5: Remove dead code from total_vfs setter
|
|
|
|
JIRA: https://redhat.atlassian.net/browse/RHEL-169055
|
|
|
|
commit 6a46e4faa8fd848acec81bd6149a44c3b9b17de6
|
|
Author: Vlad Dumitrescu <vdumitrescu@nvidia.com>
|
|
Date: Thu Sep 18 15:05:07 2025 -0700
|
|
|
|
net/mlx5: Remove dead code from total_vfs setter
|
|
|
|
The mlx5_devlink_total_vfs_set function branches based on per_pf_support
|
|
twice. Remove the second branch as the first one exits the function when
|
|
per_pf_support is false.
|
|
|
|
Accidentally added as part of commit a4c49611cf4f ("net/mlx5: Implement
|
|
devlink total_vfs parameter").
|
|
|
|
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
|
|
Closes: https://lore.kernel.org/linux-rdma/aMQWenzpdjhAX4fm@stanley.mountain/
|
|
Signed-off-by: Vlad Dumitrescu <vdumitrescu@nvidia.com>
|
|
Link: https://patch.msgid.link/a6142a60-1948-439a-b0ae-ff1df26a37f8@nvidia.com
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
|
|
Signed-off-by: Kamal Heib <kheib@redhat.com>
|
|
|
|
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
|
|
index 383d8cfe4c0a..459a0b4d08e6 100644
|
|
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
|
|
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
|
|
@@ -458,7 +458,6 @@ static int mlx5_devlink_total_vfs_set(struct devlink *devlink, u32 id,
|
|
{
|
|
struct mlx5_core_dev *dev = devlink_priv(devlink);
|
|
u32 mnvda[MLX5_ST_SZ_DW(mnvda_reg)];
|
|
- bool per_pf_support;
|
|
void *data;
|
|
int err;
|
|
|
|
@@ -474,9 +473,7 @@ static int mlx5_devlink_total_vfs_set(struct devlink *devlink, u32 id,
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
- per_pf_support = MLX5_GET(nv_global_pci_cap, data,
|
|
- per_pf_total_vf_supported);
|
|
- if (!per_pf_support) {
|
|
+ if (!MLX5_GET(nv_global_pci_cap, data, per_pf_total_vf_supported)) {
|
|
/* We don't allow global SRIOV setting on per PF devlink */
|
|
NL_SET_ERR_MSG_MOD(extack,
|
|
"SRIOV is not per PF on this device");
|
|
@@ -489,14 +486,8 @@ static int mlx5_devlink_total_vfs_set(struct devlink *devlink, u32 id,
|
|
return err;
|
|
|
|
MLX5_SET(nv_global_pci_conf, data, sriov_valid, 1);
|
|
- MLX5_SET(nv_global_pci_conf, data, per_pf_total_vf, per_pf_support);
|
|
-
|
|
- if (!per_pf_support) {
|
|
- MLX5_SET(nv_global_pci_conf, data, total_vfs, ctx->val.vu32);
|
|
- return mlx5_nv_param_write(dev, mnvda, sizeof(mnvda));
|
|
- }
|
|
+ MLX5_SET(nv_global_pci_conf, data, per_pf_total_vf, 1);
|
|
|
|
- /* SRIOV is per PF */
|
|
err = mlx5_nv_param_write(dev, mnvda, sizeof(mnvda));
|
|
if (err)
|
|
return err;
|
|
--
|
|
2.50.1 (Apple Git-155)
|
|
|