aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2012-02-08 02:51:22 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-03-19 04:57:23 -0400
commit6bb78cfb50bfbaf90646a80448ee8de2372e292a (patch)
tree5258daf5977698179a4fd8c7362a8728c7ccb5ff /drivers/net
parentd3ee42944393895374e2f321f54e9a701e9f965c (diff)
ixgbe: cleanup logic for the service timer and VF hang detection
This change just cleans up some of the logic in the service_timer function so that we can avoid unnecessary swapping of the ready value between true to false and back to true. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 7817f0473032..6453e3a589ec 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6480,41 +6480,32 @@ static void ixgbe_service_timer(unsigned long data)
6480 unsigned long next_event_offset; 6480 unsigned long next_event_offset;
6481 bool ready = true; 6481 bool ready = true;
6482 6482
6483#ifdef CONFIG_PCI_IOV 6483 /* poll faster when waiting for link */
6484 ready = false; 6484 if (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE)
6485 next_event_offset = HZ / 10;
6486 else
6487 next_event_offset = HZ * 2;
6485 6488
6489#ifdef CONFIG_PCI_IOV
6486 /* 6490 /*
6487 * don't bother with SR-IOV VF DMA hang check if there are 6491 * don't bother with SR-IOV VF DMA hang check if there are
6488 * no VFs or the link is down 6492 * no VFs or the link is down
6489 */ 6493 */
6490 if (!adapter->num_vfs || 6494 if (!adapter->num_vfs ||
6491 (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE)) { 6495 (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE))
6492 ready = true;
6493 goto normal_timer_service; 6496 goto normal_timer_service;
6494 }
6495 6497
6496 /* If we have VFs allocated then we must check for DMA hangs */ 6498 /* If we have VFs allocated then we must check for DMA hangs */
6497 ixgbe_check_for_bad_vf(adapter); 6499 ixgbe_check_for_bad_vf(adapter);
6498 next_event_offset = HZ / 50; 6500 next_event_offset = HZ / 50;
6499 adapter->timer_event_accumulator++; 6501 adapter->timer_event_accumulator++;
6500 6502
6501 if (adapter->timer_event_accumulator >= 100) { 6503 if (adapter->timer_event_accumulator >= 100)
6502 ready = true;
6503 adapter->timer_event_accumulator = 0; 6504 adapter->timer_event_accumulator = 0;
6504 }
6505
6506 goto schedule_event;
6507
6508normal_timer_service:
6509#endif
6510 /* poll faster when waiting for link */
6511 if (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE)
6512 next_event_offset = HZ / 10;
6513 else 6505 else
6514 next_event_offset = HZ * 2; 6506 ready = false;
6515 6507
6516#ifdef CONFIG_PCI_IOV 6508normal_timer_service:
6517schedule_event:
6518#endif 6509#endif
6519 /* Reset the timer */ 6510 /* Reset the timer */
6520 mod_timer(&adapter->service_timer, next_event_offset + jiffies); 6511 mod_timer(&adapter->service_timer, next_event_offset + jiffies);