]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: ethernet: octeon_mgmt: Account for second possible VLAN header
authorAlexander Sverdlin <alexander.sverdlin@nokia.com>
Fri, 8 Nov 2019 10:00:44 +0000 (10:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Nov 2019 19:18:40 +0000 (11:18 -0800)
Octeon's input ring-buffer entry has 14 bits-wide size field, so to account
for second possible VLAN header max_mtu must be further reduced.

Fixes: 0961687ffd17f ("ethernet/cavium: use core min/max MTU checking")
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c

index 0e5de88fd6e8522ac0e35e9940d1d083f170c3ea..cdd7e5da4a74ab183d8d80a07461e989f5f69172 100644 (file)
@@ -1499,7 +1499,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
        netdev->ethtool_ops = &octeon_mgmt_ethtool_ops;
 
        netdev->min_mtu = 64 - OCTEON_MGMT_RX_HEADROOM;
-       netdev->max_mtu = 16383 - OCTEON_MGMT_RX_HEADROOM;
+       netdev->max_mtu = 16383 - OCTEON_MGMT_RX_HEADROOM - VLAN_HLEN;
 
        mac = of_get_mac_address(pdev->dev.of_node);