From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 56FF9A0C3F; Sat, 12 Jun 2021 09:08:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA6DB4014F; Sat, 12 Jun 2021 09:07:59 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id BB17A4003F for ; Sat, 12 Jun 2021 09:07:57 +0200 (CEST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G27vk5L1bzWnlb; Sat, 12 Jun 2021 15:02:58 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 12 Jun 2021 15:07:51 +0800 Received: from [127.0.0.1] (10.40.190.165) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 12 Jun 2021 15:07:51 +0800 From: fengchengwen To: Ruifeng Wang , Thomas Monjalon , ferruh.yigit CC: dev , "Richardson, Bruce" , vladimir.medvedkin , viktorin , Jerin Jacob , nd References: <1621495007-28387-1-git-send-email-fengchengwen@huawei.com> <1621562002-10961-1-git-send-email-fengchengwen@huawei.com> Message-ID: <4d1b74ad-fc78-7de0-7f37-27813aff980b@huawei.com> Date: Sat, 12 Jun 2021 15:07:51 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.40.190.165] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v3] build: fix SVE compile error with gcc8.3 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Friendly ping On 2021/5/27 15:12, Fengchengwen wrote: > Hi, Thomas > > Could you review this patch? Thanks > > > From:Ruifeng Wang > To:Fengchengwen ;Thomas Monjalon ;ferruh.yigit > Cc:dev ;Richardson, Bruce ;vladimir.medvedkin ;viktorin ;Jerin Jacob ;nd > Date:2021-05-25 14:02:20 > Subject:RE: [PATCH v3] build: fix SVE compile error with gcc8.3 > >> -----Original Message----- >> From: Chengwen Feng < fengchengwen@huawei.com> >> Sent: Friday, May 21, 2021 9:53 AM >> To: thomas@monjalon.net; ferruh.yigit@intel.com; Ruifeng Wang >> < Ruifeng.Wang@arm.com> >> Cc: dev@dpdk.org; bruce.richardson@intel.com; >> vladimir.medvedkin@intel.com; viktorin@rehivetech.com; >> jerinj@marvell.com >> Subject: [PATCH v3] build: fix SVE compile error with gcc8.3 >> >> If the target machine has SVE feature (e.g. "-march=armv8.2-a+sve'), and the >> compiler are gcc8.3, it will compile error: >> In file included from ../dpdk-next-net/lib/eal/common/ >> eal_common_options.c:38: >> ../dpdk-next-net/lib/eal/arm/include/rte_vect.h:13:10: fatal >> error: arm_sve.h: No such file or directory >> #include >> ^~~~~~~~~~~ >> compilation terminated. >> >> The root cause is that gcc8.3 supports SVE (the macro __ARM_FEATURE_SVE >> was 1), but it doesn't support SVE ACLE [1]. >> >> The solution: >> a) Detect compiler whether support SVE ACLE, if support then define >> CC_SVE_ACLE_SUPPORT macro. >> b) Use the CC_SVE_ACLE_SUPPORT macro to include SVE header file. >> >> [1] ACLE: Arm C Language Extensions, the SVE ACLE header file is >> , user should include it when writing ACLE SVE code. >> >> Fixes: 67b68824a82d ("lpm/arm: support SVE") >> >> Signed-off-by: Chengwen Feng < fengchengwen@huawei.com> >> --- >> v3: >> * double-indent 'cc.check_header('arm_sve.h')' line >> * move set 'CC_SVE_ACLE_SUPPORT' logic to the back (not in the middle >> of compile_time_cpuflags setting) >> * fix minor syntax error in commit log >> v2: >> * modify title start with 'build' >> >> --- >> config/arm/meson.build | 5 +++++ >> lib/eal/arm/include/rte_vect.h | 2 +- >> lib/lpm/rte_lpm.h | 2 +- >> 3 files changed, 7 insertions(+), 2 deletions(-) >> >> diff --git a/config/arm/meson.build b/config/arm/meson.build index >> e83a56e..08299b0 100644 >> --- a/config/arm/meson.build >> +++ b/config/arm/meson.build >> @@ -488,3 +488,8 @@ if cc.get_define('__ARM_FEATURE_CRYPTO', args: >> machine_args) != '' >> compile_time_cpuflags += ['RTE_CPUFLAG_AES', 'RTE_CPUFLAG_PMULL', >> 'RTE_CPUFLAG_SHA1', 'RTE_CPUFLAG_SHA2'] endif >> + >> +if (cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != '' and >> + cc.check_header('arm_sve.h')) >> + dpdk_conf.set('CC_SVE_ACLE_SUPPORT', 1) endif >> diff --git a/lib/eal/arm/include/rte_vect.h b/lib/eal/arm/include/rte_vect.h >> index 093e912..277b656 100644 >> --- a/lib/eal/arm/include/rte_vect.h >> +++ b/lib/eal/arm/include/rte_vect.h >> @@ -9,7 +9,7 @@ >> #include "generic/rte_vect.h" >> #include "rte_debug.h" >> #include "arm_neon.h" >> -#ifdef __ARM_FEATURE_SVE >> +#ifdef CC_SVE_ACLE_SUPPORT >> #include >> #endif >> >> diff --git a/lib/lpm/rte_lpm.h b/lib/lpm/rte_lpm.h index 28b5768..9262814 >> 100644 >> --- a/lib/lpm/rte_lpm.h >> +++ b/lib/lpm/rte_lpm.h >> @@ -402,7 +402,7 @@ rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t >> ip, uint32_t hop[4], >> uint32_t defv); >> >> #if defined(RTE_ARCH_ARM) >> -#ifdef __ARM_FEATURE_SVE >> +#ifdef CC_SVE_ACLE_SUPPORT >> #include "rte_lpm_sve.h" >> #else >> #include "rte_lpm_neon.h" >> -- >> 2.8.1 > > Acked-by: Ruifeng Wang < ruifeng.wang@arm.com> >