Re: [PATCHv2 1/2] [NET] add skb_recycle_check() to enable netdriver skb recycling
From: Evgeniy Polyakov <hidden>
Date: 2008-09-28 21:39:49
From: Evgeniy Polyakov <hidden>
Date: 2008-09-28 21:39:49
Hi Lennert. On Sun, Sep 28, 2008 at 10:46:33PM +0200, Lennert Buytenhek (buytenh@wantstofly.org) wrote:
This patch adds skb_recycle_check(), which can be used by a network driver after transmitting an skb to check whether this skb can be recycled as a receive buffer. skb_recycle_check() checks that the skb is not shared or cloned, and that it is linear and its head portion large enough (as determined by the driver) to be recycled as a receive buffer. If these conditions are met, it does any necessary reference count dropping and cleans up the skbuff as if it just came from __alloc_skb().
Shouldn't it also perfrom all actions kfree_skb() does except actual freeing, since given skb can be from socket, so it may leak dst entries and break socket memory accounting? -- Evgeniy Polyakov