aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaed Salem <[email protected]>2021-11-01 16:18:53 +0200
committerSaeed Mahameed <[email protected]>2021-11-16 12:20:23 -0800
commitc4c3176739dfa6efcc5b1d1de4b3fd2b51b048c7 (patch)
treecc4c9a4ab5ff77d3ae4796e030bdb32f07b43eee
parentae396d85c01c7bdc9eeceecde1f493d03f793465 (diff)
net/mlx5: E-Switch, return error if encap isn't supported
On regular ConnectX HCAs getting encap mode isn't supported when the E-Switch is in NONE mode. Current code would return no error code when trying to get encap mode in such case which is wrong. Fix by returning error value to indicate failure to caller in such case. Fixes: 8e0aa4bc959c ("net/mlx5: E-switch, Protect eswitch mode changes") Signed-off-by: Raed Salem <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Reviewed-by: Maor Dickman <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 80fa76f60e1e..a46455694f7a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -3623,7 +3623,7 @@ int mlx5_devlink_eswitch_encap_mode_get(struct devlink *devlink,
*encap = esw->offloads.encap;
unlock:
up_write(&esw->mode_lock);
- return 0;
+ return err;
}
static bool