diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-09-30 21:20:39 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-09-30 21:20:39 +0200 |
commit | 09907ca630047bbeaa96de0102df7a6cc3a966cd (patch) | |
tree | 99e2155ea7b87ebdbeea96b7165d55ad0413006d /net/core/netpoll.c | |
parent | d786ad32c305ca0f6be1924558866fe9f901e291 (diff) | |
parent | e02ae3871355194a61b03a07d96fd71e81d7eff9 (diff) |
Merge branch 'x86/for-kvm' into x86/apic
Pull in the apic change which is provided for kvm folks to pull into
their tree.
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r-- | net/core/netpoll.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 6aa3db8dfc3b..8bdada242a7d 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; } |