Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4233cfe6 authored by Song Liu's avatar Song Liu Committed by David S. Miller
Browse files

ixgbe: check return value of napi_complete_done()



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+
Suggested-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2cc543f5
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -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 (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));
			ixgbe_irq_enable_queues(adapter,
						BIT_ULL(q_vector->v_idx));
	}

	return min(work_done, budget - 1);
}