Skip to content

Commit 3cf62c8

Browse files
CHKDSK88kuba-moo
authored andcommitted
net: dsa: vsc73xx: fix MTU configuration
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: fb77ffc ("net: dsa: vsc73xx: make the MTU configurable") Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://lore.kernel.org/r/20230628194327.1765644-1-paweldembicki@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 48538cc commit 3cf62c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/dsa/vitesse-vsc73xx-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,17 +1025,17 @@ static int vsc73xx_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
10251025
struct vsc73xx *vsc = ds->priv;
10261026

10271027
return vsc73xx_write(vsc, VSC73XX_BLOCK_MAC, port,
1028-
VSC73XX_MAXLEN, new_mtu);
1028+
VSC73XX_MAXLEN, new_mtu + ETH_HLEN + ETH_FCS_LEN);
10291029
}
10301030

10311031
/* According to application not "VSC7398 Jumbo Frames" setting
1032-
* up the MTU to 9.6 KB does not affect the performance on standard
1032+
* up the frame size to 9.6 KB does not affect the performance on standard
10331033
* frames. It is clear from the application note that
10341034
* "9.6 kilobytes" == 9600 bytes.
10351035
*/
10361036
static int vsc73xx_get_max_mtu(struct dsa_switch *ds, int port)
10371037
{
1038-
return 9600;
1038+
return 9600 - ETH_HLEN - ETH_FCS_LEN;
10391039
}
10401040

10411041
static const struct dsa_switch_ops vsc73xx_ds_ops = {

0 commit comments

Comments
 (0)