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 --- a/net/dsa/switch.c
26 +++ b/net/dsa/switch.c
27 @@ -104,23 +104,12 @@ static int dsa_switch_bridge_join(struct
31 -static int dsa_switch_bridge_leave(struct dsa_switch *ds,
32 - struct dsa_notifier_bridge_info *info)
33 +static int dsa_switch_sync_vlan_filtering(struct dsa_switch *ds,
34 + struct dsa_notifier_bridge_info *info)
36 bool unset_vlan_filtering = br_vlan_enabled(info->br);
37 - struct dsa_switch_tree *dst = ds->dst;
40 - if (dst->index == info->tree_index && ds->index == info->sw_index &&
41 - ds->ops->port_bridge_leave)
42 - ds->ops->port_bridge_leave(ds, info->port, info->br);
44 - if ((dst->index != info->tree_index || ds->index != info->sw_index) &&
45 - ds->ops->crosschip_bridge_leave)
46 - ds->ops->crosschip_bridge_leave(ds, info->tree_index,
47 - info->sw_index, info->port,
50 /* If the bridge was vlan_filtering, the bridge core doesn't trigger an
51 * event for changing vlan_filtering setting upon slave ports leaving
52 * it. That is a good thing, because that lets us handle it and also
53 @@ -153,6 +142,30 @@ static int dsa_switch_bridge_leave(struc
54 if (err && err != EOPNOTSUPP)
61 +static int dsa_switch_bridge_leave(struct dsa_switch *ds,
62 + struct dsa_notifier_bridge_info *info)
64 + struct dsa_switch_tree *dst = ds->dst;
67 + if (dst->index == info->tree_index && ds->index == info->sw_index &&
68 + ds->ops->port_bridge_leave)
69 + ds->ops->port_bridge_leave(ds, info->port, info->br);
71 + if ((dst->index != info->tree_index || ds->index != info->sw_index) &&
72 + ds->ops->crosschip_bridge_leave)
73 + ds->ops->crosschip_bridge_leave(ds, info->tree_index,
74 + info->sw_index, info->port,
77 + err = dsa_switch_sync_vlan_filtering(ds, info);