DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC PATCH v1] config/arm: fix native machine args
@ 2021-02-01 14:55 Juraj Linkeš
  2021-02-01 15:16 ` Thomas Monjalon
  2021-02-02  9:05 ` [dpdk-dev] [RFC PATCH v2] config/arm: replace " Juraj Linkeš
  0 siblings, 2 replies; 5+ messages in thread
From: Juraj Linkeš @ 2021-02-01 14:55 UTC (permalink / raw)
  To: bruce.richardson, thomas, Ruifeng.Wang, Honnappa.Nagarahalli,
	jerinjacobk, ferruh.yigit
  Cc: dev, Juraj Linkeš

There are compiler issues when building with -mcpu=native with popular
compilers, such as GCC-8.4 and clang (which doesn't define
__ARM_FEATURE_ATOMIC). Fix this by always specifying the proper machine
args and never using the native flags.

Fixes: 78ac8eac7e8a ("config/arm: use native machine build arguments")
Cc: juraj.linkes@pantheon.tech

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index f207e5a288..f948768578 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -24,7 +24,6 @@ flags_common = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
-native_machine_args = ['-mcpu=native']
 
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
@@ -193,7 +192,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	use_native_machine_args = false
 	if not meson.is_cross_build()
 		if machine == 'default'
 			# default build
@@ -213,7 +211,6 @@ else
 			else
 				error('Error when getting Arm Implementer ID and part number.')
 			endif
-			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -249,12 +246,7 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	if use_native_machine_args
-		candidate_machine_args = native_machine_args
-	else
-		candidate_machine_args = part_number_config['machine_args']
-	endif
-	foreach flag: candidate_machine_args
+	foreach flag: part_number_config['machine_args']
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [RFC PATCH v1] config/arm: fix native machine args
  2021-02-01 14:55 [dpdk-dev] [RFC PATCH v1] config/arm: fix native machine args Juraj Linkeš
@ 2021-02-01 15:16 ` Thomas Monjalon
  2021-02-02  7:40   ` Juraj Linkeš
  2021-02-02  9:05 ` [dpdk-dev] [RFC PATCH v2] config/arm: replace " Juraj Linkeš
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2021-02-01 15:16 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli,
	jerinjacobk, ferruh.yigit, dev

01/02/2021 15:55, Juraj Linkeš:
> There are compiler issues when building with -mcpu=native with popular
> compilers, such as GCC-8.4 and clang (which doesn't define
> __ARM_FEATURE_ATOMIC).

What are the issues? Maybe worth pasting a log.

> Fix this by always specifying the proper machine
> args and never using the native flags.

The title says "fix" but it seems to be "remove".

[...]
> -native_machine_args = ['-mcpu=native']

This is the culprit?
Could you provide a "Fixes:" line?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [RFC PATCH v1] config/arm: fix native machine args
  2021-02-01 15:16 ` Thomas Monjalon
@ 2021-02-02  7:40   ` Juraj Linkeš
  0 siblings, 0 replies; 5+ messages in thread
From: Juraj Linkeš @ 2021-02-02  7:40 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli,
	jerinjacobk, ferruh.yigit, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, February 1, 2021 4:16 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; jerinjacobk@gmail.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [RFC PATCH v1] config/arm: fix native machine args
> 
> 01/02/2021 15:55, Juraj Linkeš:
> > There are compiler issues when building with -mcpu=native with popular
> > compilers, such as GCC-8.4 and clang (which doesn't define
> > __ARM_FEATURE_ATOMIC).
> 
> What are the issues? Maybe worth pasting a log.
> 

I can include this in the commit log from GCC-8.4 (the same thing works with GCC-10.2):
In file included from ../lib/librte_eal/arm/include/rte_vect.h:11,
                 from ../lib/librte_net/net_crc_neon.c:10:
../lib/librte_net/net_crc_neon.c: In function ‘crcr32_folding_round’:
/usr/lib/gcc/aarch64-linux-gnu/8/include/arm_neon.h:26094:1: error: inlining failed in call to always_inline ‘vmull_p64’: target specific option mismatch
 vmull_p64 (poly64_t a, poly64_t b)
 ^~~~~~~~~
../lib/librte_net/net_crc_neon.c:50:20: note: called from here
  uint64x2_t tmp1 = vreinterpretq_u64_p128(vmull_p64(
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    vgetq_lane_p64(vreinterpretq_p64_u64(fold), 0),
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    vgetq_lane_p64(vreinterpretq_p64_u64(precomp), 1)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And for clang:
gcc -E -dM -mcpu="native" - < /dev/null | grep __ARM_FEATURE_ATOMICS
#define __ARM_FEATURE_ATOMICS 1 # gcc support
clang-9 -E -dM -mcpu="native" - < /dev/null | grep __ARM_FEATURE_ATOMICS
<no output> # clang no support

> > Fix this by always specifying the proper machine args and never using
> > the native flags.
> 
> The title says "fix" but it seems to be "remove".

Yes. The fix is to remove the usage of native flags and instead always use the part_number flags.

> 
> [...]
> > -native_machine_args = ['-mcpu=native']
> 
> This is the culprit?
> Could you provide a "Fixes:" line?

There already is one:
Fixes: 78ac8eac7e8a ("config/arm: use native machine build arguments")

> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [RFC PATCH v2] config/arm: replace native machine args
  2021-02-01 14:55 [dpdk-dev] [RFC PATCH v1] config/arm: fix native machine args Juraj Linkeš
  2021-02-01 15:16 ` Thomas Monjalon
