]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
mlxsw: spectrum_router: Fix determining underlay for a GRE tunnel
authorPetr Machata <petrm@mellanox.com>
Mon, 18 Nov 2019 07:18:42 +0000 (09:18 +0200)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:14 +0000 (14:21 -0300)
commit5958d59cfd603e83c6f4271b8196c9ac7ecb96b7
tree8dc0c876e233cdd5b2cd1b228758960142ad0a83
parenta9dc8a10ac4d1b86f989af9643680977c1ed47a9
mlxsw: spectrum_router: Fix determining underlay for a GRE tunnel

BugLink: https://bugs.launchpad.net/bugs/1854975
[ Upstream commit 1fc1657775dc1b19e9ac1d46b4054ed8ae5d99ab ]

The helper mlxsw_sp_ipip_dev_ul_tb_id() determines the underlay VRF of a
GRE tunnel. For a tunnel without a bound device, it uses the same VRF that
the tunnel is in. However in Linux, a GRE tunnel without a bound device
uses the main VRF as the underlay. Fix the function accordingly.

mlxsw further assumed that moving a tunnel to a different VRF could cause
conflict in local tunnel endpoint address, which cannot be offloaded.
However, the only way that an underlay could be changed by moving the
tunnel device itself is if the tunnel device does not have a bound device.
But in that case the underlay is always the main VRF, so there is no
opportunity to introduce a conflict by moving such device. Thus this check
constitutes a dead code, and can be removed, which do.

Fixes: 6ddb7426a7d4 ("mlxsw: spectrum_router: Introduce loopback RIFs")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c