diff mbox series

[net,v2,2/2] net: dsa: b53: Limit chip-wide jumbo frame config to CPU ports

Message ID 20240717090820.894234-3-martin@strongswan.org (mailing list archive)
State Accepted
Commit c5118072e228e7e4385fc5ac46b2e31cf6c4f2d3
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: Fix chip-wide frame size config in some drivers | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 661 this patch: 661
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 1 blamed authors not CCed: florian.fainelli@broadcom.com; 1 maintainers not CCed: florian.fainelli@broadcom.com
netdev/build_clang success Errors and warnings before: 662 this patch: 662
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 662 this patch: 662
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2024-07-18--09-00 (tests: 486)

Commit Message

Martin Willi July 17, 2024, 9:08 a.m. UTC
Broadcom switches supported by the b53 driver use a chip-wide jumbo frame
configuration. In the commit referenced with the Fixes tag, the setting
is applied just for the last port changing its MTU.

While configuring CPU ports accounts for tagger overhead, user ports do
not. When setting the MTU for a user port, the chip-wide setting is
reduced to not include the tagger overhead, resulting in an potentially
insufficient chip-wide maximum frame size for the CPU port.

As, by design, the CPU port MTU is adjusted for any user port change,
apply the chip-wide setting only for CPU ports. This aligns the driver
to the behavior of other switch drivers.

Fixes: 6ae5834b983a ("net: dsa: b53: add MTU configuration support")
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Martin Willi <martin@strongswan.org>
---
 drivers/net/dsa/b53/b53_common.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Vladimir Oltean July 17, 2024, 11:46 a.m. UTC | #1
On Wed, Jul 17, 2024 at 11:08:20AM +0200, Martin Willi wrote:
> Broadcom switches supported by the b53 driver use a chip-wide jumbo frame
> configuration. In the commit referenced with the Fixes tag, the setting
> is applied just for the last port changing its MTU.
> 
> While configuring CPU ports accounts for tagger overhead, user ports do
> not. When setting the MTU for a user port, the chip-wide setting is
> reduced to not include the tagger overhead, resulting in an potentially
> insufficient chip-wide maximum frame size for the CPU port.
> 
> As, by design, the CPU port MTU is adjusted for any user port change,
> apply the chip-wide setting only for CPU ports. This aligns the driver
> to the behavior of other switch drivers.
> 
> Fixes: 6ae5834b983a ("net: dsa: b53: add MTU configuration support")
> Suggested-by: Vladimir Oltean <olteanv@gmail.com>
> Signed-off-by: Martin Willi <martin@strongswan.org>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
diff mbox series

Patch

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);