Commit e9716afd authored by Parav Pandit's avatar Parav Pandit Committed by Saeed Mahameed

net/mlx5: E-switch, When eswitch is unsupported, return -EOPNOTSUPP

When eswitch is unsupported, currently -EPERM error code is returned
instead of -EOPNOTSUPP.

Due to this VF device's devlink virtual port is not enumerated because
port_function_get() callback returned -EPERM instead of -EOPNOTSUPP.

Hence, return the error code -EOPNOTSUPP when eswitch is unsupported.

Fixes: bd939753 ("net/mlx5: E-switch, Introduce and use eswitch support check helper")
Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent 8fb49c01
...@@ -69,7 +69,7 @@ static int mlx5_eswitch_check(const struct mlx5_core_dev *dev) ...@@ -69,7 +69,7 @@ static int mlx5_eswitch_check(const struct mlx5_core_dev *dev)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (!MLX5_ESWITCH_MANAGER(dev)) if (!MLX5_ESWITCH_MANAGER(dev))
return -EPERM; return -EOPNOTSUPP;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment