mlxsw: spectrum_router: Associate RIFs with correct VR
authorIdo Schimmel <idosch@mellanox.com>
Thu, 16 Mar 2017 08:08:16 +0000 (09:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Mar 2017 17:18:34 +0000 (10:18 -0700)
commit57837885e3c74e42596a8d8c3e6831be1c0a7974
treee3bead7b5d6642713089397224c68fdf0d0a89fd
parentfdeea7be88b12742bfd50d9e19a06c0d2e702400
mlxsw: spectrum_router: Associate RIFs with correct VR

When a router interface (RIF) is created due to a netdev being enslaved
to a VRF master, then it should be associated with the appropriate
virtual router (VR) and not the default one.

If netdev is a VRF slave, lookup the VR based on the VRF's table ID.
Otherwise default to the MAIN table.

Signed-off-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