Re: [PATCHv2 1/2] [NET] add skb_recycle_check() to enable netdriver skb recycling
From: Lennert Buytenhek <hidden>
Date: 2008-09-28 21:50:39
From: Lennert Buytenhek <hidden>
Date: 2008-09-28 21:50:39
On Mon, Sep 29, 2008 at 01:38:24AM +0400, Evgeniy Polyakov wrote:
Hi Lennert.
Hi,
quoted
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?
Doesn't it? It calls skb_release_head_state() (new function), which should do that. cheers, Lennert