Re: kfree_skb questions

2005-08-06 Thread Daniel Phillips
On Sunday 07 August 2005 06:26, Patrick McHardy wrote: > > Anyway, do we not want BUG_ON(!atomic_read(&skb->users)) at the beginning > > of kfree_skb, since we rely on it? > > Why do you care if skb->users is 0 or 1 in __kfree_skb()? Because I am a neatness freak and I like to check things that in

Re: kfree_skb questions

2005-08-06 Thread Patrick McHardy
Daniel Phillips wrote: Hi, The way I read this, __kfree_skb will sometimes be called with ->users = 1 and sometimes with ->users = 0, is that right? Yes. static inline void kfree_skb(struct sk_buff *skb) { if (likely(atomic_read(&skb->users) == 1)) smp_rmb();

kfree_skb questions

2005-08-06 Thread Daniel Phillips
Hi, The way I read this, __kfree_skb will sometimes be called with ->users = 1 and sometimes with ->users = 0, is that right? static inline void kfree_skb(struct sk_buff *skb) { if (likely(atomic_read(&skb->users) == 1)) smp_rmb(); else if (likely(!atomic_dec_an