@@ -590,16 +590,8 @@ static int gswip_port_vlan_filtering(struct dsa_switch *ds, int port,
590590 bool vlan_filtering ,
591591 struct netlink_ext_ack * extack )
592592{
593- struct net_device * bridge = dsa_port_bridge_dev_get (dsa_to_port (ds , port ));
594593 struct gswip_priv * priv = ds -> priv ;
595594
596- /* Do not allow changing the VLAN filtering options while in bridge */
597- if (bridge && !!(priv -> port_vlan_filter & BIT (port )) != vlan_filtering ) {
598- NL_SET_ERR_MSG_MOD (extack ,
599- "Dynamic toggling of vlan_filtering not supported" );
600- return - EIO ;
601- }
602-
603595 if (vlan_filtering ) {
604596 /* Use tag based VLAN */
605597 gswip_switch_mask (priv ,
@@ -927,18 +919,15 @@ static int gswip_port_bridge_join(struct dsa_switch *ds, int port,
927919 struct gswip_priv * priv = ds -> priv ;
928920 int err ;
929921
930- /* When the bridge uses VLAN filtering we have to configure VLAN
931- * specific bridges. No bridge is configured here.
922+ /* Set up the VLAN for VLAN-unaware bridging for this port, and remove
923+ * it from the "single-port bridge" through which it was operating as
924+ * standalone.
932925 */
933- if (!br_vlan_enabled (br )) {
934- err = gswip_vlan_add (priv , br , port , GSWIP_VLAN_UNAWARE_PVID ,
935- true, true, false);
936- if (err )
937- return err ;
938- priv -> port_vlan_filter &= ~BIT (port );
939- } else {
940- priv -> port_vlan_filter |= BIT (port );
941- }
926+ err = gswip_vlan_add (priv , br , port , GSWIP_VLAN_UNAWARE_PVID ,
927+ true, true, false);
928+ if (err )
929+ return err ;
930+
942931 return gswip_add_single_port_br (priv , port , false);
943932}
944933
@@ -948,14 +937,11 @@ static void gswip_port_bridge_leave(struct dsa_switch *ds, int port,
948937 struct net_device * br = bridge .dev ;
949938 struct gswip_priv * priv = ds -> priv ;
950939
951- gswip_add_single_port_br (priv , port , true);
952-
953- /* When the bridge uses VLAN filtering we have to configure VLAN
954- * specific bridges. No bridge is configured here.
940+ /* Add the port back to the "single-port bridge", and remove it from
941+ * the VLAN-unaware PVID created for this bridge.
955942 */
956- if (!br_vlan_enabled (br ))
957- gswip_vlan_remove (priv , br , port , GSWIP_VLAN_UNAWARE_PVID , true,
958- false);
943+ gswip_add_single_port_br (priv , port , true);
944+ gswip_vlan_remove (priv , br , port , GSWIP_VLAN_UNAWARE_PVID , true, false);
959945}
960946
961947static int gswip_port_vlan_prepare (struct dsa_switch * ds , int port ,
0 commit comments