[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200703061041.l26AfusT019768@shell0.pdx.osdl.net>
Date: Tue, 06 Mar 2007 02:41:56 -0800
From: akpm@...ux-foundation.org
To: jeff@...zik.org
Cc: netdev@...r.kernel.org, akpm@...ux-foundation.org,
anemo@....ocn.ne.jp, davem@...emloft.net, romieu@...zoreil.com
Subject: [patch 12/19] fix irq problem with NAPI + NETPOLL
From: Atsushi Nemoto <anemo@....ocn.ne.jp>
It seems netif_receive_skb() was designed not to call from irq context, but
NAPI + NETPOLL break this rule. If netif_receive_skb() was called from irq
context, redirect to netif_rx() instead of processing the skb in that
context.
Signed-off-by: Atsushi Nemoto <anemo@....ocn.ne.jp>
Cc: Jeff Garzik <jeff@...zik.org>
Cc: Francois Romieu <romieu@...zoreil.com>
Cc: "David S. Miller" <davem@...emloft.net>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
net/core/dev.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff -puN net/core/dev.c~8139too-fix-irq-problem-with-napi-netpoll net/core/dev.c
--- a/net/core/dev.c~8139too-fix-irq-problem-with-napi-netpoll
+++ a/net/core/dev.c
@@ -1769,8 +1769,15 @@ int netif_receive_skb(struct sk_buff *sk
__be16 type;
/* if we've gotten here through NAPI, check netpoll */
- if (skb->dev->poll && netpoll_rx(skb))
- return NET_RX_DROP;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ if (skb->dev->poll && skb->dev->poll_controller) {
+ /* NAPI poll might be called in irq context on NETPOLL */
+ if (in_irq() || irqs_disabled())
+ return netif_rx(skb);
+ if (netpoll_rx(skb))
+ return NET_RX_DROP;
+ }
+#endif
if (!skb->tstamp.off_sec)
net_timestamp(skb);
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists