aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ixgb
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2008-07-08 15:51:42 -0700
committerJeff Garzik <jgarzik@redhat.com>2008-07-11 01:20:27 -0400
commitb5ca88eb335580dc48ef5ebb3b86719bdb5a4113 (patch)
tree72e203e8a8ef8e3e090baf7b63a0c037ebf1a3ae /drivers/net/ixgb
parent34336635467c5102777ea8acf34fc8bf391f98c0 (diff)
ixgb: fix race on rx_buffer_len in mtu change
some random coverage testing found that when changing mtu under heavy traffic load, NAPI would use the rx_buffer_len variable after it had been changed by change_mtu. Similar to e1000 bugs found long ago. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/ixgb')
-rw-r--r--drivers/net/ixgb/ixgb_main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 4bf6bbc6582..c3234c45104 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1573,14 +1573,18 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu)
return -EINVAL;
}
+ if (old_max_frame == max_frame)
+ return 0;
+
+ if (netif_running(netdev))
+ ixgb_down(adapter, true);
+
adapter->rx_buffer_len = max_frame + 8; /* + 8 for errata */
netdev->mtu = new_mtu;
- if ((old_max_frame != max_frame) && netif_running(netdev)) {
- ixgb_down(adapter, true);
+ if (netif_running(netdev))
ixgb_up(adapter);
- }
return 0;
}