ixgbe_4.10_max-mtu.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. diff --git a/src/ixgbe_main.c b/src/ixgbe_main.c
  2. index 83c6250..fe226cd 100644
  3. --- a/src/ixgbe_main.c
  4. +++ b/src/ixgbe_main.c
  5. @@ -6379,11 +6379,6 @@ static void ixgbe_free_all_rx_resources(struct ixgbe_adapter *adapter)
  6. static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu)
  7. {
  8. struct ixgbe_adapter *adapter = netdev_priv(netdev);
  9. - int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
  10. -
  11. - /* MTU < 68 is an error and causes problems on some kernels */
  12. - if ((new_mtu < 68) || (max_frame > IXGBE_MAX_JUMBO_FRAME_SIZE))
  13. - return -EINVAL;
  14. /*
  15. * For 82599EB we cannot allow legacy VFs to enable their receive
  16. @@ -6392,7 +6387,7 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu)
  17. */
  18. if ((adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) &&
  19. (adapter->hw.mac.type == ixgbe_mac_82599EB) &&
  20. - (max_frame > (ETH_FRAME_LEN + ETH_FCS_LEN)))
  21. + (new_mtu > ETH_DATA_LEN))
  22. e_warn(probe, "Setting MTU > 1500 will disable legacy VFs\n");
  23. e_info(probe, "changing MTU from %d to %d\n", netdev->mtu, new_mtu);
  24. @@ -10134,6 +10129,11 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
  25. #ifdef IFF_SUPP_NOFCS
  26. netdev->priv_flags |= IFF_SUPP_NOFCS;
  27. #endif
  28. +
  29. + /* MTU range: 68 - 9710 */
  30. + netdev->min_mtu = ETH_MIN_MTU;
  31. + netdev->max_mtu = IXGBE_MAX_JUMBO_FRAME_SIZE - (ETH_HLEN + ETH_FCS_LEN);
  32. +
  33. #if IS_ENABLED(CONFIG_DCB)
  34. if (adapter->flags & IXGBE_FLAG_DCB_CAPABLE)
  35. netdev->dcbnl_ops = &dcbnl_ops;