Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166550
b: refs/heads/master
c: 3d6114e
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Brandeburg authored and David S. Miller committed Sep 27, 2009
1 parent 69e1c74 commit 1c35a7d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 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: 8fce47317fc96b222ea7e28fb6d153b1855e91cd
refs/heads/master: 3d6114e71dffb9fb9dedc8569103310c5bbf0296
16 changes: 14 additions & 2 deletions trunk/drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3141,6 +3141,13 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
break;
}

while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
msleep(1);
/* e1000_down has a dependency on max_frame_size */
hw->max_frame_size = max_frame;
if (netif_running(netdev))
e1000_down(adapter);

/* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
* means we reserve 2 more, this pushes us to allocate from the next
* larger slab size.
Expand Down Expand Up @@ -3169,11 +3176,16 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
(max_frame == MAXIMUM_ETHERNET_VLAN_SIZE)))
adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;

printk(KERN_INFO "e1000: %s changing MTU from %d to %d\n",
netdev->name, netdev->mtu, new_mtu);
netdev->mtu = new_mtu;
hw->max_frame_size = max_frame;

if (netif_running(netdev))
e1000_reinit_locked(adapter);
e1000_up(adapter);
else
e1000_reset(adapter);

clear_bit(__E1000_RESETTING, &adapter->flags);

return 0;
}
Expand Down

0 comments on commit 1c35a7d

Please sign in to comment.