net: hns3: Support two vlan header when setting mtu
[platform/kernel/linux-rpi.git] / drivers / net / ethernet / hisilicon / hns3 / hns3_enet.c
index 22220af..c944090 100644 (file)
@@ -3609,8 +3609,9 @@ static int hns3_client_init(struct hnae3_handle *handle)
 
        hns3_dcbnl_setup(handle);
 
-       /* MTU range: (ETH_MIN_MTU(kernel default) - 9706) */
-       netdev->max_mtu = HNS3_MAX_MTU - (ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN);
+       /* MTU range: (ETH_MIN_MTU(kernel default) - 9702) */
+       netdev->max_mtu =
+               HNS3_MAX_MTU - (ETH_HLEN + ETH_FCS_LEN + 2 * VLAN_HLEN);
 
        set_bit(HNS3_NIC_STATE_INITED, &priv->state);