]> git.baikalelectronics.ru Git - kernel.git/commit
net: bridge: Export bridge multicast router state
authorYotam Gigi <yotamg@mellanox.com>
Mon, 9 Oct 2017 09:15:32 +0000 (11:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Oct 2017 17:18:11 +0000 (10:18 -0700)
commit23564301834c312b814c6310d3f3ea35c6d5ba80
treee9781f8b94b8c472e05281683fa9988c43a4e3a2
parent0fcf6568e0311616e23657a57e04f1ec34a72971
net: bridge: Export bridge multicast router state

Add an access function that, given a bridge netdevice, returns whether the
bridge device is currently an mrouter or not. The function uses the already
existing br_multicast_is_router function to check that.

This function is needed in order to allow ports that join an already
existing bridge to know the current mrouter state of the bridge device.
Together with the bridge device mrouter ports switchdev notifications, it
is possible to have full offloading of the semantics of the bridge device
mcast router state.

Due to the fact that the bridge multicast router status can change in
packet RX path, take the multicast_router bridge spinlock to protect the
read.

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Reviewed-by: Nogah Frankel <nogahf@mellanox.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/if_bridge.h
net/bridge/br_multicast.c