aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/dev.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 30eedf677913..77c19c7bb490 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4227,9 +4227,8 @@ static int process_backlog(struct napi_struct *napi, int quota)
4227#endif 4227#endif
4228 napi->weight = weight_p; 4228 napi->weight = weight_p;
4229 local_irq_disable(); 4229 local_irq_disable();
4230 while (work < quota) { 4230 while (1) {
4231 struct sk_buff *skb; 4231 struct sk_buff *skb;
4232 unsigned int qlen;
4233 4232
4234 while ((skb = __skb_dequeue(&sd->process_queue))) { 4233 while ((skb = __skb_dequeue(&sd->process_queue))) {
4235 local_irq_enable(); 4234 local_irq_enable();
@@ -4243,24 +4242,24 @@ static int process_backlog(struct napi_struct *napi, int quota)
4243 } 4242 }
4244 4243
4245 rps_lock(sd); 4244 rps_lock(sd);
4246 qlen = skb_queue_len(&sd->input_pkt_queue); 4245 if (skb_queue_empty(&sd->input_pkt_queue)) {
4247 if (qlen)
4248 skb_queue_splice_tail_init(&sd->input_pkt_queue,
4249 &sd->process_queue);
4250
4251 if (qlen < quota - work) {
4252 /* 4246 /*
4253 * Inline a custom version of __napi_complete(). 4247 * Inline a custom version of __napi_complete().
4254 * only current cpu owns and manipulates this napi, 4248 * only current cpu owns and manipulates this napi,
4255 * and NAPI_STATE_SCHED is the only possible flag set on backlog. 4249 * and NAPI_STATE_SCHED is the only possible flag set
4256 * we can use a plain write instead of clear_bit(), 4250 * on backlog.
4251 * We can use a plain write instead of clear_bit(),
4257 * and we dont need an smp_mb() memory barrier. 4252 * and we dont need an smp_mb() memory barrier.
4258 */ 4253 */
4259 list_del(&napi->poll_list); 4254 list_del(&napi->poll_list);
4260 napi->state = 0; 4255 napi->state = 0;
4256 rps_unlock(sd);
4261 4257
4262 quota = work + qlen; 4258 break;
4263 } 4259 }
4260
4261 skb_queue_splice_tail_init(&sd->input_pkt_queue,
4262 &sd->process_queue);
4264 rps_unlock(sd); 4263 rps_unlock(sd);
4265 } 4264 }
4266 local_irq_enable(); 4265 local_irq_enable();