diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-02-06 18:19:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-07 05:43:10 -0500 |
commit | 4b1a9877364599fe57f263597821dab6bd86f3b9 (patch) | |
tree | a39421e8fca6be5f5a5c26845e653afd25c21526 /drivers/net/igb | |
parent | eebbbdba5eb44406061e4dff130257b654773d3f (diff) |
igb: remove redundant timer updates and cleanup watchdog_task
The igb watchdog task is modifying the watchdog timer twice duing a single
run. It only needs to be called once to reschedule itself for 2 seconds from
the last time it ran.
In addition I removed the allocation of the mac_info structure since it is
only called twice and is easier to access via the e1000_hw struct.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/igb_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 3bf560f0fde9..cbb385856335 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -2314,13 +2314,10 @@ static void igb_watchdog_task(struct work_struct *work) | |||
2314 | struct igb_adapter *adapter = container_of(work, | 2314 | struct igb_adapter *adapter = container_of(work, |
2315 | struct igb_adapter, watchdog_task); | 2315 | struct igb_adapter, watchdog_task); |
2316 | struct e1000_hw *hw = &adapter->hw; | 2316 | struct e1000_hw *hw = &adapter->hw; |
2317 | |||
2318 | struct net_device *netdev = adapter->netdev; | 2317 | struct net_device *netdev = adapter->netdev; |
2319 | struct igb_ring *tx_ring = adapter->tx_ring; | 2318 | struct igb_ring *tx_ring = adapter->tx_ring; |
2320 | struct e1000_mac_info *mac = &adapter->hw.mac; | ||
2321 | u32 link; | 2319 | u32 link; |
2322 | u32 eics = 0; | 2320 | u32 eics = 0; |
2323 | s32 ret_val; | ||
2324 | int i; | 2321 | int i; |
2325 | 2322 | ||
2326 | link = igb_has_link(adapter); | 2323 | link = igb_has_link(adapter); |
@@ -2365,6 +2362,7 @@ static void igb_watchdog_task(struct work_struct *work) | |||
2365 | netif_carrier_on(netdev); | 2362 | netif_carrier_on(netdev); |
2366 | netif_tx_wake_all_queues(netdev); | 2363 | netif_tx_wake_all_queues(netdev); |
2367 | 2364 | ||
2365 | /* link state has changed, schedule phy info update */ | ||
2368 | if (!test_bit(__IGB_DOWN, &adapter->state)) | 2366 | if (!test_bit(__IGB_DOWN, &adapter->state)) |
2369 | mod_timer(&adapter->phy_info_timer, | 2367 | mod_timer(&adapter->phy_info_timer, |
2370 | round_jiffies(jiffies + 2 * HZ)); | 2368 | round_jiffies(jiffies + 2 * HZ)); |
@@ -2378,6 +2376,8 @@ static void igb_watchdog_task(struct work_struct *work) | |||
2378 | netdev->name); | 2376 | netdev->name); |
2379 | netif_carrier_off(netdev); | 2377 | netif_carrier_off(netdev); |
2380 | netif_tx_stop_all_queues(netdev); | 2378 | netif_tx_stop_all_queues(netdev); |
2379 | |||
2380 | /* link state has changed, schedule phy info update */ | ||
2381 | if (!test_bit(__IGB_DOWN, &adapter->state)) | 2381 | if (!test_bit(__IGB_DOWN, &adapter->state)) |
2382 | mod_timer(&adapter->phy_info_timer, | 2382 | mod_timer(&adapter->phy_info_timer, |
2383 | round_jiffies(jiffies + 2 * HZ)); | 2383 | round_jiffies(jiffies + 2 * HZ)); |
@@ -2387,9 +2387,9 @@ static void igb_watchdog_task(struct work_struct *work) | |||
2387 | link_up: | 2387 | link_up: |
2388 | igb_update_stats(adapter); | 2388 | igb_update_stats(adapter); |
2389 | 2389 | ||
2390 | mac->tx_packet_delta = adapter->stats.tpt - adapter->tpt_old; | 2390 | hw->mac.tx_packet_delta = adapter->stats.tpt - adapter->tpt_old; |
2391 | adapter->tpt_old = adapter->stats.tpt; | 2391 | adapter->tpt_old = adapter->stats.tpt; |
2392 | mac->collision_delta = adapter->stats.colc - adapter->colc_old; | 2392 | hw->mac.collision_delta = adapter->stats.colc - adapter->colc_old; |
2393 | adapter->colc_old = adapter->stats.colc; | 2393 | adapter->colc_old = adapter->stats.colc; |
2394 | 2394 | ||
2395 | adapter->gorc = adapter->stats.gorc - adapter->gorc_old; | 2395 | adapter->gorc = adapter->stats.gorc - adapter->gorc_old; |