net/mlx5: Add CONFIG_MLX5_ESWITCH Kconfig
[platform/kernel/linux-rpi.git] / drivers / net / ethernet / mellanox / mlx5 / core / sriov.c
index bf99d40..5e7ffc9 100644 (file)
@@ -33,9 +33,7 @@
 #include <linux/pci.h>
 #include <linux/mlx5/driver.h>
 #include "mlx5_core.h"
-#ifdef CONFIG_MLX5_CORE_EN
 #include "eswitch.h"
-#endif
 
 bool mlx5_sriov_is_enabled(struct mlx5_core_dev *dev)
 {
@@ -57,14 +55,12 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs)
                return -EBUSY;
        }
 
-#ifdef CONFIG_MLX5_CORE_EN
        err = mlx5_eswitch_enable_sriov(dev->priv.eswitch, num_vfs, SRIOV_LEGACY);
        if (err) {
                mlx5_core_warn(dev,
                               "failed to enable eswitch SRIOV (%d)\n", err);
                return err;
        }
-#endif
 
        for (vf = 0; vf < num_vfs; vf++) {
                err = mlx5_core_enable_hca(dev, vf + 1);
@@ -88,11 +84,7 @@ static void mlx5_device_disable_sriov(struct mlx5_core_dev *dev)
        int vf;
 
        if (!sriov->enabled_vfs)
-#ifdef CONFIG_MLX5_CORE_EN
-               goto disable_sriov_resources;
-#else
-               return;
-#endif
+               goto out;
 
        for (vf = 0; vf < sriov->num_vfs; vf++) {
                if (!sriov->vfs_ctx[vf].enabled)
@@ -106,10 +98,8 @@ static void mlx5_device_disable_sriov(struct mlx5_core_dev *dev)
                sriov->enabled_vfs--;
        }
 
-#ifdef CONFIG_MLX5_CORE_EN
-disable_sriov_resources:
+out:
        mlx5_eswitch_disable_sriov(dev->priv.eswitch);
-#endif
 
        if (mlx5_wait_for_vf_pages(dev))
                mlx5_core_warn(dev, "timeout reclaiming VFs pages\n");