Skip to content

Commit 5f5991f

Browse files
Eli CohenSaeed Mahameed
authored andcommitted
net/mlx5e: E-Switch, Initialize eswitch only if eswitch manager
Execute mlx5_eswitch_init() only if we have MLX5_ESWITCH_MANAGER capabilities. Do the same for mlx5_eswitch_cleanup(). Fixes: a9f7705 ("net/mlx5: Unify vport manager capability check") Signed-off-by: Eli Cohen <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 6751e7c commit 5f5991f

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
16961696
int vport_num;
16971697
int err;
16981698

1699-
if (!MLX5_VPORT_MANAGER(dev))
1699+
if (!MLX5_ESWITCH_MANAGER(dev))
17001700
return 0;
17011701

17021702
esw_info(dev,
@@ -1765,7 +1765,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
17651765

17661766
void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw)
17671767
{
1768-
if (!esw || !MLX5_VPORT_MANAGER(esw->dev))
1768+
if (!esw || !MLX5_ESWITCH_MANAGER(esw->dev))
17691769
return;
17701770

17711771
esw_info(esw->dev, "cleanup\n");

0 commit comments

Comments
 (0)