[PATCH net-next v5 5/5] net: dsa: microchip: enable MTU normalization for KSZ8795 and KSZ9477 compatible switches
From: Oleksij Rempel
Date: Wed Nov 23 2022 - 06:27:26 EST
KSZ8795 and KSZ9477 compatible series of switches use global max frame
size configuration register. So, enable MTU normalization for this reason.
Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
drivers/net/dsa/microchip/ksz8795.c | 2 ++
drivers/net/dsa/microchip/ksz9477.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
index d01bfd609130..d88d0b989e1a 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8795.c
@@ -1426,6 +1426,8 @@ int ksz8_switch_init(struct ksz_device *dev)
*/
dev->ds->vlan_filtering_is_global = true;
+ dev->ds->mtu_enforcement_ingress = true;
+
return 0;
}
diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
index f6e7968ab105..4fb07fbdf565 100644
--- a/drivers/net/dsa/microchip/ksz9477.c
+++ b/drivers/net/dsa/microchip/ksz9477.c
@@ -1134,6 +1134,8 @@ int ksz9477_setup(struct dsa_switch *ds)
struct ksz_device *dev = ds->priv;
int ret = 0;
+ dev->ds->mtu_enforcement_ingress = true;
+
/* Required for port partitioning. */
ksz9477_cfg32(dev, REG_SW_QM_CTRL__4, UNICAST_VLAN_BOUNDARY,
true);
--
2.30.2