@ 2021-02-02  9:05 ` Juraj Linkeš
  2021-02-02  9:25   ` Thomas Monjalon
  1 sibling, 1 reply; 5+ messages in thread
From: Juraj Linkeš @ 2021-02-02  9:05 UTC (permalink / raw)
  To: bruce.richardson, thomas, Ruifeng.Wang, Honnappa.Nagarahalli,
	jerinjacobk, ferruh.yigit
  Cc: dev, Juraj Linkeš

There are compiler issues when building with -mcpu=native with popular
compilers, such as GCC-8.4:
In file included from ../lib/librte_eal/arm/include/rte_vect.h:11,
                 from ../lib/librte_net/net_crc_neon.c:10:
../lib/librte_net/net_crc_neon.c: In function ‘crcr32_folding_round’:
/usr/lib/gcc/aarch64-linux-gnu/8/include/arm_neon.h:26094:1: error:
inlining failed in call to always_inline ‘vmull_p64’: target
specific option mismatch
 vmull_p64 (poly64_t a, poly64_t b)
 ^~~~~~~~~
../lib/librte_net/net_crc_neon.c:50:20: note: called from here
  uint64x2_t tmp1 = vreinterpretq_u64_p128(vmull_p64(
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    vgetq_lane_p64(vreinterpretq_p64_u64(fold), 0),
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    vgetq_lane_p64(vreinterpretq_p64_u64(precomp), 1)));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

and clang:
gcc -E -dM -mcpu="native" - < /dev/null | grep __ARM_FEATURE_ATOMICS
clang-9 -E -dM -mcpu="native" - < /dev/null | grep __ARM_FEATURE_ATOMICS
<no output> # no clang support

Fix this by always specifying the proper machine args and never using
the native flags.

Fixes: 78ac8eac7e8a ("config/arm: use native machine build arguments")
Cc: juraj.linkes@pantheon.tech

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index f207e5a288..f948768578 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -24,7 +24,6 @@ flags_common = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
-native_machine_args = ['-mcpu=native']
 
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
@@ -193,7 +192,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	use_native_machine_args = false
 	if not meson.is_cross_build()
 		if machine == 'default'
 			# default build
@@ -213,7 +211,6 @@ else
 			else
 				error('Error when getting Arm Implementer ID and part number.')
 			endif
-			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -249,12 +246,7 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	if use_native_machine_args
-		candidate_machine_args = native_machine_args
-	else
-		candidate_machine_args = part_number_config['machine_args']
-	endif
-	foreach flag: candidate_machine_args
+	foreach flag: part_number_config['machine_args']
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [RFC PATCH v2] config/arm: replace native machine args
  2021-02-02  9:05 ` [dpdk-dev] [RFC PATCH v2] config/arm: replace " Juraj Linkeš
@ 2021-02-02  9:25   ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2021-02-02  9:25 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli,
	jerinjacobk, ferruh.yigit, dev

02/02/2021 10:05, Juraj Linkeš:
> There are compiler issues when building with -mcpu=native with popular
> compilers, such as GCC-8.4:
> In file included from ../lib/librte_eal/arm/include/rte_vect.h:11,
>                  from ../lib/librte_net/net_crc_neon.c:10:
> ../lib/librte_net/net_crc_neon.c: In function ‘crcr32_folding_round’:
> /usr/lib/gcc/aarch64-linux-gnu/8/include/arm_neon.h:26094:1: error:
> inlining failed in call to always_inline ‘vmull_p64’: target
> specific option mismatch
>  vmull_p64 (poly64_t a, poly64_t b)
>  ^~~~~~~~~
> ../lib/librte_net/net_crc_neon.c:50:20: note: called from here
>   uint64x2_t tmp1 = vreinterpretq_u64_p128(vmull_p64(
>                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     vgetq_lane_p64(vreinterpretq_p64_u64(fold), 0),
>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     vgetq_lane_p64(vreinterpretq_p64_u64(precomp), 1)));
>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> and clang:
> gcc -E -dM -mcpu="native" - < /dev/null | grep __ARM_FEATURE_ATOMICS
> clang-9 -E -dM -mcpu="native" - < /dev/null | grep __ARM_FEATURE_ATOMICS
> <no output> # no clang support
> 
> Fix this by always specifying the proper machine args and never using
> the native flags.
> 
> Fixes: 78ac8eac7e8a ("config/arm: use native machine build arguments")
> Cc: juraj.linkes@pantheon.tech
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>

Applied, thanks



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-02  9:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 14:55 [dpdk-dev] [RFC PATCH v1] config/arm: fix native machine args Juraj Linkeš
2021-02-01 15:16 ` Thomas Monjalon
2021-02-02  7:40   ` Juraj Linkeš
2021-02-02  9:05 ` [dpdk-dev] [RFC PATCH v2] config/arm: replace " Juraj Linkeš
2021-02-02  9:25   ` 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).