--- zzzz-none-000/linux-2.4.17/net/core/skbuff.c 2001-12-21 17:42:05.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/net/core/skbuff.c 2004-11-24 13:22:07.000000000 +0000 @@ -4,7 +4,7 @@ * Authors: Alan Cox * Florian La Roche * - * Version: $Id: skbuff.c,v 1.90 2001/11/07 05:56:19 davem Exp $ + * Version: $Id: skbuff.c,v 1.3 2002/06/10 15:03:25 jharrell Exp $ * * Fixes: * Alan Cox : Fixed the worst of the load balancer bugs. @@ -111,33 +111,38 @@ static __inline__ struct sk_buff *skb_head_from_pool(void) { - struct sk_buff_head *list = &skb_head_pool[smp_processor_id()].list; + struct sk_buff_head *list; + struct sk_buff *skb = NULL; + unsigned long flags; + + local_irq_save(flags); + + list = &skb_head_pool[smp_processor_id()].list; if (skb_queue_len(list)) { - struct sk_buff *skb; - unsigned long flags; - local_irq_save(flags); skb = __skb_dequeue(list); - local_irq_restore(flags); - return skb; } - return NULL; + local_irq_restore(flags); + return skb; } static __inline__ void skb_head_to_pool(struct sk_buff *skb) { - struct sk_buff_head *list = &skb_head_pool[smp_processor_id()].list; + struct sk_buff_head *list; + unsigned long flags; + + local_irq_save(flags); + list = &skb_head_pool[smp_processor_id()].list; if (skb_queue_len(list) < sysctl_hot_list_len) { - unsigned long flags; - local_irq_save(flags); __skb_queue_head(list, skb); local_irq_restore(flags); return; } + local_irq_restore(flags); kmem_cache_free(skbuff_head_cache, skb); } @@ -317,10 +322,14 @@ dst_release(skb->dst); if(skb->destructor) { +#if defined(CONFIG_MIPS_AVALANCHE_SOC) + /* nothing */ +#else if (in_irq()) { printk(KERN_WARNING "Warning: kfree_skb on hard IRQ %p\n", NET_CALLER(skb)); } +#endif /* CONFIG_MIPS_AVALANCHE_SOC */ skb->destructor(skb); } #ifdef CONFIG_NETFILTER