]> asedeno.scripts.mit.edu Git - linux.git/commit
mlxsw: spectrum_switchdev: Support bridge mrouter notifications
authorYotam Gigi <yotamg@mellanox.com>
Mon, 9 Oct 2017 09:15:35 +0000 (11:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Oct 2017 17:18:11 +0000 (10:18 -0700)
commit593bc28ae211b864e7e0720ffc65a14cc5cff101
tree7dbb7fb51d137a8f01d30c72352fe1c4c028be75
parentc4db953f00f09003519ac1fb078f3b5f57b32e3c
mlxsw: spectrum_switchdev: Support bridge mrouter notifications

Support the SWITCHDEV_ATTR_ID_BRIDGE_MROUTER port attribute switchdev
notification.

To do that, add the mrouter flag to struct mlxsw_sp_bridge_device, which
indicates whether the bridge device was set to be mrouter port. This field
is set when:
 - A new bridge is created, where the value is taken from the kernel
   bridge value.
 - A switchdev SWITCHDEV_ATTR_ID_BRIDGE_MROUTER notification is sent.

In addition, change the bridge MID entries to include the router port when
the bridge device is configured to be mrouter port. The MID entries are
updated in the following cases:
 - When a new MID entry is created, update the router port according to the
   bridge mrouter state.
 - When a SWITCHDEV_ATTR_ID_BRIDGE_MROUTER notification is sent, update all
   the bridge's MID entries.

This is aligned with the case where a bridge slave is configured to be
mrouter port.

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Reviewed-by: Nogah Frankel <nogahf@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_switchdev.c