]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbe: cleanup logic for the service timer and VF hang detection
authorAlexander Duyck <alexander.h.duyck@intel.com>
Wed, 8 Feb 2012 07:51:22 +0000 (07:51 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 15:24:31 +0000 (23:24 +0800)
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.

(cherry picked from commit 6bb78cfb50bfbaf90646a80448ee8de2372e292a)
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/ixgbe/ixgbe_main.c

index 79b645e4f63d3ae5818c1c7dc867e161de8bef02..c306d53c3e4227c7fd2ac6ae2eef22d7837f6c8b 100644 (file)
@@ -6409,41 +6409,32 @@ static void ixgbe_service_timer(unsigned long data)
        unsigned long next_event_offset;
        bool ready = true;
 
-#ifdef CONFIG_PCI_IOV
-       ready = false;
+       /* poll faster when waiting for link */
+       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
         * no VFs or the link is down
         */
        if (!adapter->num_vfs ||
-           (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE)) {
-               ready = true;
+           (adapter->flags & IXGBE_FLAG_NEED_LINK_UPDATE))
                goto normal_timer_service;
-       }
 
        /* If we have VFs allocated then we must check for DMA hangs */
        ixgbe_check_for_bad_vf(adapter);
        next_event_offset = HZ / 50;
        adapter->timer_event_accumulator++;
 
-       if (adapter->timer_event_accumulator >= 100) {
-               ready = true;
+       if (adapter->timer_event_accumulator >= 100)
                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
-               next_event_offset = HZ * 2;
+               ready = false;
 
-#ifdef CONFIG_PCI_IOV
-schedule_event:
+normal_timer_service:
 #endif
        /* Reset the timer */
        mod_timer(&adapter->service_timer, next_event_offset + jiffies);