[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1292510518.2883.207.camel@edumazet-laptop>
Date: Thu, 16 Dec 2010 15:41:58 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Junchang Wang <junchangwang@...il.com>
Cc: Changli Gao <xiaosuo@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Tom Herbert <therbert@...gle.com>,
Jiri Pirko <jpirko@...hat.com>,
Fenghua Yu <fenghua.yu@...el.com>,
Xinan Tang <xinan.tang@...el.com>, netdev@...r.kernel.org
Subject: Re: [PATCH] net: increase skb->users instead of skb_clone()
Le jeudi 16 décembre 2010 à 22:31 +0800, Junchang Wang a écrit :
> On Thu, Dec 16, 2010 at 10:18 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> >
> > Yes, and no.
> >
> > Consider the case you have one receiver.
> >
> > Packet given after Changli patch wont be shared, so packet_rcv wont
> > clone it : Thats a win. Only one skb_clone() done instead of two.
> >
> > Consider case with 2 receivers :
> >
> > First time we call packet_rcv, packet is shared (because we call
> > deliver_skb(), so packet_rcv clones it. Normal situation, we really need
> > to clone it.
>
> Got it. Thanks.
>
> >
> > Second time, we give a non shared packet : Thats a win over previous
> > situation.
> >
> But, if we have N receivers, we get only the last one win - the first N-1 will
> call deliver_skb().
>
Yes, but you want to, because each receiver has to make a private copy
of the skb.
The big win is that if packet if filtered out (not accepted by the
socket filter), you end with no extra skb_clone() at all.
Say you have 8 receivers, with a filter matching some hash/cpu, and only
one af_packet socket will take the message.
Before patch : 8 skb_clones()
After patch : one skb_clone()
If I undertood patch intent ;)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists