1 From dee0f71c39afdaa30af7b94af420ca1d5c0f0349 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.4 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 | 31 ++++++++++++++++++++++---------
23 1 file changed, 22 insertions(+), 9 deletions(-)
25 --- a/net/dsa/switch.c
26 +++ b/net/dsa/switch.c
27 @@ -65,19 +65,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);
39 - if (ds->index == info->sw_index && ds->ops->port_bridge_leave)
40 - ds->ops->port_bridge_leave(ds, info->port, info->br);
42 - if (ds->index != info->sw_index && ds->ops->crosschip_bridge_leave)
43 - ds->ops->crosschip_bridge_leave(ds, info->sw_index, info->port,
46 /* If the bridge was vlan_filtering, the bridge core doesn't trigger an
47 * event for changing vlan_filtering setting upon slave ports leaving
48 * it. That is a good thing, because that lets us handle it and also
49 @@ -103,6 +96,26 @@ static int dsa_switch_bridge_leave(struc
50 if (err && err != EOPNOTSUPP)
57 +static int dsa_switch_bridge_leave(struct dsa_switch *ds,
58 + struct dsa_notifier_bridge_info *info)
62 + if (ds->index == info->sw_index && ds->ops->port_bridge_leave)
63 + ds->ops->port_bridge_leave(ds, info->port, info->br);
65 + if (ds->index != info->sw_index && ds->ops->crosschip_bridge_leave)
66 + ds->ops->crosschip_bridge_leave(ds, info->sw_index, info->port,
69 + err = dsa_switch_sync_vlan_filtering(ds, info);