Commit 6b72a770 authored by Elad Raz's avatar Elad Raz Committed by David S. Miller

bridge: add vlan filtering change notification

Notifying hardware about bridge vlan-aware changes.
Signed-off-by: default avatarElad Raz <eladr@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 81435c33
......@@ -626,9 +626,21 @@ void br_recalculate_fwd_mask(struct net_bridge *br)
int __br_vlan_filter_toggle(struct net_bridge *br, unsigned long val)
{
struct switchdev_attr attr = {
.orig_dev = br->dev,
.id = SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING,
.flags = SWITCHDEV_F_SKIP_EOPNOTSUPP,
.u.vlan_filtering = val,
};
int err;
if (br->vlan_enabled == val)
return 0;
err = switchdev_port_attr_set(br->dev, &attr);
if (err && err != -EOPNOTSUPP)
return err;
br->vlan_enabled = val;
br_manage_promisc(br);
recalculate_group_addr(br);
......@@ -639,13 +651,15 @@ int __br_vlan_filter_toggle(struct net_bridge *br, unsigned long val)
int br_vlan_filter_toggle(struct net_bridge *br, unsigned long val)
{
int err;
if (!rtnl_trylock())
return restart_syscall();
__br_vlan_filter_toggle(br, val);
err = __br_vlan_filter_toggle(br, val);
rtnl_unlock();
return 0;
return err;
}
int __br_vlan_set_proto(struct net_bridge *br, __be16 proto)
......
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