net/mlx5: devlink, Only show PF related devlink warning when needed
authorRoi Dayan <roid@nvidia.com>
Tue, 2 May 2023 09:44:47 +0000 (12:44 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 19 May 2023 17:50:31 +0000 (10:50 -0700)
Limit the PF related warning to show if device is actually a PF.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/devlink.c

index 0e07971..bfaec67 100644 (file)
@@ -162,9 +162,8 @@ static int mlx5_devlink_reload_down(struct devlink *devlink, bool netns_change,
                return -EOPNOTSUPP;
        }
 
-       if (pci_num_vf(pdev)) {
+       if (mlx5_core_is_pf(dev) && pci_num_vf(pdev))
                NL_SET_ERR_MSG_MOD(extack, "reload while VFs are present is unfavorable");
-       }
 
        switch (action) {
        case DEVLINK_RELOAD_ACTION_DRIVER_REINIT: