Skip to content

Commit 42fb3ac

Browse files
KanjiMonsterPaolo Abeni
authored andcommitted
net: dsa: b53: fix jumbo frame mtu check
JMS_MIN_SIZE is the full ethernet frame length, while mtu is just the data payload size. Comparing these two meant that mtus between 1500 and 1518 did not trigger enabling jumbo frames. So instead compare the set mtu ETH_DATA_LEN, which is equal to JMS_MIN_SIZE - ETH_HLEN - ETH_FCS_LEN; Also do a check that the requested mtu is actually greater than the minimum length, else we do not need to enable jumbo frames. In practice this only introduced a very small range of mtus that did not work properly. Newer chips allow 2000 byte large frames by default, and older chips allow 1536 bytes long, which is equivalent to an mtu of 1514. So effectivly only mtus of 1515~1517 were broken. Fixes: 6ae5834 ("net: dsa: b53: add MTU configuration support") Signed-off-by: Jonas Gorski <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 60ed96b commit 42fb3ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2259,7 +2259,7 @@ static int b53_change_mtu(struct dsa_switch *ds, int port, int mtu)
22592259
if (!dsa_is_cpu_port(ds, port))
22602260
return 0;
22612261

2262-
enable_jumbo = (mtu >= JMS_MIN_SIZE);
2262+
enable_jumbo = (mtu > ETH_DATA_LEN);
22632263
allow_10_100 = (dev->chip_id == BCM583XX_DEVICE_ID);
22642264

22652265
return b53_set_jumbo(dev, enable_jumbo, allow_10_100);

0 commit comments

Comments
 (0)