Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291567
b: refs/heads/master
c: 655309e
h: refs/heads/master
i:
  291565: 3ec1924
  291563: 466476c
  291559: 376d380
  291551: 729656d
v: v3
  • Loading branch information
Alexander Duyck authored and Jeff Kirsher committed Mar 17, 2012
1 parent 2aad0c8 commit 2fa93db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f800326dca7bc158f4c886aa92f222de37993c80
refs/heads/master: 655309e944fd482e59850d55186571c1b2a91e55
20 changes: 12 additions & 8 deletions trunk/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5544,20 +5544,24 @@ static void ixgbe_free_all_rx_resources(struct ixgbe_adapter *adapter)
static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;

/* MTU < 68 is an error and causes problems on some kernels */
if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED &&
hw->mac.type != ixgbe_mac_X540) {
if ((new_mtu < 68) || (max_frame > MAXIMUM_ETHERNET_VLAN_SIZE))
return -EINVAL;
} else {
if ((new_mtu < 68) || (max_frame > IXGBE_MAX_JUMBO_FRAME_SIZE))
if ((new_mtu < 68) || (max_frame > IXGBE_MAX_JUMBO_FRAME_SIZE))
return -EINVAL;

/*
* For 82599EB we cannot allow PF to change MTU greater than 1500
* in SR-IOV mode as it may cause buffer overruns in guest VFs that
* don't allocate and chain buffers correctly.
*/
if ((adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) &&
(adapter->hw.mac.type == ixgbe_mac_82599EB) &&
(max_frame > MAXIMUM_ETHERNET_VLAN_SIZE))
return -EINVAL;
}

e_info(probe, "changing MTU from %d to %d\n", netdev->mtu, new_mtu);

/* must set new MTU before calling down or up */
netdev->mtu = new_mtu;

Expand Down

0 comments on commit 2fa93db

Please sign in to comment.