[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-31 Thread Zoltan Kiss
Hi, On 30/03/15 18:39, Don Provan wrote: > if (likely (rte_mbuf_refcnt_read(m) == 1) || > likely (rte_mbuf_refcnt_update(m, -1) == 0)) > > In all the debate about atomics, I don't think anyone got around to pointing > out that in the unlikely case that

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-30 Thread Marc Sune
On 27/03/15 15:30, Bruce Richardson wrote: > On Fri, Mar 27, 2015 at 10:07:35AM -0400, Neil Horman wrote: >> On Fri, Mar 27, 2015 at 11:32:38AM +, Bruce Richardson wrote: >>> On Fri, Mar 27, 2015 at 06:29:56AM -0400, Neil Horman wrote: On Thu, Mar 26, 2015 at 09:14:54PM +, Bruce Rich

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-30 Thread Thomas Monjalon
2015-03-27 16:56, Richardson, Bruce: > > > -Original Message- > > From: Neil Horman [mailto:nhorman at tuxdriver.com] > > Sent: Friday, March 27, 2015 4:44 PM > > To: Richardson, Bruce > > Cc: dev at dpdk.org > > Subject: Re: [dpdk-dev] [PATCH]

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-30 Thread Don Provan
> > > > > > > > if (likely (rte_mbuf_refcnt_read(m) == 1) || > > > > > > > > likely (rte_mbuf_refcnt_update(m, -1) > > > > > > > > == 0)) In all the debate about atomics, I don't think anyone got around to pointing out that in the unlikely case that the refcnt is

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-30 Thread Neil Horman
On Mon, Mar 30, 2015 at 09:39:13PM +0200, Marc Sune wrote: > > > On 27/03/15 15:30, Bruce Richardson wrote: > >On Fri, Mar 27, 2015 at 10:07:35AM -0400, Neil Horman wrote: > >>On Fri, Mar 27, 2015 at 11:32:38AM +, Bruce Richardson wrote: > >>>On Fri, Mar 27, 2015 at 06:29:56AM -0400, Neil Hor

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-30 Thread Stephen Hemminger
On Mon, 30 Mar 2015 17:39:06 + Don Provan wrote: > In all the debate about atomics, I don't think anyone got around to pointing > out that in the unlikely case that the refcnt is not 1, then it's equally > unlikely that decrementing it will result in 0 despite the code's claim to > the con

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-27 Thread Richardson, Bruce
> -Original Message- > From: Neil Horman [mailto:nhorman at tuxdriver.com] > Sent: Friday, March 27, 2015 4:44 PM > To: Richardson, Bruce > Cc: dev at dpdk.org > Subject: Re: [dpdk-dev] [PATCH] mbuf: add comment explaining confusing > code > > On Fri, Mar 2

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-27 Thread Bruce Richardson
On Fri, Mar 27, 2015 at 10:38:41AM -0400, Neil Horman wrote: > On Fri, Mar 27, 2015 at 02:30:50PM +, Bruce Richardson wrote: > > On Fri, Mar 27, 2015 at 10:07:35AM -0400, Neil Horman wrote: > > > On Fri, Mar 27, 2015 at 11:32:38AM +, Bruce Richardson wrote: > > > > On Fri, Mar 27, 2015 at 0

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-27 Thread Bruce Richardson
On Fri, Mar 27, 2015 at 10:07:35AM -0400, Neil Horman wrote: > On Fri, Mar 27, 2015 at 11:32:38AM +, Bruce Richardson wrote: > > On Fri, Mar 27, 2015 at 06:29:56AM -0400, Neil Horman wrote: > > > On Thu, Mar 26, 2015 at 09:14:54PM +, Bruce Richardson wrote: > > > > The logic used in the con

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-27 Thread Neil Horman
On Fri, Mar 27, 2015 at 02:55:27PM +, Bruce Richardson wrote: > On Fri, Mar 27, 2015 at 10:38:41AM -0400, Neil Horman wrote: > > On Fri, Mar 27, 2015 at 02:30:50PM +, Bruce Richardson wrote: > > > On Fri, Mar 27, 2015 at 10:07:35AM -0400, Neil Horman wrote: > > > > On Fri, Mar 27, 2015 at 1

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-27 Thread Bruce Richardson
On Fri, Mar 27, 2015 at 06:29:56AM -0400, Neil Horman wrote: > On Thu, Mar 26, 2015 at 09:14:54PM +, Bruce Richardson wrote: > > The logic used in the condition check before freeing an mbuf is > > sometimes confusing, so explain it in a proper comment. > > > > Signed-off-by: Bruce Richardson

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-27 Thread Ananyev, Konstantin
> -Original Message- > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Neil Horman > Sent: Friday, March 27, 2015 10:30 AM > To: Richardson, Bruce > Cc: dev at dpdk.org > Subject: Re: [dpdk-dev] [PATCH] mbuf: add comment explaining confusing code > > On

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-27 Thread Neil Horman
On Fri, Mar 27, 2015 at 02:30:50PM +, Bruce Richardson wrote: > On Fri, Mar 27, 2015 at 10:07:35AM -0400, Neil Horman wrote: > > On Fri, Mar 27, 2015 at 11:32:38AM +, Bruce Richardson wrote: > > > On Fri, Mar 27, 2015 at 06:29:56AM -0400, Neil Horman wrote: > > > > On Thu, Mar 26, 2015 at 0

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-27 Thread Neil Horman
On Fri, Mar 27, 2015 at 11:32:38AM +, Bruce Richardson wrote: > On Fri, Mar 27, 2015 at 06:29:56AM -0400, Neil Horman wrote: > > On Thu, Mar 26, 2015 at 09:14:54PM +, Bruce Richardson wrote: > > > The logic used in the condition check before freeing an mbuf is > > > sometimes confusing, so

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-27 Thread Neil Horman
On Fri, Mar 27, 2015 at 11:32:38AM +, Bruce Richardson wrote: > On Fri, Mar 27, 2015 at 06:29:56AM -0400, Neil Horman wrote: > > On Thu, Mar 26, 2015 at 09:14:54PM +, Bruce Richardson wrote: > > > The logic used in the condition check before freeing an mbuf is > > > sometimes confusing, so

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-27 Thread Neil Horman
On Thu, Mar 26, 2015 at 09:14:54PM +, Bruce Richardson wrote: > The logic used in the condition check before freeing an mbuf is > sometimes confusing, so explain it in a proper comment. > > Signed-off-by: Bruce Richardson > --- > lib/librte_mbuf/rte_mbuf.h | 10 ++ > 1 file changed,

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-26 Thread Olivier MATZ
Hi Bruce, On 03/26/2015 10:14 PM, Bruce Richardson wrote: > The logic used in the condition check before freeing an mbuf is > sometimes confusing, so explain it in a proper comment. > > Signed-off-by: Bruce Richardson > --- > lib/librte_mbuf/rte_mbuf.h | 10 ++ > 1 file changed, 10 inse

[dpdk-dev] [PATCH] mbuf: add comment explaining confusing code

2015-03-26 Thread Bruce Richardson
The logic used in the condition check before freeing an mbuf is sometimes confusing, so explain it in a proper comment. Signed-off-by: Bruce Richardson --- lib/librte_mbuf/rte_mbuf.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_