Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.duyck@gmail.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next-queue PATCH v2] i40e: Update driver to support napi_complete_done changes
Date: Wed, 07 Dec 2016 15:43:55 -0800	[thread overview]
Message-ID: <20161207234355.15561.26727.stgit@localhost.localdomain> (raw)

From: Alexander Duyck <alexander.h.duyck@intel.com>

Recently napi_complete_done was updated so that it will return zero if we
are using the queue vector for busy polling.  When this is the case we
don't need to re-enable interrupts as the busy polling will reschedule the
NAPI instance when it is finally done polling.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c |   32 ++++++++++++++-------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index e88e335c34ef..f9ef8c2676e2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2033,22 +2033,24 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
 		}
 	}
 
-	if (vsi->back->flags & I40E_TXR_FLAGS_WB_ON_ITR)
-		q_vector->arm_wb_state = false;
-
-	/* Work is done so exit the polling mode and re-enable the interrupt */
-	napi_complete_done(napi, work_done);
-
-	/* If we're prematurely stopping polling to fix the interrupt
-	 * affinity we want to make sure polling starts back up so we
-	 * issue a call to i40e_force_wb which triggers a SW interrupt.
+	/* Work is done so exit the polling mode,
+	 * if not busy polling re-enable interrupts.
 	 */
-	if (!clean_complete)
-		i40e_force_wb(vsi, q_vector);
-	else if (!(vsi->back->flags & I40E_FLAG_MSIX_ENABLED))
-		i40e_irq_dynamic_enable_icr0(vsi->back, false);
-	else
-		i40e_update_enable_itr(vsi, q_vector);
+	if (napi_complete_done(napi, work_done)) {
+		if (vsi->back->flags & I40E_TXR_FLAGS_WB_ON_ITR)
+			q_vector->arm_wb_state = false;
+
+		/* If we're prematurely stopping polling to fix the interrupt
+		 * affinity we want to make sure polling starts back up so we
+		 * issue a call to i40e_force_wb which triggers a SW interrupt.
+		 */
+		if (!clean_complete)
+			i40e_force_wb(vsi, q_vector);
+		else if (!(vsi->back->flags & I40E_FLAG_MSIX_ENABLED))
+			i40e_irq_dynamic_enable_icr0(vsi->back, false);
+		else
+			i40e_update_enable_itr(vsi, q_vector);
+	}
 
 	return min(work_done, budget - 1);
 }


                 reply	other threads:[~2016-12-07 23:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161207234355.15561.26727.stgit@localhost.localdomain \
    --to=alexander.duyck@gmail.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox