Commit e56c6260 authored by Florian Fainelli's avatar Florian Fainelli Committed by Zheng Zengkai
Browse files

net: dsa: b53: VLAN filtering is global to all users



stable inclusion
from stable-5.10.27
commit 39e1a35ea65ab60bbc8fdd8d5c547ad77204b222
bugzilla: 51493

--------------------------------

commit d45c36ba upstream.

The bcm_sf2 driver uses the b53 driver as a library but does not make
usre of the b53_setup() function, this made it fail to inherit the
vlan_filtering_is_global attribute. Fix this by moving the assignment to
b53_switch_alloc() which is used by bcm_sf2.

Fixes: 7228b23e ("net: dsa: b53: Let DSA handle mismatched VLAN filtering settings")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatar&nbsp; Weilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 7acccaa2
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1070,13 +1070,6 @@ static int b53_setup(struct dsa_switch *ds)
			b53_disable_port(ds, port);
	}

	/* Let DSA handle the case were multiple bridges span the same switch
	 * device and different VLAN awareness settings are requested, which
	 * would be breaking filtering semantics for any of the other bridge
	 * devices. (not hardware supported)
	 */
	ds->vlan_filtering_is_global = true;

	return b53_setup_devlink_resources(ds);
}

@@ -2627,6 +2620,13 @@ struct b53_device *b53_switch_alloc(struct device *base,
	ds->configure_vlan_while_not_filtering = true;
	ds->untag_bridge_pvid = true;
	dev->vlan_enabled = ds->configure_vlan_while_not_filtering;
	/* Let DSA handle the case were multiple bridges span the same switch
	 * device and different VLAN awareness settings are requested, which
	 * would be breaking filtering semantics for any of the other bridge
	 * devices. (not hardware supported)
	 */
	ds->vlan_filtering_is_global = true;

	mutex_init(&dev->reg_mutex);
	mutex_init(&dev->stats_mutex);