From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <helin.zhang@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id 9A7391288
 for <dev@dpdk.org>; Mon, 19 Jan 2015 03:46:48 +0100 (CET)
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by fmsmga101.fm.intel.com with ESMTP; 18 Jan 2015 18:46:47 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="442101072"
Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98])
 by FMSMGA003.fm.intel.com with ESMTP; 18 Jan 2015 18:33:36 -0800
Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by
 PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS)
 id 14.3.195.1; Mon, 19 Jan 2015 10:45:08 +0800
Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.231]) by
 SHSMSX152.ccr.corp.intel.com ([169.254.6.173]) with mapi id 14.03.0195.001;
 Mon, 19 Jan 2015 10:45:06 +0800
From: "Zhang, Helin" <helin.zhang@intel.com>
To: Neil Horman <nhorman@tuxdriver.com>, Ravi Kerur <rkerur@gmail.com>
Thread-Topic: [dpdk-dev] [PATCH v2] Fix rte_is_power_of_2
Thread-Index: AQHQIenV369W04O+6UyhxU496sK8VpyjCjgAgABY8ICAI3vz8A==
Date: Mon, 19 Jan 2015 02:45:05 +0000
Message-ID: <F35DEAC7BCE34641BA9FAC6BCA4A12E70A7EA935@SHSMSX104.ccr.corp.intel.com>
References: <1419694115-1892-1-git-send-email-rkerur@gmail.com>
 <1419694244-2018-1-git-send-email-rkerur@gmail.com>
 <20141227204903.GB16138@localhost.localdomain>
In-Reply-To: <20141227204903.GB16138@localhost.localdomain>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] Fix rte_is_power_of_2
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 19 Jan 2015 02:46:49 -0000

Hi Kerur

It seems that your fix result in cannot launching applications.
I don't suspect the correction of your fix, but somewhere else needs to be =
corrected together with your fix.

Logs:
/************************************************************
RING: Cannot reserve memory for tailq
EAL: rte_eal_common_log_init(): cannot create log_history mempool
PANIC in rte_eal_init():
Cannot init logs
6: [./l3fwd() [0x41d7c5]]
5: [/lib64/libc.so.6(__libc_start_main+0xf5) [0x3d8a221d65]]
4: [./l3fwd(main+0x23) [0x41c493]]
3: [./l3fwd(rte_eal_init+0x108d) [0x466f7d]]
2: [./l3fwd(__rte_panic+0xc9) [0x41c358]]
1: [./l3fwd(rte_dump_stack+0x18) [0x46e258]]

Regards,
Helin

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> Sent: Sunday, December 28, 2014 4:49 AM
> To: Ravi Kerur
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] Fix rte_is_power_of_2
>=20
> On Sat, Dec 27, 2014 at 10:30:44AM -0500, Ravi Kerur wrote:
> > rte_is_power_of_2 returns true for 0 and 0 is not power_of_2. Fix by
> > checking for n.
> >
> > Signed-off-by: Ravi Kerur <rkerur@gmail.com>
> > ---
> >  lib/librte_eal/common/include/rte_common.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_eal/common/include/rte_common.h
> > b/lib/librte_eal/common/include/rte_common.h
> > index 921b91f..8ac940c 100644
> > --- a/lib/librte_eal/common/include/rte_common.h
> > +++ b/lib/librte_eal/common/include/rte_common.h
> > @@ -203,7 +203,7 @@ extern int RTE_BUILD_BUG_ON_detected_error;
> > static inline int  rte_is_power_of_2(uint32_t n)  {
> > -	return ((n-1) & n) =3D=3D 0;
> > +	return n && !(n & (n - 1));
> >  }
> >
> >  /**
> > --
> > 1.9.1
> >
> >
> Acked-by: Neil Horman <nhorman@tuxdriver.com>