Re: [PATCH] net: increase skb->users instead of skb_clone()

Eric Dumazet
2010-12-16T07:50:14Z

Le jeudi 16 décembre 2010 à 15:23 +0800, Changli Gao a écrit :
> On Thu, Dec 16, 2010 at 3:18 PM, Eric Dumazet <eric.dumazet@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;
> }
>

Thats right, your patch seems fine, thanks !

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>