Skip to content

Commit 269521e

Browse files
author
Paolo Abeni
committed
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]>
2 parents 4e076ff + c511807 commit 269521e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,6 +2256,9 @@ static int b53_change_mtu(struct dsa_switch *ds, int port, int mtu)
22562256
if (is5325(dev) || is5365(dev))
22572257
return -EOPNOTSUPP;
22582258

2259+
if (!dsa_is_cpu_port(ds, port))
2260+
return 0;
2261+
22592262
enable_jumbo = (mtu >= JMS_MIN_SIZE);
22602263
allow_10_100 = (dev->chip_id == BCM583XX_DEVICE_ID);
22612264

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3626,7 +3626,8 @@ static int mv88e6xxx_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
36263626
mv88e6xxx_reg_lock(chip);
36273627
if (chip->info->ops->port_set_jumbo_size)
36283628
ret = chip->info->ops->port_set_jumbo_size(chip, port, new_mtu);
3629-
else if (chip->info->ops->set_max_frame_size)
3629+
else if (chip->info->ops->set_max_frame_size &&
3630+
dsa_is_cpu_port(ds, port))
36303631
ret = chip->info->ops->set_max_frame_size(chip, new_mtu);
36313632
mv88e6xxx_reg_unlock(chip);
36323633

0 commit comments

Comments
 (0)