netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ixgbe: check return value of napi_complete_done()
@ 2018-09-20 19:01 Song Liu
  2018-09-20 20:35 ` Eric Dumazet
  0 siblings, 1 reply; 13+ messages in thread
From: Song Liu @ 2018-09-20 19:01 UTC (permalink / raw)
  To: netdev; +Cc: Song Liu, intel-wired-lan, kernel-team, stable, Jeff Kirsher

The NIC driver should only enable interrupts when napi_complete_done()
returns true. This patch adds the check for ixgbe.

Cc: stable@vger.kernel.org # 4.10+
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 9a23d33a47ed..1497df6a8dff 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -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);
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-09-21 19:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-20 19:01 [PATCH net] ixgbe: check return value of napi_complete_done() Song Liu
2018-09-20 20:35 ` Eric Dumazet
2018-09-20 21:01   ` Jeff Kirsher
2018-09-20 22:42     ` Song Liu
2018-09-20 23:22       ` Eric Dumazet
2018-09-20 23:43         ` Song Liu
2018-09-20 23:49           ` Eric Dumazet
2018-09-21  7:17             ` Song Liu
2018-09-21 13:33               ` Eric Dumazet
2018-09-21 14:55                 ` Alexei Starovoitov
2018-09-21 14:59                   ` Eric Dumazet
2018-09-21 15:14                     ` Alexei Starovoitov
2018-09-21 15:43                       ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).