net: stmmac: Correctly assing MAX MTU in XGMAC cores case
authorJose Abreu <Jose.Abreu@synopsys.com>
Wed, 4 Sep 2019 13:17:03 +0000 (15:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Sep 2019 10:19:55 +0000 (12:19 +0200)
Maximum MTU for XGMAC cores is 16k thus the check for presence of XGMAC
shall be done first in order to assign correct value.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 5271c6129f0e5994df11b15ee96e74efd767797d..c3baca9f587bda6b25c66a2b81ba603c62d17ba4 100644 (file)
@@ -4542,10 +4542,10 @@ int stmmac_dvr_probe(struct device *device,
 
        /* MTU range: 46 - hw-specific max */
        ndev->min_mtu = ETH_ZLEN - ETH_HLEN;
-       if ((priv->plat->enh_desc) || (priv->synopsys_id >= DWMAC_CORE_4_00))
-               ndev->max_mtu = JUMBO_LEN;
-       else if (priv->plat->has_xgmac)
+       if (priv->plat->has_xgmac)
                ndev->max_mtu = XGMAC_JUMBO_LEN;
+       else if ((priv->plat->enh_desc) || (priv->synopsys_id >= DWMAC_CORE_4_00))
+               ndev->max_mtu = JUMBO_LEN;
        else
                ndev->max_mtu = SKB_MAX_HEAD(NET_SKB_PAD + NET_IP_ALIGN);
        /* Will not overwrite ndev->max_mtu if plat->maxmtu > ndev->max_mtu