aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Abeni <[email protected]>2024-07-18 13:09:13 +0200
committerPaolo Abeni <[email protected]>2024-07-18 13:09:14 +0200
commit269521e250699b312876d85e6ab2279c6d16e91d (patch)
tree686a917918c995757d44e50943c88da5a6975907
parent4e076ff6ad5302c015617da30d877b4cdcbdf613 (diff)
parentc5118072e228e7e4385fc5ac46b2e31cf6c4f2d3 (diff)
Merge branch 'net-dsa-fix-chip-wide-frame-size-config-in-some-drivers'
Martin Willi says: ==================== net: dsa: Fix chip-wide frame size config in some drivers Some DSA chips support a chip-wide frame size configurations, only. Some drivers adjust that chip-wide setting for user port changes, overriding the frame size requirements on the CPU port that includes tagger overhead. Fix the mv88e6xxx and b53 drivers and align them to the behavior of other drivers. v2: - Skip chip-wide config for non-CPU ports instead of finding the maximim MTU over all ports - Add a patch fixing the b53 driver as well v1: https://lore.kernel.org/netdev/[email protected]/ ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
-rw-r--r--drivers/net/dsa/b53/b53_common.c3
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 8f50abe739b7..0783fc121bbb 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2256,6 +2256,9 @@ static int b53_change_mtu(struct dsa_switch *ds, int port, int mtu)
if (is5325(dev) || is5365(dev))
return -EOPNOTSUPP;
+ if (!dsa_is_cpu_port(ds, port))
+ return 0;
+
enable_jumbo = (mtu >= JMS_MIN_SIZE);
allow_10_100 = (dev->chip_id == BCM583XX_DEVICE_ID);
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 07c897b13de1..5b4e2ce5470d 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3626,7 +3626,8 @@ static int mv88e6xxx_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
mv88e6xxx_reg_lock(chip);
if (chip->info->ops->port_set_jumbo_size)
ret = chip->info->ops->port_set_jumbo_size(chip, port, new_mtu);
- else if (chip->info->ops->set_max_frame_size)
+ else if (chip->info->ops->set_max_frame_size &&
+ dsa_is_cpu_port(ds, port))
ret = chip->info->ops->set_max_frame_size(chip, new_mtu);
mv88e6xxx_reg_unlock(chip);