From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from USCAMAIL.TILERA.COM (uscamail.tilera.com [12.218.212.166]) by dpdk.org (Postfix) with ESMTP id 021B8959 for ; Mon, 6 Oct 2014 23:50:38 +0200 (CEST) Received: from [10.107.0.247] (10.109.0.23) by USCAEXCH2.tad.internal.tilera.com (10.103.0.33) with Microsoft SMTP Server id 14.3.181.6; Mon, 6 Oct 2014 14:57:47 -0700 Message-ID: <543311C7.40906@tilera.com> Date: Mon, 6 Oct 2014 15:03:51 -0700 From: Cyril Chemparathy User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Chao Zhu , References: <1411724186-8036-1-git-send-email-bjzhuc@cn.ibm.com> <1411724186-8036-10-git-send-email-bjzhuc@cn.ibm.com> In-Reply-To: <1411724186-8036-10-git-send-email-bjzhuc@cn.ibm.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.109.0.23] Subject: Re: [dpdk-dev] [PATCH 09/12] Remove iopl operation for IBM Power architecture X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2014 21:50:38 -0000 On 9/26/2014 2:36 AM, Chao Zhu wrote: > iopl() call is mostly for the i386 architecture. In Power architecture. > It doesn't exist. This patch modified rte_eal_iopl_init() and make it > return -1 on Power. This means rte_config.flags will not contain > EAL_FLG_HIGH_IOPL flag on IBM Power architecture. Since iopl() is an x86-only thing, shouldn't the code be conditional on defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) instead of below? Better still, should we maybe break out an architecture specific init function? This function could set iopl on x86, and possibly do other lowlevel init things on other architectures... > Signed-off-by: Chao Zhu > --- > lib/librte_eal/linuxapp/eal/eal.c | 11 +++++++++++ > 1 files changed, 11 insertions(+), 0 deletions(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c > index 4869e7c..8cc1f21 100644 > --- a/lib/librte_eal/linuxapp/eal/eal.c > +++ b/lib/librte_eal/linuxapp/eal/eal.c > @@ -50,7 +50,10 @@ > #include > #include > #include > +/* Power architecture doesn't have this header file */ > +#ifndef RTE_ARCH_PPC_64 > #include > +#endif > > #include > #include > @@ -1019,11 +1022,19 @@ rte_eal_mcfg_complete(void) > > /* > * Request iopl privilege for all RPL, returns 0 on success > + * > + * Power architecture doesn't have iopl function, so this function > + * return -1 on Power architecture, because this function is only used > + * in rte_eal_init to add EAL_FLG_HIGH_IOPL to rte_config.flags. > */ > static int > rte_eal_iopl_init(void) > { > +#ifndef RTE_ARCH_PPC_64 > return iopl(HIGHEST_RPL); > +#else > + return -1; > +#endif > } > > /* Launch threads, called at application init(). */