public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Junchang Wang <junchangwang@gmail.com>
Cc: Changli Gao <xiaosuo@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Tom Herbert <therbert@google.com>, Jiri Pirko <jpirko@redhat.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Xinan Tang <xinan.tang@intel.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] net: increase skb->users instead of skb_clone()
Date: Thu, 16 Dec 2010 15:30:57 +0100	[thread overview]
Message-ID: <1292509857.2883.190.camel@edumazet-laptop> (raw)
In-Reply-To: <AANLkTim--M0TvW9oUi0UO6Ej_8aLezneQsdRx7X0CXDt@mail.gmail.com>

Le jeudi 16 décembre 2010 à 22:20 +0800, Junchang Wang a écrit :
> On Thu, Dec 16, 2010 at 3:23 PM, Changli Gao <xiaosuo@gmail.com> wrote:
> 
> >> You beat me, but I was thinking of a different way, adding a new
> >> pt_prev->xmit_func(), handling all the details (no need for atomic ops
> >> on skb users if packet is not delivered at all).
> >>
> >> By the way, your patch is not 100% safe/OK, because af_packet rcv()
> >> handler writes on skb (skb_pull() and all)
> >>
> >
> > But af_packet_rcv() restores skbs at last.
> >
> >        if (skb_head != skb->data && skb_shared(skb)) {
> >                skb->data = skb_head;
> >                skb->len = skb_len;
> >        }
> >
> If af packet_rcv invokes skb_clone, this skb is differ from the original one.
> Eric's warning is right.

It was a false alarm.

If packet_rcv() invokes skb_clone(), skb still points to original skb.
No worry.



  reply	other threads:[~2010-12-16 14:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-16  5:57 [PATCH] net: increase skb->users instead of skb_clone() Changli Gao
2010-12-16  7:18 ` Eric Dumazet
2010-12-16  7:23   ` Changli Gao
2010-12-16  7:50     ` Eric Dumazet
2010-12-16 14:20     ` Junchang Wang
2010-12-16 14:30       ` Eric Dumazet [this message]
2010-12-16 14:05 ` Junchang Wang
2010-12-16 14:12   ` Changli Gao
2010-12-16 14:36     ` Junchang Wang
2010-12-16 14:18   ` Eric Dumazet
2010-12-16 14:31     ` Junchang Wang
2010-12-16 14:41       ` Eric Dumazet
2010-12-16 14:43         ` Changli Gao
2010-12-17  0:24         ` Junchang Wang
2010-12-20  5:50 ` David Miller

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=1292509857.2883.190.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=fenghua.yu@intel.com \
    --cc=jpirko@redhat.com \
    --cc=junchangwang@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.com \
    --cc=xiaosuo@gmail.com \
    --cc=xinan.tang@intel.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