netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH] net: add destructor for skb data.
Date: Mon, 7 Apr 2008 07:10:12 +1000	[thread overview]
Message-ID: <200804070710.12490.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20080406092018.GA32293@2ka.mipt.ru>

On Sunday 06 April 2008 19:20:18 Evgeniy Polyakov wrote:
> Hi Rusty.
>
> On Sun, Apr 06, 2008 at 01:20:59PM +1000, Rusty Russell 
(rusty@rustcorp.com.au) wrote:
> >     I don't think so.  For a start, the skb destructor is called while
> > the skb is still in the socket queue (ie. the data is still live). 
> > Secondly, the original skb can be freed while clones still reference the
> > data.
>
> That is what it is for - to remove data from any queues and free it.
> One can check if skb was cloned and do not perform some steps, instead
> call old destructor. Destructor for the last clone will cleanup whatever
> is needed. Thoughts?

The old destructor is in some other skb, you'd have to carry it around.  
And skb_orphan() calls the destructor early deliberately.

The current skb destructor is for the sk_buff, not the data.  It's clearest to 
keep them separate.

Cheers,
Rusty.

      parent reply	other threads:[~2008-04-06 21:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-05 11:56 [PATCH] net: add destructor for skb data Rusty Russell
2008-04-05 13:06 ` Evgeniy Polyakov
2008-04-06  3:20   ` Rusty Russell
2008-04-06  9:20     ` Evgeniy Polyakov
2008-04-06 13:32       ` Evgeniy Polyakov
2008-04-06 21:10       ` Rusty Russell [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=200804070710.12490.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=davem@davemloft.net \
    --cc=johnpol@2ka.mipt.ru \
    --cc=netdev@vger.kernel.org \
    /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).