lkml.org 
[lkml]   [2009]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] netpoll: WARN_ONCE for start_xmit returns with interrupts enabled
From
Date
The NETPOLL API requires that interrupts remain disabled in
netpoll_send_skb().

Add a WARN_ONCE when ndo_start_xmit returns with interrupts enabled
in netpoll_send_skb().

Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
---
net/core/netpoll.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index df30feb..d38103f 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -319,6 +319,12 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)

udelay(USEC_PER_POLL);
}
+
+ WARN_ONCE(!irqs_disabled(),
+ KERN_WARNING "netpoll_send_skb(): [net driver %s]"
+ "ndo_start_xmit() shouldn't return with interrupts"
+ "enabled!", dev->name);
+
local_irq_restore(flags);
}

--
1.6.0.4



\
 
 \ /
  Last update: 2009-08-19 12:33    [W:0.056 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site