[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070719090826.GA14860@2ka.mipt.ru>
Date: Thu, 19 Jul 2007 13:08:26 +0400
From: Evgeniy Polyakov <johnpol@....mipt.ru>
To: vinay ravuri <vinaynyc@...oo.com>
Cc: Stephen Hemminger <shemminger@...ux-foundation.org>,
netdev@...r.kernel.org
Subject: Re: Socket Buffers and Memory Managment
Hi.
On Wed, Jul 18, 2007 at 11:51:03PM -0700, vinay ravuri (vinaynyc@...oo.com) wrote:
> How about the following approach:
>
> I allocate an skb of 0 bytes and replace data element
> of skb struct (i.e. skb.data = addr_given_by_hw) when
> the h/w interrupts me with a packet. I register for a
> destructor for this skb and when the kernel is ready
> to free the skb, I make sure that my free is invoked -
> Ofcourse this is assuming that their is a facility in
> linux socket buffers to be able to do destructors. Is
> this approach a viable, if so, are any gottcha's?
It will not work, since kfree_skb() eventually tries to free skb->head
into kmem cache, so you will need to hack kfree_skb() not to try to
release that data at all. Likely the best zero-copy approach in your
case is to use frag_list, but be ready that your netwrok will regularily
stall - when hardware buffers are all in use and not yet freed, you will
not be able to send/receive new packets, although amount of memory will
allow that.
> -Vinay
--
Evgeniy Polyakov
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists