netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] net: dsa: Fix chip-wide frame size config in some drivers
@ 2024-07-17  9:08 Martin Willi
  2024-07-17  9:08 ` [PATCH net v2 1/2] net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports Martin Willi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Martin Willi @ 2024-07-17  9:08 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, Chris Packham,
	Murali Krishna Policharla
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev

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/

Martin Willi (2):
  net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports
  net: dsa: b53: Limit chip-wide jumbo frame config to CPU ports

 drivers/net/dsa/b53/b53_common.c | 3 +++
 drivers/net/dsa/mv88e6xxx/chip.c | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net v2 1/2] net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports
  2024-07-17  9:08 [PATCH net v2 0/2] net: dsa: Fix chip-wide frame size config in some drivers Martin Willi
@ 2024-07-17  9:08 ` Martin Willi
  2024-07-17 11:46   ` Vladimir Oltean
  2024-07-17  9:08 ` [PATCH net v2 2/2] net: dsa: b53: Limit chip-wide jumbo frame " Martin Willi
  2024-07-18 11:30 ` [PATCH net v2 0/2] net: dsa: Fix chip-wide frame size config in some drivers patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Martin Willi @ 2024-07-17  9:08 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, Chris Packham,
	Murali Krishna Policharla
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev

Marvell chips not supporting per-port jumbo frame size configurations use
a chip-wide frame size 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 maximum frame size for the CPU port. Specifically, sending
full-size frames from the CPU port on a MV88E6097 having a user port MTU
of 1500 bytes results in dropped frames.

As, by design, the CPU port MTU is adjusted for any user port change,
apply the chip-wide setting only for CPU ports.

Fixes: 1baf0fac10fb ("net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU")
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Martin Willi <martin@strongswan.org>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net v2 2/2] net: dsa: b53: Limit chip-wide jumbo frame config to CPU ports
  2024-07-17  9:08 [PATCH net v2 0/2] net: dsa: Fix chip-wide frame size config in some drivers Martin Willi
  2024-07-17  9:08 ` [PATCH net v2 1/2] net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports Martin Willi
@ 2024-07-17  9:08 ` Martin Willi
  2024-07-17 11:46   ` Vladimir Oltean
  2024-07-18 11:30 ` [PATCH net v2 0/2] net: dsa: Fix chip-wide frame size config in some drivers patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Martin Willi @ 2024-07-17  9:08 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, Chris Packham,
	Murali Krishna Policharla
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev

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(+)

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net v2 1/2] net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports
  2024-07-17  9:08 ` [PATCH net v2 1/2] net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports Martin Willi
@ 2024-07-17 11:46   ` Vladimir Oltean
  0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2024-07-17 11:46 UTC (permalink / raw)
  To: Martin Willi
  Cc: Andrew Lunn, Florian Fainelli, Chris Packham,
	Murali Krishna Policharla, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev

On Wed, Jul 17, 2024 at 11:08:19AM +0200, Martin Willi wrote:
> Marvell chips not supporting per-port jumbo frame size configurations use
> a chip-wide frame size 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 maximum frame size for the CPU port. Specifically, sending
> full-size frames from the CPU port on a MV88E6097 having a user port MTU
> of 1500 bytes results in dropped frames.
> 
> As, by design, the CPU port MTU is adjusted for any user port change,
> apply the chip-wide setting only for CPU ports.
> 
> Fixes: 1baf0fac10fb ("net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU")
> Suggested-by: Vladimir Oltean <olteanv@gmail.com>
> Signed-off-by: Martin Willi <martin@strongswan.org>
> ---

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net v2 2/2] net: dsa: b53: Limit chip-wide jumbo frame config to CPU ports
  2024-07-17  9:08 ` [PATCH net v2 2/2] net: dsa: b53: Limit chip-wide jumbo frame " Martin Willi
@ 2024-07-17 11:46   ` Vladimir Oltean
  0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2024-07-17 11:46 UTC (permalink / raw)
  To: Martin Willi
  Cc: Andrew Lunn, Florian Fainelli, Chris Packham,
	Murali Krishna Policharla, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev

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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net v2 0/2] net: dsa: Fix chip-wide frame size config in some drivers
  2024-07-17  9:08 [PATCH net v2 0/2] net: dsa: Fix chip-wide frame size config in some drivers Martin Willi
  2024-07-17  9:08 ` [PATCH net v2 1/2] net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports Martin Willi
  2024-07-17  9:08 ` [PATCH net v2 2/2] net: dsa: b53: Limit chip-wide jumbo frame " Martin Willi
@ 2024-07-18 11:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-07-18 11:30 UTC (permalink / raw)
  To: Martin Willi
  Cc: andrew, f.fainelli, olteanv, chris.packham, murali.policharla,
	davem, edumazet, kuba, pabeni, netdev

Hello:

This series was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 17 Jul 2024 11:08:18 +0200 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net,v2,1/2] net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports
    https://git.kernel.org/netdev/net/c/66b6095c264e
  - [net,v2,2/2] net: dsa: b53: Limit chip-wide jumbo frame config to CPU ports
    https://git.kernel.org/netdev/net/c/c5118072e228

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-07-18 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-17  9:08 [PATCH net v2 0/2] net: dsa: Fix chip-wide frame size config in some drivers Martin Willi
2024-07-17  9:08 ` [PATCH net v2 1/2] net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports Martin Willi
2024-07-17 11:46   ` Vladimir Oltean
2024-07-17  9:08 ` [PATCH net v2 2/2] net: dsa: b53: Limit chip-wide jumbo frame " Martin Willi
2024-07-17 11:46   ` Vladimir Oltean
2024-07-18 11:30 ` [PATCH net v2 0/2] net: dsa: Fix chip-wide frame size config in some drivers patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).