[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c96faab-4293-4e7f-b8e0-4997af745fbf@email.android.com>
Date: Tue, 18 Mar 2014 16:41:55 +0100
From: Bjørn Mork <bjorn@...k.no>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: Ben Hutchings <ben@...adent.org.uk>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
David Miller <davem@...emloft.net>, stephen@...workplumber.org,
netdev@...r.kernel.org, xiyou.wangcong@...il.com, mpm@...enic.com,
satyam.sharma@...il.com
Subject: Re: [PATCH 6/6] net: Free skbs from irqs when possible.
On 18 March 2014 16:23:49 CET, Eric Dumazet <eric.dumazet@...il.com> wrote:
>On Tue, 2014-03-18 at 15:24 +0100, Bjørn Mork wrote:
>> Ben Hutchings <ben@...adent.org.uk> writes:
>> > On Mon, 2014-03-17 at 23:27 -0700, Eric W. Biederman wrote:
>> > [...]
>> >> --- 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.
>
>It has nothing to do with this.
>
>Try following code, and you'll get a compilation error.
>
>unsigned int can_this_fly(struct sk_buff *skb)
>{
> return IS_ENABLED(CONFIG_NOWAY_SIR) ? skb->unknown_field : 0;
>}
Doh. Of course. Thanks for spoon feeding me that.
Bjørn
--
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