net/mlx5: E-Switch, Fix resetting of encap mode when entering switchdev
authorPaul Blakey <paulb@nvidia.com>
Thu, 20 May 2021 14:09:58 +0000 (17:09 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:37 +0000 (09:48 +0100)
commit158ec85d360e783c1610dc160c86a02133dc7620
tree724fc8bddaace5f125ab5110a3b6d7e224b4426f
parenta49a9b92fcd2dac7463f741cb14aa9822e88d5c0
net/mlx5: E-Switch, Fix resetting of encap mode when entering switchdev

[ Upstream commit d7751d6476185ff754b9dad2cba0c0a6e43ecadc ]

E-Switch encap mode is relevant only when in switchdev mode.
The RDMA driver can query the encap configuration via
mlx5_eswitch_get_encap_mode(). Make sure it returns the currently
used mode and not the set one.

This reverts the cited commit which reset the encap mode
on entering switchdev and fixes the original issue properly.

Fixes: 9a64144d683a ("net/mlx5: E-Switch, Fix default encap mode")
Signed-off-by: Paul Blakey <paulb@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
include/linux/mlx5/eswitch.h