diff options
author | Arkadi Sharshevsky <arkadis@mellanox.com> | 2017-06-08 08:44:12 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-08 20:16:24 +0200 |
commit | 0baa10fff2c8a8a0e3bca8fb43112ed93c179c38 (patch) | |
tree | 9ba7694bb4d36536b1a0ba8efb0658daacc7723e /net/bridge/br_private.h | |
parent | net: bridge: Add support for offloading port attributes (diff) | |
download | linux-0baa10fff2c8a8a0e3bca8fb43112ed93c179c38.tar.xz linux-0baa10fff2c8a8a0e3bca8fb43112ed93c179c38.zip |
net: bridge: Add support for calling FDB external learning under rcu
This is done as a preparation to moving the switchdev notifier chain
to be atomic. The FDB external learning should be called under rtnl
or rcu.
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@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>
Diffstat (limited to 'net/bridge/br_private.h')
-rw-r--r-- | net/bridge/br_private.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 7f439927a66d..a122684b6a41 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@ -284,6 +284,12 @@ static inline struct net_bridge_port *br_port_get_rtnl(const struct net_device * rtnl_dereference(dev->rx_handler_data) : NULL; } +static inline struct net_bridge_port *br_port_get_rtnl_rcu(const struct net_device *dev) +{ + return br_port_exists(dev) ? + rcu_dereference_rtnl(dev->rx_handler_data) : NULL; +} + struct net_bridge { spinlock_t lock; spinlock_t hash_lock; |