Commit 085ddc87 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

bridge: Allow querying bridge port flags

Allow querying bridge port flags so that drivers capable of performing
VxLAN learning will update the bridge driver only if learning is enabled
on its bridge port corresponding to the VxLAN device.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Reviewed-by: default avatarPetr Machata <petrm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40051c4d
...@@ -119,6 +119,7 @@ static inline int br_vlan_get_info(const struct net_device *dev, u16 vid, ...@@ -119,6 +119,7 @@ static inline int br_vlan_get_info(const struct net_device *dev, u16 vid,
struct net_device *br_fdb_find_port(const struct net_device *br_dev, struct net_device *br_fdb_find_port(const struct net_device *br_dev,
const unsigned char *addr, const unsigned char *addr,
__u16 vid); __u16 vid);
bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag);
#else #else
static inline struct net_device * static inline struct net_device *
br_fdb_find_port(const struct net_device *br_dev, br_fdb_find_port(const struct net_device *br_dev,
...@@ -127,6 +128,11 @@ br_fdb_find_port(const struct net_device *br_dev, ...@@ -127,6 +128,11 @@ br_fdb_find_port(const struct net_device *br_dev,
{ {
return NULL; return NULL;
} }
static inline bool
br_port_flag_is_set(const struct net_device *dev, unsigned long flag)
{
return false;
}
#endif #endif
#endif #endif
...@@ -741,3 +741,15 @@ void br_port_flags_change(struct net_bridge_port *p, unsigned long mask) ...@@ -741,3 +741,15 @@ void br_port_flags_change(struct net_bridge_port *p, unsigned long mask)
if (mask & BR_NEIGH_SUPPRESS) if (mask & BR_NEIGH_SUPPRESS)
br_recalculate_neigh_suppress_enabled(br); br_recalculate_neigh_suppress_enabled(br);
} }
bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag)
{
struct net_bridge_port *p;
p = br_port_get_rtnl_rcu(dev);
if (!p)
return false;
return p->flags & flag;
}
EXPORT_SYMBOL_GPL(br_port_flag_is_set);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment