aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch
diff options
context:
space:
mode:
authorDENG Qingfang <dengqf6@mail2.sysu.edu.cn>2020-04-20 21:37:17 +0800
committerFelix Fietkau <nbd@nbd.name>2020-06-04 22:21:42 +0200
commitdc4ffaa5ab6830ba9c5b9d9569db2c2aef26755a (patch)
tree0e05c2bb5e301308363150b13e07d61c50c6e2c3 /target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch
parentd56d05f01f03f9cc2afa7d91a2033f2288a51f9c (diff)
downloadupstream-dc4ffaa5ab6830ba9c5b9d9569db2c2aef26755a.tar.gz
upstream-dc4ffaa5ab6830ba9c5b9d9569db2c2aef26755a.tar.bz2
upstream-dc4ffaa5ab6830ba9c5b9d9569db2c2aef26755a.zip
generic: fix DSA VLAN filtering
Currently enabling VLAN filtering blocks all traffic in the bridge immediately. That is because DSA ignores all VLAN setup when VLAN filtering is disabled, and when it is enabled, there is no VLAN entry in the VLAN table, causing all traffic to be blocked. Add patches to allow VLAN setup even if VLAN filtering is disabled. Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Diffstat (limited to 'target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch')
-rw-r--r--target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch b/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch
new file mode 100644
index 0000000000..8d64d2e672
--- /dev/null
+++ b/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch
@@ -0,0 +1,51 @@
+From 0141792f8b7300006b874dda1c35acd0abd90d9d Mon Sep 17 00:00:00 2001
+From: DENG Qingfang <dqfext@gmail.com>
+Date: Fri, 15 May 2020 23:25:55 +0800
+Subject: net: dsa: mt7530: fix VLAN setup
+
+Allow DSA to add VLAN entries even if VLAN filtering is disabled, so
+enabling it will not block the traffic of existent ports in the bridge
+
+Signed-off-by: DENG Qingfang <dqfext@gmail.com>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/dsa/mt7530.c | 13 +------------
+ 1 file changed, 1 insertion(+), 12 deletions(-)
+
+--- a/drivers/net/dsa/mt7530.c
++++ b/drivers/net/dsa/mt7530.c
+@@ -1096,12 +1096,6 @@ mt7530_port_vlan_add(struct dsa_switch *
+ struct mt7530_priv *priv = ds->priv;
+ u16 vid;
+
+- /* The port is kept as VLAN-unaware if bridge with vlan_filtering not
+- * being set.
+- */
+- if (!dsa_port_is_vlan_filtering(&ds->ports[port]))
+- return;
+-
+ mutex_lock(&priv->reg_mutex);
+
+ for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) {
+@@ -1127,12 +1121,6 @@ mt7530_port_vlan_del(struct dsa_switch *
+ struct mt7530_priv *priv = ds->priv;
+ u16 vid, pvid;
+
+- /* The port is kept as VLAN-unaware if bridge with vlan_filtering not
+- * being set.
+- */
+- if (!dsa_port_is_vlan_filtering(&ds->ports[port]))
+- return 0;
+-
+ mutex_lock(&priv->reg_mutex);
+
+ pvid = priv->ports[port].pvid;
+@@ -1245,6 +1233,7 @@ mt7530_setup(struct dsa_switch *ds)
+ * as two netdev instances.
+ */
+ dn = ds->ports[MT7530_CPU_PORT].master->dev.of_node->parent;
++ ds->configure_vlan_while_not_filtering = true;
+
+ if (priv->id == ID_MT7530) {
+ regulator_set_voltage(priv->core_pwr, 1000000, 1000000);