Skip to content

Commit

Permalink
net/mlx5e: E-Switch, Initialize E-Switch for eswitch manager
Browse files Browse the repository at this point in the history
Initialize eswitch instance for a function which is eswitch manager
but not a vport group manager.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Roi Dayan authored and Saeed Mahameed committed May 19, 2023
1 parent 0279b54 commit f5d87b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)
struct mlx5_eswitch *esw;
int err;

if (!MLX5_VPORT_MANAGER(dev))
if (!MLX5_VPORT_MANAGER(dev) && !MLX5_ESWITCH_MANAGER(dev))
return 0;

esw = kzalloc(sizeof(*esw), GFP_KERNEL);
Expand Down Expand Up @@ -1692,7 +1692,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev)

void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw)
{
if (!esw || !MLX5_VPORT_MANAGER(esw->dev))
if (!esw)
return;

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

0 comments on commit f5d87b4

Please sign in to comment.