Thread (288 messages) 288 messages, 13 authors, 2014-04-01

Re: [PATCH 6/6] net: Free skbs from irqs when possible.

From: Bjørn Mork <bjorn@mork.no>
Date: 2014-03-18 14:24:47

Ben Hutchings [off-list ref] writes:
On Mon, 2014-03-17 at 23:27 -0700, Eric W. Biederman wrote:
[...]
quoted
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -554,14 +554,21 @@ static void kfree_skbmem(struct sk_buff *skb)
 
 static void skb_release_head_state(struct sk_buff *skb)
 {
+	WARN_ONCE(in_irq() && !skb_irq_freeable(skb),
+		  "%s called from irq! sp %d nfct %d frag_list %d %pF dst %lx",
+		  __func__,
+		  IS_ENABLED(CONFIG_XFRM) ? !!skb->sp : 0,
+		  IS_ENABLED(CONFIG_NF_CONNTRACK) ? !!skb->nfct : 0,
[...]

This is a syntax error if CONFIG_XFRM or CONFIG_NF_CONNTRACK is
disabled; you have to use #ifdef's.
Are you sure?  I thought one of the ideas behind these macros was that
they would always evaluate to 0 or 1.  The docs says:

 * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
 * 0 otherwise.


See include/linux/kconfig.h for the macro magic making this
happen. Looks like fun figuring that out.


Bjørn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help