]> git.itanic.dy.fi Git - linux-stable/commit
dsa: mv88e6xxx: Fix MTU definition
authorAndrew Lunn <andrew@lunn.ch>
Sun, 26 Sep 2021 17:41:25 +0000 (19:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Oct 2021 13:55:54 +0000 (15:55 +0200)
commit7b771b12229e82dac66cf0090d0774475a3c662c
tree03fa9af2832bbb09accb9482561bce547bd1ec53
parentee4d0495a65e366538063907c8b4459245620e0c
dsa: mv88e6xxx: Fix MTU definition

[ Upstream commit b92ce2f54c0f0ff781e914ec189c25f7bf1b1ec2 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/mv88e6xxx/global1.c
drivers/net/dsa/mv88e6xxx/port.c