]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_router: Simplify VRF enslavement
authorIdo Schimmel <idosch@mellanox.com>
Sun, 30 Apr 2017 16:47:14 +0000 (19:47 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 May 2017 15:47:58 +0000 (11:47 -0400)
commit3b57c99db4f8ad2ab7da97a71e1b0242c06735fc
tree7dbe01616807c5c4eb3523326f003c13692f5919
parent8c64fd95ded6d085f0b2cf6afbea66dcea12a771
mlxsw: spectrum_router: Simplify VRF enslavement

When a netdev is enslaved to a VRF master, its router interface (RIF)
needs to be destroyed (if exists) and a new one created using the
corresponding virtual router (VR).

>From the driver's perspective, the above is equivalent to an inetaddr
event sent for this netdev. Therefore, when a port netdev (or its
uppers) are enslaved to a VRF master, call the same function that
would've been called had a NETDEV_UP was sent for this netdev in the
inetaddr notification chain.

This patch also fixes a bug when a LAG netdev with an existing RIF is
enslaved to a VRF. Before this patch, each LAG port would drop the
reference on the RIF, but would re-join the same one (in the wrong VR)
soon after. With this patch, the corresponding RIF is first destroyed
and a new one is created using the correct VR.

Fixes: 983ea935a9de ("mlxsw: spectrum_router: Add support for VRFs")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c