aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2024-07-18 13:09:13 +0200
committerPaolo Abeni <pabeni@redhat.com>2024-07-18 13:09:14 +0200
commit269521e250699b312876d85e6ab2279c6d16e91d (patch)
tree686a917918c995757d44e50943c88da5a6975907
parentnet: airoha: Fix NULL pointer dereference in airoha_qdma_cleanup_rx_queue() (diff)
parentnet: dsa: b53: Limit chip-wide jumbo frame config to CPU ports (diff)
downloadwireguard-linux-269521e250699b312876d85e6ab2279c6d16e91d.tar.xz
wireguard-linux-269521e250699b312876d85e6ab2279c6d16e91d.zip
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/20240716120808.396514-1-martin@strongswan.org/ ==================== Link: https://patch.msgid.link/20240717090820.894234-1-martin@strongswan.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to '')
-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);