]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/intel/igbvf/netdev.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[karo-tx-linux.git] / drivers / net / ethernet / intel / igbvf / netdev.c
index 7dff7f6239cd770766607102ae532c2ed9129ff2..839ba110f7fb93c185f41930f0ab539f6ece1627 100644 (file)
@@ -2360,16 +2360,6 @@ static int igbvf_change_mtu(struct net_device *netdev, int new_mtu)
        struct igbvf_adapter *adapter = netdev_priv(netdev);
        int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
 
-       if (new_mtu < 68 || new_mtu > INT_MAX - ETH_HLEN - ETH_FCS_LEN ||
-           max_frame > MAX_JUMBO_FRAME_SIZE)
-               return -EINVAL;
-
-#define MAX_STD_JUMBO_FRAME_SIZE 9234
-       if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
-               dev_err(&adapter->pdev->dev, "MTU > 9216 not supported.\n");
-               return -EINVAL;
-       }
-
        while (test_and_set_bit(__IGBVF_RESETTING, &adapter->state))
                usleep_range(1000, 2000);
        /* igbvf_down has a dependency on max_frame_size */
@@ -2790,6 +2780,10 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                            NETIF_F_HW_VLAN_CTAG_RX |
                            NETIF_F_HW_VLAN_CTAG_TX;
 
+       /* MTU range: 68 - 9216 */
+       netdev->min_mtu = ETH_MIN_MTU;
+       netdev->max_mtu = MAX_STD_JUMBO_FRAME_SIZE;
+
        /*reset the controller to put the device in a known good state */
        err = hw->mac.ops.reset_hw(hw);
        if (err) {