]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
net: add documentation for skb recycling
authorStephen Hemminger <shemminger@vyatta.com>
Sun, 2 Nov 2008 04:01:09 +0000 (21:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Nov 2008 04:01:09 +0000 (21:01 -0700)
Commit 04a4bb55bcf35b63d40fd2725e58599ff8310dd7 ("net: add
skb_recycle_check() to enable netdriver skb recycling") added a
method for network drivers to recycle skbuffs, but while use of
this mechanism was documented in the commit message, it should
really have been added as a docbook comment as well -- this
patch does that.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c

index 4e22e3a35359169f172320337b91bf25ee7e3da7..ebb6b94f8af2343963f10c02b2d35f912a8c9d46 100644 (file)
@@ -449,6 +449,18 @@ void kfree_skb(struct sk_buff *skb)
        __kfree_skb(skb);
 }
 
+/**
+ *     skb_recycle_check - check if skb can be reused for receive
+ *     @skb: buffer
+ *     @skb_size: minimum receive buffer size
+ *
+ *     Checks that the skb passed in is not shared or cloned, and
+ *     that it is linear and its head portion at least as large as
+ *     skb_size so that it can be recycled as a receive buffer.
+ *     If these conditions are met, this function does any necessary
+ *     reference count dropping and cleans up the skbuff as if it
+ *     just came from __alloc_skb().
+ */
 int skb_recycle_check(struct sk_buff *skb, int skb_size)
 {
        struct skb_shared_info *shinfo;