net/mlx5e: E-Switch, Initialize eswitch only if eswitch manager
authorEli Cohen <eli@mellanox.com>
Mon, 16 Jul 2018 08:49:27 +0000 (11:49 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 31 Jul 2018 19:58:43 +0000 (12:58 -0700)
Execute mlx5_eswitch_init() only if we have MLX5_ESWITCH_MANAGER
capabilities.
Do the same for mlx5_eswitch_cleanup().

Fixes: a9f7705ffd66 ("net/mlx5: Unify vport manager capability check")
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

index dd01ad4c0b547dc989d3cb8ca1749533114dc288..40dba9e8af9260a3af4aa7e2a0cf5ff0622ee3c5 100644 (file)
@@ -1696,7 +1696,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
        int vport_num;
        int err;
 
        int vport_num;
        int err;
 
-       if (!MLX5_VPORT_MANAGER(dev))
+       if (!MLX5_ESWITCH_MANAGER(dev))
                return 0;
 
        esw_info(dev,
                return 0;
 
        esw_info(dev,
@@ -1765,7 +1765,7 @@ abort:
 
 void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw)
 {
 
 void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw)
 {
-       if (!esw || !MLX5_VPORT_MANAGER(esw->dev))
+       if (!esw || !MLX5_ESWITCH_MANAGER(esw->dev))
                return;
 
        esw_info(esw->dev, "cleanup\n");
                return;
 
        esw_info(esw->dev, "cleanup\n");