ixgbe: check return value of napi_complete_done()
authorSong Liu <[email protected]>
Wed, 3 Oct 2018 18:30:35 +0000 (11:30 -0700)
committerDavid S. Miller <[email protected]>
Wed, 3 Oct 2018 21:40:32 +0000 (14:40 -0700)
The NIC driver should only enable interrupts when napi_complete_done()
returns true. This patch adds the check for ixgbe.

Cc: [email protected] # 4.10+
Suggested-by: Eric Dumazet <[email protected]>
Signed-off-by: Song Liu <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index f27d73a7bf16f084ea8f4ab12d905b031f514cf8..6cdd58d9d461bd34ab62e5f68a43141f5cd70323 100644 (file)
@@ -3196,11 +3196,13 @@ int ixgbe_poll(struct napi_struct *napi, int budget)
                return budget;
 
        /* all work done, exit the polling mode */
-       napi_complete_done(napi, work_done);
-       if (adapter->rx_itr_setting & 1)
-               ixgbe_set_itr(q_vector);
-       if (!test_bit(__IXGBE_DOWN, &adapter->state))
-               ixgbe_irq_enable_queues(adapter, BIT_ULL(q_vector->v_idx));
+       if (likely(napi_complete_done(napi, work_done))) {
+               if (adapter->rx_itr_setting & 1)
+                       ixgbe_set_itr(q_vector);
+               if (!test_bit(__IXGBE_DOWN, &adapter->state))
+                       ixgbe_irq_enable_queues(adapter,
+                                               BIT_ULL(q_vector->v_idx));
+       }
 
        return min(work_done, budget - 1);
 }