summaryrefslogtreecommitdiffstats
path: root/net/core/netpoll.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-27 12:44:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-27 12:44:02 -0700
commitc566f365434e732986d7904e29c8122dfcb1e333 (patch)
treea2189979d71d844f62d0ef75836e9f6c72ab60ff /net/core/netpoll.c
parentb05b7c7cc0324524dcda7fa7c2be1255290ee416 (diff)
parent9ffecb10283508260936b96022d4ee43a7798b4c (diff)
downloadop-kernel-dev-c566f365434e732986d7904e29c8122dfcb1e333.zip
op-kernel-dev-c566f365434e732986d7904e29c8122dfcb1e333.tar.gz
Merge 4.3-rc3 into char-misc-next
We want those fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r--net/core/netpoll.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 6aa3db8..8bdada2 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -142,7 +142,7 @@ static void queue_process(struct work_struct *work)
*/
static int poll_one_napi(struct napi_struct *napi, int budget)
{
- int work;
+ int work = 0;
/* net_rx_action's ->poll() invocations and our's are
* synchronized by this test which is only made while
@@ -151,7 +151,12 @@ static int poll_one_napi(struct napi_struct *napi, int budget)
if (!test_bit(NAPI_STATE_SCHED, &napi->state))
return budget;
- set_bit(NAPI_STATE_NPSVC, &napi->state);
+ /* If we set this bit but see that it has already been set,
+ * that indicates that napi has been disabled and we need
+ * to abort this operation
+ */
+ if (test_and_set_bit(NAPI_STATE_NPSVC, &napi->state))
+ goto out;
work = napi->poll(napi, budget);
WARN_ONCE(work > budget, "%pF exceeded budget in poll\n", napi->poll);
@@ -159,6 +164,7 @@ static int poll_one_napi(struct napi_struct *napi, int budget)
clear_bit(NAPI_STATE_NPSVC, &napi->state);
+out:
return budget - work;
}
OpenPOWER on IntegriCloud