[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190820000002.9776-4-olteanv@gmail.com>
Date: Tue, 20 Aug 2019 02:59:59 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: f.fainelli@...il.com, vivien.didelot@...il.com, andrew@...n.ch,
idosch@...sch.org, roopa@...ulusnetworks.com,
nikolay@...ulusnetworks.com, davem@...emloft.net
Cc: netdev@...r.kernel.org, Vladimir Oltean <olteanv@...il.com>
Subject: [PATCH net-next 3/6] net: dsa: Delete the VID from the upstream port as well
Commit b2f81d304cee ("net: dsa: add CPU and DSA ports as VLAN members")
is littering a lot. After deleting a VLAN added on a DSA port, it still
remains installed in the hardware filter of the upstream port. Fix this.
Signed-off-by: Vladimir Oltean <olteanv@...il.com>
---
net/dsa/switch.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/dsa/switch.c b/net/dsa/switch.c
index 09d9286b27cc..84ab2336131e 100644
--- a/net/dsa/switch.c
+++ b/net/dsa/switch.c
@@ -295,11 +295,20 @@ static int dsa_switch_vlan_del(struct dsa_switch *ds,
struct dsa_notifier_vlan_info *info)
{
const struct switchdev_obj_port_vlan *vlan = info->vlan;
+ int port;
if (!ds->ops->port_vlan_del)
return -EOPNOTSUPP;
+ /* Build a mask of VLAN members */
+ bitmap_zero(ds->bitmap, ds->num_ports);
if (ds->index == info->sw_index)
+ set_bit(info->port, ds->bitmap);
+ for (port = 0; port < ds->num_ports; port++)
+ if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))
+ set_bit(port, ds->bitmap);
+
+ for_each_set_bit(port, ds->bitmap, ds->num_ports)
return ds->ops->port_vlan_del(ds, info->port, vlan);
return 0;
--
2.17.1
Powered by blists - more mailing lists