OSDN Git Service

mlxsw: spectrum_router: Demote tunnels on VRF migration
authorPetr Machata <petrm@mellanox.com>
Tue, 28 Nov 2017 12:17:12 +0000 (13:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Nov 2017 14:55:47 +0000 (09:55 -0500)
commitcab43d9c877456d2d8feb77335327316d3de9871
tree276497b7c0ea8501b4f29ef0a5a377dd4b35b135
parent57c77ce47063bd298e31ffcf7875ed0c2633bf8d
mlxsw: spectrum_router: Demote tunnels on VRF migration

The mlxsw driver currently doesn't offload GRE tunnels if they have the
same local address and use the same underlay VRF. When such a situation
arises, the tunnels in conflict are demoted to slow path.

However, the current code only verifies this condition on tunnel
creation and tunnel change, not when a tunnel is moved to a different
VRF. When the tunnel has no bound device, underlay and overlay are the
same. Thus moving a tunnel moves the underlay as well, and that can
cause local address conflict.

So modify mlxsw_sp_netdevice_ipip_ol_vrf_event() to check if there are
any conflicting tunnels, and demote them if yes.

Fixes: af641713e97d ("mlxsw: spectrum_router: Onload conflicting tunnels")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c