summaryrefslogtreecommitdiff
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorIan Pratt <ian.pratt@cl.cam.ac.uk>2004-11-17 22:03:59 -0800
committerDavid S. Miller <davem@nuts.davemloft.net>2004-11-17 22:03:59 -0800
commit8f78d753284f7bee7cf7bcd27e230eb0a68aa751 (patch)
tree046cff98428b12d71b2426954aab9ba4c6dcc0cc /include/linux/skbuff.h
parentfcf4a4369976cb355092c049e30916d9706fbae0 (diff)
[NET]: Add alloc_skb_from_cache.
This serves two purposes: firstly, we like to allocate page-sized skbs as this means we zero-copy transfer of network buffers between guest operating systems. Secondly, it enables us to have a cache of pages that have been used for network buffers that we can be more lax about scrubbing when they change VM ownership (since they could be sniffed on the wire). Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 71fc2bdc0cd6..57a2843faa21 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -292,6 +292,8 @@ struct sk_buff {
extern void __kfree_skb(struct sk_buff *skb);
extern struct sk_buff *alloc_skb(unsigned int size, int priority);
+extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp,
+ unsigned int size, int priority);
extern void kfree_skbmem(struct sk_buff *skb);
extern struct sk_buff *skb_clone(struct sk_buff *skb, int priority);
extern struct sk_buff *skb_copy(const struct sk_buff *skb, int priority);
@@ -935,6 +937,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
*
* %NULL is returned in there is no free memory.
*/
+#ifndef CONFIG_HAVE_ARCH_DEV_ALLOC_SKB
static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
int gfp_mask)
{
@@ -943,6 +946,9 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
skb_reserve(skb, 16);
return skb;
}
+#else
+extern struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask);
+#endif
/**
* dev_alloc_skb - allocate an skbuff for sending