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

Changli Gao
2010-12-16T14:12:32Z

On Thu, Dec 16, 2010 at 10:05 PM, Junchang Wang <junchangwang@gmail.com> wrote:
>
> Hi Changli,
> Take af_packet for example, I can't see benefit from this patch.
>
>> +static inline int deliver_skb(struct sk_buff *skb,
>> +                             struct packet_type *pt_prev,
>> +                             struct net_device *orig_dev)
>> +{
>> +       atomic_inc(&skb->users);
>> +       return pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
>> +}
> The increment call will incur skb_shared() failure in packet_rcv.
> In reality, packet_rcv has to clone this packet by itself.
>
>

This happens when run_filter returns non zero. For your case, only
small parts of packets match bpf filter.

--
Regards,
Changli Gao(xiaosuo@gmail.com)