aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6xxx/port.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2021-09-26 19:41:25 +0200
committerDavid S. Miller <davem@davemloft.net>2021-09-27 13:31:10 +0100
commitb92ce2f54c0f0ff781e914ec189c25f7bf1b1ec2 (patch)
treecf79ad7996494b09fc233f512b6b4db79310d7e7 /drivers/net/dsa/mv88e6xxx/port.c
parentdsa: mv88e6xxx: 6161: Use chip wide MAX MTU (diff)
downloadlinux-dev-b92ce2f54c0f0ff781e914ec189c25f7bf1b1ec2.tar.xz
linux-dev-b92ce2f54c0f0ff781e914ec189c25f7bf1b1ec2.zip
dsa: mv88e6xxx: Fix MTU definition
The MTU passed to the DSA driver is the payload size, typically 1500. However, the switch uses the frame size when applying restrictions. Adjust the MTU with the size of the Ethernet header and the frame checksum. The VLAN header also needs to be included when the frame size it per port, but not when it is global. Fixes: 1baf0fac10fb ("net: dsa: mv88e6xxx: Use chip-wide max frame size for MTU") Reported by: 曹煜 <cao88yu@gmail.com> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/dsa/mv88e6xxx/port.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index f77e2ee64a60..451028c57af8 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -1277,6 +1277,8 @@ int mv88e6165_port_set_jumbo_size(struct mv88e6xxx_chip *chip, int port,
u16 reg;
int err;
+ size += VLAN_ETH_HLEN + ETH_FCS_LEN;
+
err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_CTL2, &reg);
if (err)
return err;