aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2020-06-24 05:56:25 -0500
committerSaeed Mahameed <saeedm@mellanox.com>2020-07-09 19:51:12 -0700
commite9716afdcae4ceea3a093e5b2fac1a5df0f943ca (patch)
tree2e16ccdc7f10db89bc4a9bbfb258f2e4be182493 /drivers
parentMerge branch 'Expose-port-split-attributes' (diff)
downloadlinux-dev-e9716afdcae4ceea3a093e5b2fac1a5df0f943ca.tar.xz
linux-dev-e9716afdcae4ceea3a093e5b2fac1a5df0f943ca.zip
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: bd93975353d5 ("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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/eswitch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index c656c9f081c1..d70543ea57dd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -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;
}