mlxsw: spectrum_router: Direct macvlans' MACs to router
authorIdo Schimmel <idosch@mellanox.com>
Sat, 14 Jul 2018 08:39:52 +0000 (11:39 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Jul 2018 18:23:26 +0000 (11:23 -0700)
commit2db9937804ac23dc45e35f47dbf93ded516e8b58
tree5b2ab47261fb163d6664e28ec63ec0c5393eb10b
parentc55161852fe852edd9e615768835e59059695990
mlxsw: spectrum_router: Direct macvlans' MACs to router

An IP packet received on a netdev with a macvlan upper whose MAC matches
the packet's destination MAC will be re-injected to the Rx path as if it
was received by the macvlan, and perform an L3 lookup.

Reflect this functionality to the ASIC by programming FDB entries that
will direct MACs of macvlan uppers to the router.

In a similar fashion to router interfaces (RIFs) that are programmed
upon the addition of the first IP address on an interface and destroyed
upon the removal of the last IP address, the FDB entries for the macvlan
are added and destroyed based on the addition of the first and removal
of the last IP address on the macvlan.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@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