e1000e_4.10_max-mtu.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. diff --git a/src/netdev.c b/src/netdev.c
  2. index 73b0f9a..aef1bc2 100644
  3. --- a/src/netdev.c
  4. +++ b/src/netdev.c
  5. @@ -6724,19 +6724,12 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
  6. int max_frame = new_mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;
  7. /* Jumbo frame support */
  8. - if ((max_frame > (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)) &&
  9. + if ((new_mtu > ETH_DATA_LEN) &&
  10. !(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) {
  11. e_err("Jumbo Frames not supported.\n");
  12. return -EINVAL;
  13. }
  14. - /* Supported frame sizes */
  15. - if ((new_mtu < (VLAN_ETH_ZLEN + ETH_FCS_LEN)) ||
  16. - (max_frame > adapter->max_hw_frame_size)) {
  17. - e_err("Unsupported MTU setting\n");
  18. - return -EINVAL;
  19. - }
  20. -
  21. /* Jumbo frame workaround on 82579 and newer requires CRC be stripped */
  22. if ((adapter->hw.mac.type >= e1000_pch2lan) &&
  23. !(adapter->flags2 & FLAG2_CRC_STRIPPING) &&
  24. @@ -8262,6 +8255,11 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  25. #endif /* HAVE_NETDEV_VLAN_FEATURES */
  26. }
  27. + /* MTU range: 68 - max_hw_frame_size */
  28. + netdev->min_mtu = ETH_MIN_MTU;
  29. + netdev->max_mtu = adapter->max_hw_frame_size -
  30. + (VLAN_ETH_HLEN + ETH_FCS_LEN);
  31. +
  32. if (e1000e_enable_mng_pass_thru(&adapter->hw))
  33. adapter->flags |= FLAG_MNG_PT_ENABLED;