Skip to contentSkip to conversation

net: dsa: mt7530: enable MTU normalization

PATCH Applied DENG Qingfang 4 participants 4 messages Dec 10, 2020 – Dec 13, 2020

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: mt7530: enable MTU normalization

MT7530 has a global RX length register, so we are actually changing its MRU.
Enable MTU normalization for this reason.

---
 drivers/net/dsa/mt7530.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/dsa/mt7530.c +2 -0
index 99bf8fed6536..a67cac15a724 100644
@@ -1657,6 +1657,7 @@ mt7530_setup(struct dsa_switch *ds)
 	 */
 	dn = dsa_to_port(ds, MT7530_CPU_PORT)->master->dev.of_node->parent;
 	ds->configure_vlan_while_not_filtering = true;
+	ds->mtu_enforcement_ingress = true;
 
 	if (priv->id == ID_MT7530) {
 		regulator_set_voltage(priv->core_pwr, 1000000, 1000000);
@@ -1895,6 +1896,7 @@ mt7531_setup(struct dsa_switch *ds)
 	}
 
 	ds->configure_vlan_while_not_filtering = true;
+	ds->mtu_enforcement_ingress = true;
 
 	/* Flush the FDB table */
 	ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
Signature · 7 lines
2.25.1


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to DENG Qingfang
Quoted 6 lines · DENG Qingfang

MT7530 has a global RX length register, so we are actually changing its MRU.
Enable MTU normalization for this reason.

---

Makes sense. Since it's global and not per port, this also helps the stack to be aware of the fact that all bridged interfaces have the same MTU. We could probably do a little bit better by also informing the standalone interfaces about the updated MTU, but since the value that we program into the standalone ports is >= than what the stack knows about, there isn't an issue really.

Quoted 24 lines
 drivers/net/dsa/mt7530.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/dsa/mt7530.c +2 -1
index 99bf8fed6536..a67cac15a724 100644
@@ -1657,6 +1657,7 @@ mt7530_setup(struct dsa_switch *ds)
 	 */
 	dn = dsa_to_port(ds, MT7530_CPU_PORT)->master->dev.of_node->parent;
 	ds->configure_vlan_while_not_filtering = true;
+	ds->mtu_enforcement_ingress = true;
 
 	if (priv->id == ID_MT7530) {
 		regulator_set_voltage(priv->core_pwr, 1000000, 1000000);
@@ -1895,6 +1896,7 @@ mt7531_setup(struct dsa_switch *ds)
 	}
 
 	ds->configure_vlan_while_not_filtering = true;
+	ds->mtu_enforcement_ingress = true;
 
 	/* Flush the FDB table */
 	ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
--
Quoted 2 lines

2.25.1

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

maintainer Applied
#3 lore raw
In reply to DENG Qingfang
Quoted 5 lines · On Fri, 11 Dec 2020 01:03:22 +0800 DENG Qingfang wrote:

MT7530 has a global RX length register, so we are actually changing its MRU.
Enable MTU normalization for this reason.

Applied, thanks and thanks for the reviews.

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek