提交 404cdbf0 编写于 作者: E Elad Raz 提交者: David S. Miller

bridge: add vlan filtering change for new bridged device

Notifying hardware about newly bridged port vlan-aware changes.
Signed-off-by: NElad Raz <eladr@mellanox.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6b72a770
...@@ -907,6 +907,12 @@ int br_vlan_init(struct net_bridge *br) ...@@ -907,6 +907,12 @@ int br_vlan_init(struct net_bridge *br)
int nbp_vlan_init(struct net_bridge_port *p) int nbp_vlan_init(struct net_bridge_port *p)
{ {
struct switchdev_attr attr = {
.orig_dev = p->br->dev,
.id = SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING,
.flags = SWITCHDEV_F_SKIP_EOPNOTSUPP,
.u.vlan_filtering = p->br->vlan_enabled,
};
struct net_bridge_vlan_group *vg; struct net_bridge_vlan_group *vg;
int ret = -ENOMEM; int ret = -ENOMEM;
...@@ -914,6 +920,10 @@ int nbp_vlan_init(struct net_bridge_port *p) ...@@ -914,6 +920,10 @@ int nbp_vlan_init(struct net_bridge_port *p)
if (!vg) if (!vg)
goto out; goto out;
ret = switchdev_port_attr_set(p->dev, &attr);
if (ret && ret != -EOPNOTSUPP)
goto err_vlan_enabled;
ret = rhashtable_init(&vg->vlan_hash, &br_vlan_rht_params); ret = rhashtable_init(&vg->vlan_hash, &br_vlan_rht_params);
if (ret) if (ret)
goto err_rhtbl; goto err_rhtbl;
...@@ -933,6 +943,7 @@ int nbp_vlan_init(struct net_bridge_port *p) ...@@ -933,6 +943,7 @@ int nbp_vlan_init(struct net_bridge_port *p)
RCU_INIT_POINTER(p->vlgrp, NULL); RCU_INIT_POINTER(p->vlgrp, NULL);
synchronize_rcu(); synchronize_rcu();
rhashtable_destroy(&vg->vlan_hash); rhashtable_destroy(&vg->vlan_hash);
err_vlan_enabled:
err_rhtbl: err_rhtbl:
kfree(vg); kfree(vg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册