ia64/xen-unstable

changeset 13508:16847428f859

[linux networking] Remove the code to allocate page sized skbs.
This is no longer used much since the default is to always copy packets
to guests.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author Christian Limpach <Christian.Limpach@xensource.com>
date Thu Jan 18 18:40:30 2007 +0000 (2007-01-18)
parents 4f0a68df2585
children e2539ab3580a
files buildconfigs/linux-defconfig_xen0_ia64 buildconfigs/linux-defconfig_xen0_x86_32 buildconfigs/linux-defconfig_xen0_x86_64 buildconfigs/linux-defconfig_xenU_ia64 buildconfigs/linux-defconfig_xenU_x86_32 buildconfigs/linux-defconfig_xenU_x86_64 buildconfigs/linux-defconfig_xen_ia64 buildconfigs/linux-defconfig_xen_x86_32 buildconfigs/linux-defconfig_xen_x86_64 linux-2.6-xen-sparse/arch/ia64/Kconfig linux-2.6-xen-sparse/drivers/xen/Kconfig linux-2.6-xen-sparse/drivers/xen/core/Makefile linux-2.6-xen-sparse/drivers/xen/core/skbuff.c linux-2.6-xen-sparse/drivers/xen/netback/netback.c linux-2.6-xen-sparse/include/linux/skbuff.h linux-2.6-xen-sparse/net/core/skbuff.c
line diff
     1.1 --- a/buildconfigs/linux-defconfig_xen0_ia64	Thu Jan 18 18:39:07 2007 +0000
     1.2 +++ b/buildconfigs/linux-defconfig_xen0_ia64	Thu Jan 18 18:40:30 2007 +0000
     1.3 @@ -1512,10 +1512,7 @@ CONFIG_CRYPTO_DES=y
     1.4  # Hardware crypto devices
     1.5  #
     1.6  # CONFIG_XEN_UTIL is not set
     1.7 -CONFIG_HAVE_ARCH_ALLOC_SKB=y
     1.8 -CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     1.9  CONFIG_XEN_BALLOON=y
    1.10 -CONFIG_XEN_SKBUFF=y
    1.11  # CONFIG_XEN_DEVMEM is not set
    1.12  CONFIG_XEN_REBOOT=y
    1.13  # CONFIG_XEN_SMPBOOT is not set
     2.1 --- a/buildconfigs/linux-defconfig_xen0_x86_32	Thu Jan 18 18:39:07 2007 +0000
     2.2 +++ b/buildconfigs/linux-defconfig_xen0_x86_32	Thu Jan 18 18:40:30 2007 +0000
     2.3 @@ -1338,8 +1338,6 @@ CONFIG_XEN_SYSFS=y
     2.4  CONFIG_XEN_COMPAT_030002_AND_LATER=y
     2.5  # CONFIG_XEN_COMPAT_LATEST_ONLY is not set
     2.6  CONFIG_XEN_COMPAT_030002=y
     2.7 -CONFIG_HAVE_ARCH_ALLOC_SKB=y
     2.8 -CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     2.9  CONFIG_NO_IDLE_HZ=y
    2.10  
    2.11  #
     3.1 --- a/buildconfigs/linux-defconfig_xen0_x86_64	Thu Jan 18 18:39:07 2007 +0000
     3.2 +++ b/buildconfigs/linux-defconfig_xen0_x86_64	Thu Jan 18 18:40:30 2007 +0000
     3.3 @@ -1278,8 +1278,6 @@ CONFIG_XEN_SYSFS=y
     3.4  CONFIG_XEN_COMPAT_030002_AND_LATER=y
     3.5  # CONFIG_XEN_COMPAT_LATEST_ONLY is not set
     3.6  CONFIG_XEN_COMPAT_030002=y
     3.7 -CONFIG_HAVE_ARCH_ALLOC_SKB=y
     3.8 -CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     3.9  CONFIG_NO_IDLE_HZ=y
    3.10  
    3.11  #
     4.1 --- a/buildconfigs/linux-defconfig_xenU_ia64	Thu Jan 18 18:39:07 2007 +0000
     4.2 +++ b/buildconfigs/linux-defconfig_xenU_ia64	Thu Jan 18 18:40:30 2007 +0000
     4.3 @@ -1386,10 +1386,7 @@ CONFIG_CRYPTO_DES=y
     4.4  # Hardware crypto devices
     4.5  #
     4.6  # CONFIG_XEN_UTIL is not set
     4.7 -CONFIG_HAVE_ARCH_ALLOC_SKB=y
     4.8 -CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     4.9  CONFIG_XEN_BALLOON=y
    4.10 -CONFIG_XEN_SKBUFF=y
    4.11  # CONFIG_XEN_DEVMEM is not set
    4.12  CONFIG_XEN_REBOOT=y
    4.13  # CONFIG_XEN_SMPBOOT is not set
     5.1 --- a/buildconfigs/linux-defconfig_xenU_x86_32	Thu Jan 18 18:39:07 2007 +0000
     5.2 +++ b/buildconfigs/linux-defconfig_xenU_x86_32	Thu Jan 18 18:40:30 2007 +0000
     5.3 @@ -865,8 +865,6 @@ CONFIG_XEN_SYSFS=y
     5.4  CONFIG_XEN_COMPAT_030002_AND_LATER=y
     5.5  # CONFIG_XEN_COMPAT_LATEST_ONLY is not set
     5.6  CONFIG_XEN_COMPAT_030002=y
     5.7 -CONFIG_HAVE_ARCH_ALLOC_SKB=y
     5.8 -CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     5.9  CONFIG_NO_IDLE_HZ=y
    5.10  
    5.11  #
     6.1 --- a/buildconfigs/linux-defconfig_xenU_x86_64	Thu Jan 18 18:39:07 2007 +0000
     6.2 +++ b/buildconfigs/linux-defconfig_xenU_x86_64	Thu Jan 18 18:40:30 2007 +0000
     6.3 @@ -1151,8 +1151,6 @@ CONFIG_XEN_SYSFS=y
     6.4  CONFIG_XEN_COMPAT_030002_AND_LATER=y
     6.5  # CONFIG_XEN_COMPAT_LATEST_ONLY is not set
     6.6  CONFIG_XEN_COMPAT_030002=y
     6.7 -CONFIG_HAVE_ARCH_ALLOC_SKB=y
     6.8 -CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     6.9  CONFIG_NO_IDLE_HZ=y
    6.10  
    6.11  #
     7.1 --- a/buildconfigs/linux-defconfig_xen_ia64	Thu Jan 18 18:39:07 2007 +0000
     7.2 +++ b/buildconfigs/linux-defconfig_xen_ia64	Thu Jan 18 18:40:30 2007 +0000
     7.3 @@ -1518,10 +1518,7 @@ CONFIG_CRYPTO_DES=y
     7.4  # Hardware crypto devices
     7.5  #
     7.6  # CONFIG_XEN_UTIL is not set
     7.7 -CONFIG_HAVE_ARCH_ALLOC_SKB=y
     7.8 -CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     7.9  CONFIG_XEN_BALLOON=y
    7.10 -CONFIG_XEN_SKBUFF=y
    7.11  # CONFIG_XEN_DEVMEM is not set
    7.12  CONFIG_XEN_REBOOT=y
    7.13  # CONFIG_XEN_SMPBOOT is not set
     8.1 --- a/buildconfigs/linux-defconfig_xen_x86_32	Thu Jan 18 18:39:07 2007 +0000
     8.2 +++ b/buildconfigs/linux-defconfig_xen_x86_32	Thu Jan 18 18:40:30 2007 +0000
     8.3 @@ -3043,8 +3043,6 @@ CONFIG_XEN_SYSFS=y
     8.4  CONFIG_XEN_COMPAT_030002_AND_LATER=y
     8.5  # CONFIG_XEN_COMPAT_LATEST_ONLY is not set
     8.6  CONFIG_XEN_COMPAT_030002=y
     8.7 -CONFIG_HAVE_ARCH_ALLOC_SKB=y
     8.8 -CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     8.9  CONFIG_NO_IDLE_HZ=y
    8.10  
    8.11  #
     9.1 --- a/buildconfigs/linux-defconfig_xen_x86_64	Thu Jan 18 18:39:07 2007 +0000
     9.2 +++ b/buildconfigs/linux-defconfig_xen_x86_64	Thu Jan 18 18:40:30 2007 +0000
     9.3 @@ -2874,8 +2874,6 @@ CONFIG_XEN_SYSFS=y
     9.4  CONFIG_XEN_COMPAT_030002_AND_LATER=y
     9.5  # CONFIG_XEN_COMPAT_LATEST_ONLY is not set
     9.6  CONFIG_XEN_COMPAT_030002=y
     9.7 -CONFIG_HAVE_ARCH_ALLOC_SKB=y
     9.8 -CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     9.9  CONFIG_NO_IDLE_HZ=y
    9.10  
    9.11  #
    10.1 --- a/linux-2.6-xen-sparse/arch/ia64/Kconfig	Thu Jan 18 18:39:07 2007 +0000
    10.2 +++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig	Thu Jan 18 18:40:30 2007 +0000
    10.3 @@ -521,12 +521,6 @@ if XEN
    10.4  config XEN_UTIL
    10.5  	default n
    10.6  
    10.7 -config HAVE_ARCH_ALLOC_SKB
    10.8 -	default y
    10.9 -
   10.10 -config HAVE_ARCH_DEV_ALLOC_SKB
   10.11 -	default y
   10.12 -
   10.13  config XEN_BALLOON
   10.14  	default y
   10.15  
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/Kconfig	Thu Jan 18 18:39:07 2007 +0000
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/Kconfig	Thu Jan 18 18:40:30 2007 +0000
    11.3 @@ -238,14 +238,6 @@ config XEN_COMPAT_030002
    11.4  
    11.5  endmenu
    11.6  
    11.7 -config HAVE_ARCH_ALLOC_SKB
    11.8 -	bool
    11.9 -	default y
   11.10 -
   11.11 -config HAVE_ARCH_DEV_ALLOC_SKB
   11.12 -	bool
   11.13 -	default y
   11.14 -
   11.15  config HAVE_IRQ_IGNORE_UNHANDLED
   11.16  	bool
   11.17  	default y
   11.18 @@ -266,11 +258,6 @@ config XEN_DEVMEM
   11.19  	bool
   11.20  	default y
   11.21  
   11.22 -config XEN_SKBUFF
   11.23 -	bool
   11.24 -	default y
   11.25 -	depends on NET
   11.26 -
   11.27  config XEN_REBOOT
   11.28  	bool
   11.29  	default y
    12.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/Makefile	Thu Jan 18 18:39:07 2007 +0000
    12.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/Makefile	Thu Jan 18 18:40:30 2007 +0000
    12.3 @@ -8,7 +8,6 @@ obj-$(CONFIG_PROC_FS)		+= xen_proc.o
    12.4  obj-$(CONFIG_SYSFS)		+= hypervisor_sysfs.o
    12.5  obj-$(CONFIG_HOTPLUG_CPU)	+= cpu_hotplug.o
    12.6  obj-$(CONFIG_XEN_SYSFS)		+= xen_sysfs.o
    12.7 -obj-$(CONFIG_XEN_SKBUFF)	+= skbuff.o
    12.8  obj-$(CONFIG_XEN_REBOOT)	+= reboot.o machine_reboot.o
    12.9  obj-$(CONFIG_XEN_SMPBOOT)	+= smpboot.o
   12.10  obj-$(CONFIG_KEXEC)		+= machine_kexec.o
    13.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/skbuff.c	Thu Jan 18 18:39:07 2007 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,145 +0,0 @@
    13.4 -
    13.5 -#include <linux/config.h>
    13.6 -#include <linux/module.h>
    13.7 -#include <linux/version.h>
    13.8 -#include <linux/kernel.h>
    13.9 -#include <linux/sched.h>
   13.10 -#include <linux/slab.h>
   13.11 -#include <linux/netdevice.h>
   13.12 -#include <linux/inetdevice.h>
   13.13 -#include <linux/etherdevice.h>
   13.14 -#include <linux/skbuff.h>
   13.15 -#include <linux/init.h>
   13.16 -#include <asm/io.h>
   13.17 -#include <asm/page.h>
   13.18 -#include <asm/hypervisor.h>
   13.19 -
   13.20 -/* Referenced in netback.c. */
   13.21 -/*static*/ kmem_cache_t *skbuff_cachep;
   13.22 -EXPORT_SYMBOL(skbuff_cachep);
   13.23 -
   13.24 -/* Allow up to 64kB or page-sized packets (whichever is greater). */
   13.25 -#if PAGE_SHIFT < 16
   13.26 -#define MAX_SKBUFF_ORDER (16 - PAGE_SHIFT)
   13.27 -#else
   13.28 -#define MAX_SKBUFF_ORDER 0
   13.29 -#endif
   13.30 -static kmem_cache_t *skbuff_order_cachep[MAX_SKBUFF_ORDER + 1];
   13.31 -
   13.32 -static struct {
   13.33 -	int size;
   13.34 -	kmem_cache_t *cachep;
   13.35 -} skbuff_small[] = { { 512, NULL }, { 2048, NULL } };
   13.36 -
   13.37 -struct sk_buff *__alloc_skb(unsigned int length, gfp_t gfp_mask,
   13.38 -			    int fclone)
   13.39 -{
   13.40 -	int order, i;
   13.41 -	kmem_cache_t *cachep;
   13.42 -
   13.43 -	length = SKB_DATA_ALIGN(length) + sizeof(struct skb_shared_info);
   13.44 -
   13.45 -	if (length <= skbuff_small[ARRAY_SIZE(skbuff_small)-1].size) {
   13.46 -		for (i = 0; skbuff_small[i].size < length; i++)
   13.47 -			continue;
   13.48 -		cachep = skbuff_small[i].cachep;
   13.49 -	} else {
   13.50 -		order = get_order(length);
   13.51 -		if (order > MAX_SKBUFF_ORDER) {
   13.52 -			printk(KERN_ALERT "Attempt to allocate order %d "
   13.53 -			       "skbuff. Increase MAX_SKBUFF_ORDER.\n", order);
   13.54 -			return NULL;
   13.55 -		}
   13.56 -		cachep = skbuff_order_cachep[order];
   13.57 -	}
   13.58 -
   13.59 -	length -= sizeof(struct skb_shared_info);
   13.60 -
   13.61 -	return alloc_skb_from_cache(cachep, length, gfp_mask, fclone);
   13.62 -}
   13.63 -
   13.64 -struct sk_buff *__dev_alloc_skb(unsigned int length, gfp_t gfp_mask)
   13.65 -{
   13.66 -	struct sk_buff *skb;
   13.67 -	int order;
   13.68 -
   13.69 -	length = SKB_DATA_ALIGN(length + 16);
   13.70 -	order = get_order(length + sizeof(struct skb_shared_info));
   13.71 -	if (order > MAX_SKBUFF_ORDER) {
   13.72 -		printk(KERN_ALERT "Attempt to allocate order %d skbuff. "
   13.73 -		       "Increase MAX_SKBUFF_ORDER.\n", order);
   13.74 -		return NULL;
   13.75 -	}
   13.76 -
   13.77 -	skb = alloc_skb_from_cache(
   13.78 -		skbuff_order_cachep[order], length, gfp_mask, 0);
   13.79 -	if (skb != NULL)
   13.80 -		skb_reserve(skb, 16);
   13.81 -
   13.82 -	return skb;
   13.83 -}
   13.84 -
   13.85 -static void skbuff_ctor(void *buf, kmem_cache_t *cachep, unsigned long unused)
   13.86 -{
   13.87 -	int order = 0;
   13.88 -
   13.89 -	while (skbuff_order_cachep[order] != cachep)
   13.90 -		order++;
   13.91 -
   13.92 -	/* Do our best to allocate contiguous memory but fall back to IOMMU. */
   13.93 -	if (order != 0)
   13.94 -		(void)xen_create_contiguous_region(
   13.95 -			(unsigned long)buf, order, 0);
   13.96 -
   13.97 -	scrub_pages(buf, 1 << order);
   13.98 -}
   13.99 -
  13.100 -static void skbuff_dtor(void *buf, kmem_cache_t *cachep, unsigned long unused)
  13.101 -{
  13.102 -	int order = 0;
  13.103 -
  13.104 -	while (skbuff_order_cachep[order] != cachep)
  13.105 -		order++;
  13.106 -
  13.107 -	if (order != 0)
  13.108 -		xen_destroy_contiguous_region((unsigned long)buf, order);
  13.109 -}
  13.110 -
  13.111 -static int __init skbuff_init(void)
  13.112 -{
  13.113 -	static char name[MAX_SKBUFF_ORDER + 1][20];
  13.114 -	static char small_name[ARRAY_SIZE(skbuff_small)][20];
  13.115 -	unsigned long size;
  13.116 -	int i, order;
  13.117 -
  13.118 -	for (i = 0; i < ARRAY_SIZE(skbuff_small); i++) {
  13.119 -		size = skbuff_small[i].size;
  13.120 -		sprintf(small_name[i], "xen-skb-%lu", size);
  13.121 -		/*
  13.122 -		 * No ctor/dtor: objects do not span page boundaries, and they
  13.123 -		 * are only used on transmit path so no need for scrubbing.
  13.124 -		 */
  13.125 -		skbuff_small[i].cachep = kmem_cache_create(
  13.126 -			small_name[i], size, size, 0, NULL, NULL);
  13.127 -	}
  13.128 -
  13.129 -	for (order = 0; order <= MAX_SKBUFF_ORDER; order++) {
  13.130 -		size = PAGE_SIZE << order;
  13.131 -		sprintf(name[order], "xen-skb-%lu", size);
  13.132 -		if (is_running_on_xen() && is_initial_xendomain())
  13.133 -			skbuff_order_cachep[order] = kmem_cache_create(
  13.134 -				name[order], size, size, 0,
  13.135 -				skbuff_ctor, skbuff_dtor);
  13.136 -		else
  13.137 -			skbuff_order_cachep[order] = kmem_cache_create(
  13.138 -				name[order], size, size, 0, NULL, NULL);
  13.139 -			
  13.140 -	}
  13.141 -
  13.142 -	skbuff_cachep = skbuff_order_cachep[0];
  13.143 -
  13.144 -	return 0;
  13.145 -}
  13.146 -core_initcall(skbuff_init);
  13.147 -
  13.148 -EXPORT_SYMBOL(__dev_alloc_skb);
    14.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Thu Jan 18 18:39:07 2007 +0000
    14.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Thu Jan 18 18:40:30 2007 +0000
    14.3 @@ -136,42 +136,6 @@ static inline void maybe_schedule_tx_act
    14.4  		tasklet_schedule(&net_tx_tasklet);
    14.5  }
    14.6  
    14.7 -/*
    14.8 - * A gross way of confirming the origin of an skb data page. The slab
    14.9 - * allocator abuses a field in the page struct to cache the kmem_cache_t ptr.
   14.10 - */
   14.11 -static inline int is_xen_skb(struct sk_buff *skb)
   14.12 -{
   14.13 -	extern kmem_cache_t *skbuff_cachep;
   14.14 -	kmem_cache_t *cp = (kmem_cache_t *)virt_to_page(skb->head)->lru.next;
   14.15 -	return (cp == skbuff_cachep);
   14.16 -}
   14.17 -
   14.18 -/*
   14.19 - * We can flip without copying the packet unless:
   14.20 - *  1. The data is not allocated from our special cache; or
   14.21 - *  2. The main data area is shared; or
   14.22 - *  3. One or more fragments are shared; or
   14.23 - *  4. There are chained fragments.
   14.24 - */
   14.25 -static inline int is_flippable_skb(struct sk_buff *skb)
   14.26 -{
   14.27 -	int frag;
   14.28 -
   14.29 -	if (!is_xen_skb(skb) || skb_cloned(skb))
   14.30 -		return 0;
   14.31 -
   14.32 -	for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
   14.33 -		if (page_count(skb_shinfo(skb)->frags[frag].page) > 1)
   14.34 -			return 0;
   14.35 -	}
   14.36 -
   14.37 -	if (skb_shinfo(skb)->frag_list != NULL)
   14.38 -		return 0;
   14.39 -
   14.40 -	return 1;
   14.41 -}
   14.42 -
   14.43  static struct sk_buff *netbk_copy_skb(struct sk_buff *skb)
   14.44  {
   14.45  	struct skb_shared_info *ninfo;
   14.46 @@ -285,7 +249,7 @@ int netif_be_start_xmit(struct sk_buff *
   14.47  	 * Copy the packet here if it's destined for a flipping interface
   14.48  	 * but isn't flippable (e.g. extra references to data).
   14.49  	 */
   14.50 -	if (!netif->copying_receiver && !is_flippable_skb(skb)) {
   14.51 +	if (!netif->copying_receiver) {
   14.52  		struct sk_buff *nskb = netbk_copy_skb(skb);
   14.53  		if ( unlikely(nskb == NULL) )
   14.54  			goto drop;
    15.1 --- a/linux-2.6-xen-sparse/include/linux/skbuff.h	Thu Jan 18 18:39:07 2007 +0000
    15.2 +++ b/linux-2.6-xen-sparse/include/linux/skbuff.h	Thu Jan 18 18:40:30 2007 +0000
    15.3 @@ -338,8 +338,7 @@ static inline struct sk_buff *alloc_skb_
    15.4  
    15.5  extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp,
    15.6  					    unsigned int size,
    15.7 -					    gfp_t priority,
    15.8 -					    int fclone);
    15.9 +					    gfp_t priority);
   15.10  extern void	       kfree_skbmem(struct sk_buff *skb);
   15.11  extern struct sk_buff *skb_clone(struct sk_buff *skb,
   15.12  				 gfp_t priority);
   15.13 @@ -1069,7 +1068,7 @@ static inline struct sk_buff *__dev_allo
   15.14  	return skb;
   15.15  }
   15.16  #else
   15.17 -extern struct sk_buff *__dev_alloc_skb(unsigned int length, gfp_t gfp_mask);
   15.18 +extern struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask);
   15.19  #endif
   15.20  
   15.21  /**
    16.1 --- a/linux-2.6-xen-sparse/net/core/skbuff.c	Thu Jan 18 18:39:07 2007 +0000
    16.2 +++ b/linux-2.6-xen-sparse/net/core/skbuff.c	Thu Jan 18 18:40:30 2007 +0000
    16.3 @@ -132,7 +132,6 @@ void skb_under_panic(struct sk_buff *skb
    16.4   *	Buffers may only be allocated from interrupts using a @gfp_mask of
    16.5   *	%GFP_ATOMIC.
    16.6   */
    16.7 -#ifndef CONFIG_HAVE_ARCH_ALLOC_SKB
    16.8  struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
    16.9  			    int fclone)
   16.10  {
   16.11 @@ -187,7 +186,6 @@ nodata:
   16.12  	skb = NULL;
   16.13  	goto out;
   16.14  }
   16.15 -#endif /* !CONFIG_HAVE_ARCH_ALLOC_SKB */
   16.16  
   16.17  /**
   16.18   *	alloc_skb_from_cache	-	allocate a network buffer
   16.19 @@ -205,18 +203,14 @@ nodata:
   16.20   */
   16.21  struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp,
   16.22  				     unsigned int size,
   16.23 -				     gfp_t gfp_mask,
   16.24 -				     int fclone)
   16.25 +				     gfp_t gfp_mask)
   16.26  {
   16.27 -	kmem_cache_t *cache;
   16.28 -	struct skb_shared_info *shinfo;
   16.29  	struct sk_buff *skb;
   16.30  	u8 *data;
   16.31  
   16.32 -	cache = fclone ? skbuff_fclone_cache : skbuff_head_cache;
   16.33 -
   16.34  	/* Get the HEAD */
   16.35 -	skb = kmem_cache_alloc(cache, gfp_mask & ~__GFP_DMA);
   16.36 +	skb = kmem_cache_alloc(skbuff_head_cache,
   16.37 +			       gfp_mask & ~__GFP_DMA);
   16.38  	if (!skb)
   16.39  		goto out;
   16.40  
   16.41 @@ -233,29 +227,18 @@ struct sk_buff *alloc_skb_from_cache(kme
   16.42  	skb->data = data;
   16.43  	skb->tail = data;
   16.44  	skb->end  = data + size;
   16.45 -	/* make sure we initialize shinfo sequentially */
   16.46 -	shinfo = skb_shinfo(skb);
   16.47 -	atomic_set(&shinfo->dataref, 1);
   16.48 -	shinfo->nr_frags  = 0;
   16.49 -	shinfo->gso_size = 0;
   16.50 -	shinfo->gso_segs = 0;
   16.51 -	shinfo->gso_type = 0;
   16.52 -	shinfo->ip6_frag_id = 0;
   16.53 -	shinfo->frag_list = NULL;
   16.54  
   16.55 -	if (fclone) {
   16.56 -		struct sk_buff *child = skb + 1;
   16.57 -		atomic_t *fclone_ref = (atomic_t *) (child + 1);
   16.58 -
   16.59 -		skb->fclone = SKB_FCLONE_ORIG;
   16.60 -		atomic_set(fclone_ref, 1);
   16.61 -
   16.62 -		child->fclone = SKB_FCLONE_UNAVAILABLE;
   16.63 -	}
   16.64 +	atomic_set(&(skb_shinfo(skb)->dataref), 1);
   16.65 +	skb_shinfo(skb)->nr_frags  = 0;
   16.66 +	skb_shinfo(skb)->gso_size = 0;
   16.67 +	skb_shinfo(skb)->gso_segs = 0;
   16.68 +	skb_shinfo(skb)->gso_type = 0;
   16.69 +	skb_shinfo(skb)->ip6_frag_id = 0;
   16.70 +	skb_shinfo(skb)->frag_list = NULL;
   16.71  out:
   16.72  	return skb;
   16.73  nodata:
   16.74 -	kmem_cache_free(cache, skb);
   16.75 +	kmem_cache_free(skbuff_head_cache, skb);
   16.76  	skb = NULL;
   16.77  	goto out;
   16.78  }