All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH 2/2] fm10k: return smaller of actual work done or budget in fm10k_poll
Date: Mon, 20 Jun 2016 10:39:33 -0700	[thread overview]
Message-ID: <20160620173933.5638-2-jacob.e.keller@intel.com> (raw)
In-Reply-To: <20160620173933.5638-1-jacob.e.keller@intel.com>

Correct a slight issue with fm10k_poll returning the full budget even if
it didn't fully exhaust it. This occurs if a single ring exhausts its
per-ring portion of the budget but the other rings do not. Return the
actual amount we used capped at budget to avoid issues with napi core.

Change-Id: Ie84de029a62adcfa8af49ccb2dc0b4d9f378ee71
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Venkatesh Srinivas <venkateshs@google.com>
Cc: Alexander Duyck <aduyck@mirantis.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index 79d5093d83d1..c2c7f2ef2152 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -1474,9 +1474,9 @@ static int fm10k_poll(struct napi_struct *napi, int budget)
 			clean_complete = false;
 	}
 
-	/* If all work not completed, return budget and keep polling */
+	/* If all work not completed, return work done and keep polling */
 	if (!clean_complete)
-		return budget;
+		return min(work_done, budget);
 
 	/* all work done, exit the polling mode */
 	napi_complete_done(napi, work_done);
-- 
2.9.0.rc1.405.g81f467e


  reply	other threads:[~2016-06-20 17:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 17:39 [Intel-wired-lan] [PATCH 1/2] fm10k: napi polling routine must return actual work done Jacob Keller
2016-06-20 17:39 ` Jacob Keller [this message]
2016-08-10 19:49   ` [Intel-wired-lan] [PATCH 2/2] fm10k: return smaller of actual work done or budget in fm10k_poll Keller, Jacob E
2016-08-10 20:07     ` Keller, Jacob E
2016-06-21  8:46 ` [Intel-wired-lan] [PATCH 1/2] fm10k: napi polling routine must return actual work done Paolo Abeni
2016-08-10 19:49 ` Keller, Jacob E
2016-08-10 20:08   ` Keller, Jacob E
2016-08-30 16:15 ` Singh, Krishneil K

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=20160620173933.5638-2-jacob.e.keller@intel.com \
    --to=jacob.e.keller@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.