Commit 6bb78cfb authored by Alexander Duyck's avatar Alexander Duyck Committed by Jeff Kirsher

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: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent d3ee4294
...@@ -6480,41 +6480,32 @@ static void ixgbe_service_timer(unsigned long data) ...@@ -6480,41 +6480,32 @@ static void ixgbe_service_timer(unsigned long data)
unsigned long next_event_offset; unsigned long next_event_offset;
bool ready = true; bool ready = true;
#ifdef CONFIG_PCI_IOV /* poll faster when waiting for link */
ready = false; if (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE)
next_event_offset = HZ / 10;
else
next_event_offset = HZ * 2;
#ifdef CONFIG_PCI_IOV
/* /*
* don't bother with SR-IOV VF DMA hang check if there are * don't bother with SR-IOV VF DMA hang check if there are
* no VFs or the link is down * no VFs or the link is down
*/ */
if (!adapter->num_vfs || if (!adapter->num_vfs ||
(adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE)) { (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE))
ready = true;
goto normal_timer_service; goto normal_timer_service;
}
/* If we have VFs allocated then we must check for DMA hangs */ /* If we have VFs allocated then we must check for DMA hangs */
ixgbe_check_for_bad_vf(adapter); ixgbe_check_for_bad_vf(adapter);
next_event_offset = HZ / 50; next_event_offset = HZ / 50;
adapter->timer_event_accumulator++; adapter->timer_event_accumulator++;
if (adapter->timer_event_accumulator >= 100) { if (adapter->timer_event_accumulator >= 100)
ready = true;
adapter->timer_event_accumulator = 0; adapter->timer_event_accumulator = 0;
}
goto schedule_event;
normal_timer_service:
#endif
/* poll faster when waiting for link */
if (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE)
next_event_offset = HZ / 10;
else else
next_event_offset = HZ * 2; ready = false;
#ifdef CONFIG_PCI_IOV normal_timer_service:
schedule_event:
#endif #endif
/* Reset the timer */ /* Reset the timer */
mod_timer(&adapter->service_timer, next_event_offset + jiffies); mod_timer(&adapter->service_timer, next_event_offset + jiffies);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment