* [dpdk-dev] [PATCH] lpm/arm: fix SVE compile error with gcc8.3
@ 2021-05-20 7:16 Chengwen Feng
2021-05-20 8:17 ` Ruifeng Wang
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Chengwen Feng @ 2021-05-20 7:16 UTC (permalink / raw)
To: thomas, ferruh.yigit
Cc: dev, bruce.richardson, vladimir.medvedkin, viktorin,
ruifeng.wang, jerinj
If the target machine has SVE feature (e.g. "-march=armv8.2-a+sve'),
and the compiler is 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 <arm_sve.h>
^~~~~~~~~~~
compilation terminated.
The root cause is that gcc8.3 support 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
<arm_sve.h>, user should include it when writing ACLE SVE code.
Fixes: 67b68824a82d ("lpm/arm: support SVE")
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
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..bff70e4 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -480,6 +480,11 @@ if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
compile_time_cpuflags += ['RTE_CPUFLAG_NEON']
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
+
if cc.get_define('__ARM_FEATURE_CRC32', args: machine_args) != ''
compile_time_cpuflags += ['RTE_CPUFLAG_CRC32']
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 <arm_sve.h>
#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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] lpm/arm: fix SVE compile error with gcc8.3
2021-05-20 7:16 [dpdk-dev] [PATCH] lpm/arm: fix SVE compile error with gcc8.3 Chengwen Feng
@ 2021-05-20 8:17 ` Ruifeng Wang
2021-05-20 11:45 ` fengchengwen
2021-05-20 11:40 ` [dpdk-dev] [PATCH v2] build: " Chengwen Feng
2021-05-21 1:53 ` [dpdk-dev] [PATCH v3] " Chengwen Feng
2 siblings, 1 reply; 12+ messages in thread
From: Ruifeng Wang @ 2021-05-20 8:17 UTC (permalink / raw)
To: Chengwen Feng, thomas, ferruh.yigit
Cc: dev, bruce.richardson, vladimir.medvedkin, viktorin, jerinj, nd
Thanks for this patch.
Minor comment below.
> -----Original Message-----
> From: Chengwen Feng <fengchengwen@huawei.com>
> Sent: Thursday, May 20, 2021 3:17 PM
> To: thomas@monjalon.net; ferruh.yigit@intel.com
> Cc: dev@dpdk.org; bruce.richardson@intel.com;
> vladimir.medvedkin@intel.com; viktorin@rehivetech.com; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; jerinj@marvell.com
> Subject: [PATCH] lpm/arm: fix SVE compile error with gcc8.3
This is build fix and not specific to lpm.
Use 'build:' instead of 'lpm/arm:'?
>
> If the target machine has SVE feature (e.g. "-march=armv8.2-a+sve'), and the
> compiler is 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 <arm_sve.h>
> ^~~~~~~~~~~
> compilation terminated.
>
> The root cause is that gcc8.3 support 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
> <arm_sve.h>, user should include it when writing ACLE SVE code.
>
> Fixes: 67b68824a82d ("lpm/arm: support SVE")
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---
> 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..bff70e4 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -480,6 +480,11 @@ if (cc.get_define('__ARM_NEON', args:
> machine_args) != '' or
> compile_time_cpuflags += ['RTE_CPUFLAG_NEON'] 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
> +
> if cc.get_define('__ARM_FEATURE_CRC32', args: machine_args) != ''
> compile_time_cpuflags += ['RTE_CPUFLAG_CRC32'] 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 <arm_sve.h>
> #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
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v2] build: fix SVE compile error with gcc8.3
2021-05-20 7:16 [dpdk-dev] [PATCH] lpm/arm: fix SVE compile error with gcc8.3 Chengwen Feng
2021-05-20 8:17 ` Ruifeng Wang
@ 2021-05-20 11:40 ` Chengwen Feng
2021-05-20 13:09 ` Bruce Richardson
2021-05-21 1:53 ` [dpdk-dev] [PATCH v3] " Chengwen Feng
2 siblings, 1 reply; 12+ messages in thread
From: Chengwen Feng @ 2021-05-20 11:40 UTC (permalink / raw)
To: thomas, ferruh.yigit, ruifeng.wang
Cc: dev, bruce.richardson, vladimir.medvedkin, viktorin, jerinj
If the target machine has SVE feature (e.g. "-march=armv8.2-a+sve'),
and the compiler is 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 <arm_sve.h>
^~~~~~~~~~~
compilation terminated.
The root cause is that gcc8.3 support 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
<arm_sve.h>, user should include it when writing ACLE SVE code.
Fixes: 67b68824a82d ("lpm/arm: support SVE")
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
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..bff70e4 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -480,6 +480,11 @@ if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
compile_time_cpuflags += ['RTE_CPUFLAG_NEON']
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
+
if cc.get_define('__ARM_FEATURE_CRC32', args: machine_args) != ''
compile_time_cpuflags += ['RTE_CPUFLAG_CRC32']
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 <arm_sve.h>
#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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH] lpm/arm: fix SVE compile error with gcc8.3
2021-05-20 8:17 ` Ruifeng Wang
@ 2021-05-20 11:45 ` fengchengwen
0 siblings, 0 replies; 12+ messages in thread
From: fengchengwen @ 2021-05-20 11:45 UTC (permalink / raw)
To: Ruifeng Wang, thomas, ferruh.yigit
Cc: dev, bruce.richardson, vladimir.medvedkin, viktorin, jerinj, nd
Fix in v2, thanks
On 2021/5/20 16:17, Ruifeng Wang wrote:
> Thanks for this patch.
> Minor comment below.
>
>> -----Original Message-----
>> From: Chengwen Feng <fengchengwen@huawei.com>
>> Sent: Thursday, May 20, 2021 3:17 PM
>> To: thomas@monjalon.net; ferruh.yigit@intel.com
>> Cc: dev@dpdk.org; bruce.richardson@intel.com;
>> vladimir.medvedkin@intel.com; viktorin@rehivetech.com; Ruifeng Wang
>> <Ruifeng.Wang@arm.com>; jerinj@marvell.com
>> Subject: [PATCH] lpm/arm: fix SVE compile error with gcc8.3
> This is build fix and not specific to lpm.
> Use 'build:' instead of 'lpm/arm:'?
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v2] build: fix SVE compile error with gcc8.3
2021-05-20 11:40 ` [dpdk-dev] [PATCH v2] build: " Chengwen Feng
@ 2021-05-20 13:09 ` Bruce Richardson
2021-05-21 1:57 ` fengchengwen
0 siblings, 1 reply; 12+ messages in thread
From: Bruce Richardson @ 2021-05-20 13:09 UTC (permalink / raw)
To: Chengwen Feng
Cc: thomas, ferruh.yigit, ruifeng.wang, dev, vladimir.medvedkin,
viktorin, jerinj
On Thu, May 20, 2021 at 07:40:12PM +0800, Chengwen Feng wrote:
> If the target machine has SVE feature (e.g. "-march=armv8.2-a+sve'),
> and the compiler is 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 <arm_sve.h>
> ^~~~~~~~~~~
> compilation terminated.
>
> The root cause is that gcc8.3 support 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
> <arm_sve.h>, user should include it when writing ACLE SVE code.
>
> Fixes: 67b68824a82d ("lpm/arm: support SVE")
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---
> v2:
> * modify title start with 'build'
>
One minor comment inline below.
/Bruce
> ---
> 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..bff70e4 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -480,6 +480,11 @@ if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> compile_time_cpuflags += ['RTE_CPUFLAG_NEON']
> endif
>
> +if (cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != '' and
> + cc.check_header('arm_sve.h'))
Please double-indent this line. It looks like part of the condition body
as-is.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v3] build: fix SVE compile error with gcc8.3
2021-05-20 7:16 [dpdk-dev] [PATCH] lpm/arm: fix SVE compile error with gcc8.3 Chengwen Feng
2021-05-20 8:17 ` Ruifeng Wang
2021-05-20 11:40 ` [dpdk-dev] [PATCH v2] build: " Chengwen Feng
@ 2021-05-21 1:53 ` Chengwen Feng
2021-05-25 6:02 ` Ruifeng Wang
2021-06-23 8:05 ` Thomas Monjalon
2 siblings, 2 replies; 12+ messages in thread
From: Chengwen Feng @ 2021-05-21 1:53 UTC (permalink / raw)
To: thomas, ferruh.yigit, ruifeng.wang
Cc: dev, bruce.richardson, vladimir.medvedkin, viktorin, jerinj
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 <arm_sve.h>
^~~~~~~~~~~
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
<arm_sve.h>, 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 <arm_sve.h>
#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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v2] build: fix SVE compile error with gcc8.3
2021-05-20 13:09 ` Bruce Richardson
@ 2021-05-21 1:57 ` fengchengwen
0 siblings, 0 replies; 12+ messages in thread
From: fengchengwen @ 2021-05-21 1:57 UTC (permalink / raw)
To: Bruce Richardson
Cc: thomas, ferruh.yigit, ruifeng.wang, dev, vladimir.medvedkin,
viktorin, jerinj
Fix in v3, also with minor changes, thanks
On 2021/5/20 21:09, Bruce Richardson wrote:
> On Thu, May 20, 2021 at 07:40:12PM +0800, Chengwen Feng wrote:
>> If the target machine has SVE feature (e.g. "-march=armv8.2-a+sve'),
>> and the compiler is 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 <arm_sve.h>
>> ^~~~~~~~~~~
>> compilation terminated.
>>
>> The root cause is that gcc8.3 support 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
>> <arm_sve.h>, user should include it when writing ACLE SVE code.
>>
>> Fixes: 67b68824a82d ("lpm/arm: support SVE")
>>
>> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
>> ---
>> v2:
>> * modify title start with 'build'
>>
>
> One minor comment inline below.
> /Bruce
>> ---
>> 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..bff70e4 100644
>> --- a/config/arm/meson.build
>> +++ b/config/arm/meson.build
>> @@ -480,6 +480,11 @@ if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
>> compile_time_cpuflags += ['RTE_CPUFLAG_NEON']
>> endif
>>
>> +if (cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != '' and
>> + cc.check_header('arm_sve.h'))
> Please double-indent this line. It looks like part of the condition body
> as-is.
>
>
> .
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v3] build: fix SVE compile error with gcc8.3
2021-05-21 1:53 ` [dpdk-dev] [PATCH v3] " Chengwen Feng
@ 2021-05-25 6:02 ` Ruifeng Wang
2021-05-27 7:12 ` Fengchengwen
2021-06-12 7:07 ` fengchengwen
2021-06-23 8:05 ` Thomas Monjalon
1 sibling, 2 replies; 12+ messages in thread
From: Ruifeng Wang @ 2021-05-25 6:02 UTC (permalink / raw)
To: Chengwen Feng, thomas, ferruh.yigit
Cc: dev, bruce.richardson, vladimir.medvedkin, viktorin, jerinj, nd
> -----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 <arm_sve.h>
> ^~~~~~~~~~~
> 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
> <arm_sve.h>, 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 <arm_sve.h>
> #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>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v3] build: fix SVE compile error with gcc8.3
2021-05-25 6:02 ` Ruifeng Wang
@ 2021-05-27 7:12 ` Fengchengwen
2021-06-12 7:07 ` fengchengwen
1 sibling, 0 replies; 12+ messages in thread
From: Fengchengwen @ 2021-05-27 7:12 UTC (permalink / raw)
To: Ruifeng Wang, Thomas Monjalon, ferruh.yigit
Cc: dev, Richardson, Bruce, vladimir.medvedkin, viktorin, Jerin Jacob, nd
Hi, Thomas
Could you review this patch? Thanks
From:Ruifeng Wang <Ruifeng.Wang@arm.com>
To:Fengchengwen <fengchengwen@huawei.com>;Thomas Monjalon <thomas@monjalon.net>;ferruh.yigit <ferruh.yigit@intel.com>
Cc:dev <dev@dpdk.org>;Richardson, Bruce <bruce.richardson@intel.com>;vladimir.medvedkin <vladimir.medvedkin@intel.com>;viktorin <viktorin@rehivetech.com>;Jerin Jacob <jerinj@marvell.com>;nd <nd@arm.com>
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<mailto:fengchengwen@huawei.com>>
> Sent: Friday, May 21, 2021 9:53 AM
> To: thomas@monjalon.net<mailto:thomas@monjalon.net>; ferruh.yigit@intel.com<mailto:ferruh.yigit@intel.com>; Ruifeng Wang
> < Ruifeng.Wang@arm.com<mailto:Ruifeng.Wang@arm.com>>
> Cc: dev@dpdk.org<mailto:dev@dpdk.org>; bruce.richardson@intel.com<mailto:bruce.richardson@intel.com>;
> vladimir.medvedkin@intel.com<mailto:vladimir.medvedkin@intel.com>; viktorin@rehivetech.com<mailto:viktorin@rehivetech.com>;
> jerinj@marvell.com<mailto: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 <arm_sve.h>
> ^~~~~~~~~~~
> 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
> <arm_sve.h>, user should include it when writing ACLE SVE code.
>
> Fixes: 67b68824a82d ("lpm/arm: support SVE")
>
> Signed-off-by: Chengwen Feng < fengchengwen@huawei.com<mailto: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 <arm_sve.h>
> #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<mailto:ruifeng.wang@arm.com>>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v3] build: fix SVE compile error with gcc8.3
2021-05-25 6:02 ` Ruifeng Wang
2021-05-27 7:12 ` Fengchengwen
@ 2021-06-12 7:07 ` fengchengwen
2021-06-21 0:56 ` fengchengwen
1 sibling, 1 reply; 12+ messages in thread
From: fengchengwen @ 2021-06-12 7:07 UTC (permalink / raw)
To: Ruifeng Wang, Thomas Monjalon, ferruh.yigit
Cc: dev, Richardson, Bruce, vladimir.medvedkin, viktorin, Jerin Jacob, nd
Friendly ping
On 2021/5/27 15:12, Fengchengwen wrote:
> Hi, Thomas
>
> Could you review this patch? Thanks
>
>
> From:Ruifeng Wang <Ruifeng.Wang@arm.com>
> To:Fengchengwen <fengchengwen@huawei.com>;Thomas Monjalon <thomas@monjalon.net>;ferruh.yigit <ferruh.yigit@intel.com>
> Cc:dev <dev@dpdk.org>;Richardson, Bruce <bruce.richardson@intel.com>;vladimir.medvedkin <vladimir.medvedkin@intel.com>;viktorin <viktorin@rehivetech.com>;Jerin Jacob <jerinj@marvell.com>;nd <nd@arm.com>
> 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<mailto:fengchengwen@huawei.com>>
>> Sent: Friday, May 21, 2021 9:53 AM
>> To: thomas@monjalon.net<mailto:thomas@monjalon.net>; ferruh.yigit@intel.com<mailto:ferruh.yigit@intel.com>; Ruifeng Wang
>> < Ruifeng.Wang@arm.com<mailto:Ruifeng.Wang@arm.com>>
>> Cc: dev@dpdk.org<mailto:dev@dpdk.org>; bruce.richardson@intel.com<mailto:bruce.richardson@intel.com>;
>> vladimir.medvedkin@intel.com<mailto:vladimir.medvedkin@intel.com>; viktorin@rehivetech.com<mailto:viktorin@rehivetech.com>;
>> jerinj@marvell.com<mailto: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 <arm_sve.h>
>> ^~~~~~~~~~~
>> 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
>> <arm_sve.h>, user should include it when writing ACLE SVE code.
>>
>> Fixes: 67b68824a82d ("lpm/arm: support SVE")
>>
>> Signed-off-by: Chengwen Feng < fengchengwen@huawei.com<mailto: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 <arm_sve.h>
>> #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<mailto:ruifeng.wang@arm.com>>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v3] build: fix SVE compile error with gcc8.3
2021-06-12 7:07 ` fengchengwen
@ 2021-06-21 0:56 ` fengchengwen
0 siblings, 0 replies; 12+ messages in thread
From: fengchengwen @ 2021-06-21 0:56 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Ruifeng Wang, ferruh.yigit, dev, Richardson, Bruce,
vladimir.medvedkin, viktorin, Jerin Jacob, nd
Hi, Thomas
This patch already reviewed by ARM guys.
Please review it, thanks
On 2021/6/12 15:07, fengchengwen wrote:
> Friendly ping
>
>
> On 2021/5/27 15:12, Fengchengwen wrote:
>> Hi, Thomas
>>
>> Could you review this patch? Thanks
>>
>>
>> From:Ruifeng Wang <Ruifeng.Wang@arm.com>
>> To:Fengchengwen <fengchengwen@huawei.com>;Thomas Monjalon <thomas@monjalon.net>;ferruh.yigit <ferruh.yigit@intel.com>
>> Cc:dev <dev@dpdk.org>;Richardson, Bruce <bruce.richardson@intel.com>;vladimir.medvedkin <vladimir.medvedkin@intel.com>;viktorin <viktorin@rehivetech.com>;Jerin Jacob <jerinj@marvell.com>;nd <nd@arm.com>
>> 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<mailto:fengchengwen@huawei.com>>
>>> Sent: Friday, May 21, 2021 9:53 AM
>>> To: thomas@monjalon.net<mailto:thomas@monjalon.net>; ferruh.yigit@intel.com<mailto:ferruh.yigit@intel.com>; Ruifeng Wang
>>> < Ruifeng.Wang@arm.com<mailto:Ruifeng.Wang@arm.com>>
>>> Cc: dev@dpdk.org<mailto:dev@dpdk.org>; bruce.richardson@intel.com<mailto:bruce.richardson@intel.com>;
>>> vladimir.medvedkin@intel.com<mailto:vladimir.medvedkin@intel.com>; viktorin@rehivetech.com<mailto:viktorin@rehivetech.com>;
>>> jerinj@marvell.com<mailto: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 <arm_sve.h>
>>> ^~~~~~~~~~~
>>> 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
>>> <arm_sve.h>, user should include it when writing ACLE SVE code.
>>>
>>> Fixes: 67b68824a82d ("lpm/arm: support SVE")
>>>
>>> Signed-off-by: Chengwen Feng < fengchengwen@huawei.com<mailto: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 <arm_sve.h>
>>> #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<mailto:ruifeng.wang@arm.com>>
>>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v3] build: fix SVE compile error with gcc8.3
2021-05-21 1:53 ` [dpdk-dev] [PATCH v3] " Chengwen Feng
2021-05-25 6:02 ` Ruifeng Wang
@ 2021-06-23 8:05 ` Thomas Monjalon
1 sibling, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2021-06-23 8:05 UTC (permalink / raw)
To: Chengwen Feng
Cc: ferruh.yigit, ruifeng.wang, dev, bruce.richardson,
vladimir.medvedkin, viktorin, jerinj
21/05/2021 03:53, Chengwen Feng:
> 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 <arm_sve.h>
> ^~~~~~~~~~~
> 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
> <arm_sve.h>, user should include it when writing ACLE SVE code.
>
> Fixes: 67b68824a82d ("lpm/arm: support SVE")
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> +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)
Any defined flag should start with RTE_.
I suggest RTE_HAS_SVE_ACLE.
Please add a comment before defining this flag to explain what it is.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2021-06-23 8:05 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 7:16 [dpdk-dev] [PATCH] lpm/arm: fix SVE compile error with gcc8.3 Chengwen Feng
2021-05-20 8:17 ` Ruifeng Wang
2021-05-20 11:45 ` fengchengwen
2021-05-20 11:40 ` [dpdk-dev] [PATCH v2] build: " Chengwen Feng
2021-05-20 13:09 ` Bruce Richardson
2021-05-21 1:57 ` fengchengwen
2021-05-21 1:53 ` [dpdk-dev] [PATCH v3] " Chengwen Feng
2021-05-25 6:02 ` Ruifeng Wang
2021-05-27 7:12 ` Fengchengwen
2021-06-12 7:07 ` fengchengwen
2021-06-21 0:56 ` fengchengwen
2021-06-23 8:05 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).