diff mbox series

net: dsa: vsc73xx: fix MTU configuration

Message ID 20230628194327.1765644-1-paweldembicki@gmail.com (mailing list archive)
State Accepted
Commit 3cf62c8177adb0db9e15c8b898c44f997acf3ebf
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: vsc73xx: fix MTU configuration | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
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: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Pawel Dembicki June 28, 2023, 7:43 p.m. UTC
Switch in MAXLEN register stores the maximum size of a data frame.
The MTU size is 18 bytes smaller than the frame size.

The current settings are causing problems with packet forwarding.
This patch fixes the MTU settings to proper values.

Fixes: fb77ffc6ec86 ("net: dsa: vsc73xx: make the MTU configurable")
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>

---
In my first attempt, I sent it to net-next [0], but I was asked to resend
it to net.

[0]https://lore.kernel.org/netdev/20230625115343.1603330-7-paweldembicki@gmail.com/

 drivers/net/dsa/vitesse-vsc73xx-core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Vladimir Oltean June 28, 2023, 9:44 p.m. UTC | #1
On Wed, Jun 28, 2023 at 09:43:27PM +0200, Pawel Dembicki wrote:
> Switch in MAXLEN register stores the maximum size of a data frame.
> The MTU size is 18 bytes smaller than the frame size.
> 
> The current settings are causing problems with packet forwarding.
> This patch fixes the MTU settings to proper values.
> 
> Fixes: fb77ffc6ec86 ("net: dsa: vsc73xx: make the MTU configurable")
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
> 
> ---
> In my first attempt, I sent it to net-next [0], but I was asked to resend
> it to net.
> 
> [0]https://lore.kernel.org/netdev/20230625115343.1603330-7-paweldembicki@gmail.com/

Just like you had marked those earlier patches as "[PATCH net-next]",
this should have also been marked as "[PATCH v2 net]". Patchwork does
complain about that and deduced the wrong tree, but accepted it anyway
and otherwise ran its tests.
https://patchwork.kernel.org/project/netdevbpf/patch/20230628194327.1765644-1-paweldembicki@gmail.com/

I don't believe there is any reason to resend this patch.

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
patchwork-bot+netdevbpf@kernel.org June 30, 2023, 12:40 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 28 Jun 2023 21:43:27 +0200 you wrote:
> Switch in MAXLEN register stores the maximum size of a data frame.
> The MTU size is 18 bytes smaller than the frame size.
> 
> The current settings are causing problems with packet forwarding.
> This patch fixes the MTU settings to proper values.
> 
> Fixes: fb77ffc6ec86 ("net: dsa: vsc73xx: make the MTU configurable")
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
> 
> [...]

Here is the summary with links:
  - net: dsa: vsc73xx: fix MTU configuration
    https://git.kernel.org/netdev/net/c/3cf62c8177ad

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c
index ae55167ce0a6..ef1a4a7c47b2 100644
--- a/drivers/net/dsa/vitesse-vsc73xx-core.c
+++ b/drivers/net/dsa/vitesse-vsc73xx-core.c
@@ -1025,17 +1025,17 @@  static int vsc73xx_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
 	struct vsc73xx *vsc = ds->priv;
 
 	return vsc73xx_write(vsc, VSC73XX_BLOCK_MAC, port,
-			     VSC73XX_MAXLEN, new_mtu);
+			     VSC73XX_MAXLEN, new_mtu + ETH_HLEN + ETH_FCS_LEN);
 }
 
 /* According to application not "VSC7398 Jumbo Frames" setting
- * up the MTU to 9.6 KB does not affect the performance on standard
+ * up the frame size to 9.6 KB does not affect the performance on standard
  * frames. It is clear from the application note that
  * "9.6 kilobytes" == 9600 bytes.
  */
 static int vsc73xx_get_max_mtu(struct dsa_switch *ds, int port)
 {
-	return 9600;
+	return 9600 - ETH_HLEN - ETH_FCS_LEN;
 }
 
 static const struct dsa_switch_ops vsc73xx_ds_ops = {