Re: [PATCH] net: fix race in process_backlog

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: <a.p.zijlstra@...>, <linux-kernel@...>, <netdev@...>, <jdike@...>
Date: Wednesday, October 3, 2007 - 6:05 pm

On Wed, 03 Oct 2007 14:58:07 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:


This looks like a better fix. the irq_enable is needed in both cases.

--- a/net/core/dev.c	2007-09-27 07:19:10.000000000 -0700
+++ b/net/core/dev.c	2007-10-03 15:03:54.000000000 -0700
@@ -2077,12 +2077,14 @@ static int process_backlog(struct napi_s
 
 		local_irq_disable();
 		skb = __skb_dequeue(&queue->input_pkt_queue);
-		local_irq_enable();
 		if (!skb) {
-			napi_complete(napi);
+			__napi_complete(napi);
+			local_irq_enable();
 			break;
 		}
 
+		local_irq_enable();
+
 		dev = skb->dev;
 
 		netif_receive_skb(skb);


-- 
Stephen Hemminger <shemminger@linux-foundation.org>
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] net: fix race in process_backlog, Peter Zijlstra, (Wed Oct 3, 11:44 am)
Re: [PATCH] net: fix race in process_backlog, David Miller, (Wed Oct 3, 5:58 pm)
Re: [PATCH] net: fix race in process_backlog, Stephen Hemminger, (Wed Oct 3, 6:05 pm)
Re: [PATCH] net: fix race in process_backlog, David Miller, (Wed Oct 3, 7:39 pm)
Re: [PATCH] net: fix race in process_backlog, Stephen Hemminger, (Wed Oct 3, 12:15 pm)