提交 5f5991f3 编写于 作者: E Eli Cohen 提交者: Saeed Mahameed

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: a9f7705f ("net/mlx5: Unify vport manager capability check")
Signed-off-by: NEli Cohen <eli@mellanox.com>
Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
上级 6751e7c6
...@@ -1696,7 +1696,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) ...@@ -1696,7 +1696,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
int vport_num; int vport_num;
int err; int err;
if (!MLX5_VPORT_MANAGER(dev)) if (!MLX5_ESWITCH_MANAGER(dev))
return 0; return 0;
esw_info(dev, esw_info(dev,
...@@ -1765,7 +1765,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) ...@@ -1765,7 +1765,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
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; return;
esw_info(esw->dev, "cleanup\n"); esw_info(esw->dev, "cleanup\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册