1 From 7164a8cde4b42f76474088ccaf53f1e463d4e2f6 Mon Sep 17 00:00:00 2001
2 From: Tobias Waldekranz <tobias@waldekranz.com>
3 Date: Mon, 24 Jan 2022 22:09:43 +0100
4 Subject: [PATCH 5.10 1/2] net: dsa: Move VLAN filtering syncing out of
5 dsa_switch_bridge_leave
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 commit 381a730182f1d174e1950cd4e63e885b1c302051 upstream.
12 Most of dsa_switch_bridge_leave was, in fact, dealing with the syncing
13 of VLAN filtering for switches on which that is a global
14 setting. Separate the two phases to prepare for the cross-chip related
15 bugfix in the following commit.
17 Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
18 Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
19 Signed-off-by: David S. Miller <davem@davemloft.net>
20 Signed-off-by: Marek BehĂșn <kabel@kernel.org>
22 net/dsa/switch.c | 39 ++++++++++++++++++++++++++-------------
23 1 file changed, 26 insertions(+), 13 deletions(-)
25 diff --git a/net/dsa/switch.c b/net/dsa/switch.c
26 index a44035872cff..659fd979cc0a 100644
27 --- a/net/dsa/switch.c
28 +++ b/net/dsa/switch.c
29 @@ -104,23 +104,12 @@ static int dsa_switch_bridge_join(struct dsa_switch *ds,
33 -static int dsa_switch_bridge_leave(struct dsa_switch *ds,
34 - struct dsa_notifier_bridge_info *info)
35 +static int dsa_switch_sync_vlan_filtering(struct dsa_switch *ds,
36 + struct dsa_notifier_bridge_info *info)
38 bool unset_vlan_filtering = br_vlan_enabled(info->br);
39 - struct dsa_switch_tree *dst = ds->dst;
42 - if (dst->index == info->tree_index && ds->index == info->sw_index &&
43 - ds->ops->port_bridge_leave)
44 - ds->ops->port_bridge_leave(ds, info->port, info->br);
46 - if ((dst->index != info->tree_index || ds->index != info->sw_index) &&
47 - ds->ops->crosschip_bridge_leave)
48 - ds->ops->crosschip_bridge_leave(ds, info->tree_index,
49 - info->sw_index, info->port,
52 /* If the bridge was vlan_filtering, the bridge core doesn't trigger an
53 * event for changing vlan_filtering setting upon slave ports leaving
54 * it. That is a good thing, because that lets us handle it and also
55 @@ -153,6 +142,30 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds,
56 if (err && err != EOPNOTSUPP)
63 +static int dsa_switch_bridge_leave(struct dsa_switch *ds,
64 + struct dsa_notifier_bridge_info *info)
66 + struct dsa_switch_tree *dst = ds->dst;
69 + if (dst->index == info->tree_index && ds->index == info->sw_index &&
70 + ds->ops->port_bridge_leave)
71 + ds->ops->port_bridge_leave(ds, info->port, info->br);
73 + if ((dst->index != info->tree_index || ds->index != info->sw_index) &&
74 + ds->ops->crosschip_bridge_leave)
75 + ds->ops->crosschip_bridge_leave(ds, info->tree_index,
76 + info->sw_index, info->port,
79 + err = dsa_switch_sync_vlan_filtering(ds, info);