From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id EBB9E2A9 for ; Tue, 9 Dec 2014 16:03:42 +0100 (CET) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1XyMK2-0006EU-4h; Tue, 09 Dec 2014 10:03:38 -0500 Date: Tue, 9 Dec 2014 10:03:21 -0500 From: Neil Horman To: Zhigang Lu Message-ID: <20141209150321.GC28871@hmsreliant.think-freely.org> References: <1418029178-25162-1-git-send-email-zlu@ezchip.com> <1418029178-25162-15-git-send-email-zlu@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1418029178-25162-15-git-send-email-zlu@ezchip.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 14/15] app/test: turn off cpu flag checks for tile 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: Tue, 09 Dec 2014 15:03:43 -0000 On Mon, Dec 08, 2014 at 04:59:37PM +0800, Zhigang Lu wrote: > Tile processor doesn't have CPU flag hardware registers, so this patch > turns off cpu flag checks for tile. > > Signed-off-by: Zhigang Lu > Signed-off-by: Cyril Chemparathy > --- > app/test/test_cpuflags.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/app/test/test_cpuflags.c b/app/test/test_cpuflags.c > index 5aeba5d..da93af5 100644 > --- a/app/test/test_cpuflags.c > +++ b/app/test/test_cpuflags.c > @@ -113,7 +113,7 @@ test_cpuflags(void) > > printf("Check for ICACHE_SNOOP:\t\t"); > CHECK_FOR_FLAG(RTE_CPUFLAG_ICACHE_SNOOP); > -#else > +#elif !defined(RTE_ARCH_TILE) > printf("Check for SSE:\t\t"); > CHECK_FOR_FLAG(RTE_CPUFLAG_SSE); > Please stop this. It doesn't make sense for a library that supports multiple arches, we need some way to generically test for flags that doesn't involve forcing applications to do ton's of ifdeffing. Perhaps rte_cpu_get_flag_enabled needs to do a flag table lookup based on the detected arch at run time, and return the appropriate response. In the case of tile, it can just be an empty table, so 0 is always returned. But making an application responsible for doing arch checks is a guarantee to write non-portable applications Neil > -- > 2.1.2 > >