Skip to content

Commit

Permalink
net/mlx5: E-switch, When eswitch is unsupported, return -EOPNOTSUPP
Browse files Browse the repository at this point in the history
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: bd93975 ("net/mlx5: E-switch, Introduce and use eswitch support check helper")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Parav Pandit authored and Saeed Mahameed committed Jul 10, 2020
1 parent 8fb49c0 commit e9716af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static int mlx5_eswitch_check(const struct mlx5_core_dev *dev)
return -EOPNOTSUPP;

if (!MLX5_ESWITCH_MANAGER(dev))
return -EPERM;
return -EOPNOTSUPP;

return 0;
}
Expand Down

0 comments on commit e9716af

Please sign in to comment.