mlxsw: spectrum_router: Explicitly Associate RIFs with VRs
authorIdo Schimmel <idosch@mellanox.com>
Fri, 10 Mar 2017 07:53:42 +0000 (08:53 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Mar 2017 17:36:06 +0000 (09:36 -0800)
commit6913229eea27e63df086f55372e52021727fd0a7
treebae079fd071ce13ffd4f15c5169bc23e2eae6d62
parent76610ebbde1883527cf5afa8708a5b0599439a28
mlxsw: spectrum_router: Explicitly Associate RIFs with VRs

Up until now we implicitly associated all the router interfaces (RIFs)
with the first virtual router (VR). This must be changed in order to
enable VRF offload. Otherwise, a packet received via a VRF slave would
do a FIB lookup in the same table used by other VRFs.

Instead, bind the RIF to a VR according to the table where FIB lookup
should be performed for packets received via the RIF.

Currently, we only care about the MAIN and LOCAL tables (which we squash
together).

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/reg.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c