netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: vinay ravuri <vinaynyc@yahoo.com>,
	Stephen Hemminger <shemminger@linux-foundation.org>,
	netdev@vger.kernel.org
Subject: Re: Socket Buffers and Memory Managment
Date: 20 Jul 2007 13:50:30 +0200	[thread overview]
Message-ID: <p73tzrzuwe1.fsf@bingen.suse.de> (raw)
In-Reply-To: <20070719090826.GA14860@2ka.mipt.ru>

Evgeniy Polyakov <johnpol@2ka.mipt.ru> writes:

> Hi.
> 
> On Wed, Jul 18, 2007 at 11:51:03PM -0700, vinay ravuri (vinaynyc@yahoo.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,

And in addition if the skbuff is ever passed towards the socket
layer the destructor will be overwritten

-Andi

      reply	other threads:[~2007-07-20 10:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17 17:20 Socket Buffers and Memory Managment vinay ravuri
2007-07-17 19:41 ` Stephen Hemminger
2007-07-17 19:44   ` David Miller
2007-07-18 17:13   ` Roy Pledge
2007-07-18 21:22     ` Stephen Hemminger
2007-07-19  6:51   ` vinay ravuri
2007-07-19  7:04     ` pradeep singh
2007-07-19  8:10     ` Stephen Hemminger
2007-07-19  9:08     ` Evgeniy Polyakov
2007-07-20 11:50       ` Andi Kleen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=p73tzrzuwe1.fsf@bingen.suse.de \
    --to=andi@firstfloor.org \
    --cc=johnpol@2ka.mipt.ru \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    --cc=vinaynyc@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).