DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] eal: fix clang compilation error on ARM64
@ 2018-04-06 11:01 Pavan Nikhilesh
  2018-04-06 16:24 ` Thomas Monjalon
  2018-04-11 17:01 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh
  0 siblings, 2 replies; 11+ messages in thread
From: Pavan Nikhilesh @ 2018-04-06 11:01 UTC (permalink / raw)
  To: jerin.jacob, ferruh.yigit, stephen, konstantin.ananyev, thomas
  Cc: dev, Pavan Nikhilesh

Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).

Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 lib/librte_eal/common/include/generic/rte_atomic.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/common/include/generic/rte_atomic.h b/lib/librte_eal/common/include/generic/rte_atomic.h
index 8652c0264..91a6d615a 100644
--- a/lib/librte_eal/common/include/generic/rte_atomic.h
+++ b/lib/librte_eal/common/include/generic/rte_atomic.h
@@ -12,7 +12,9 @@
  * This file defines a generic API for atomic operations.
  */
 
+#include <stdatomic.h>
 #include <stdint.h>
+
 #include <rte_common.h>
 
 #ifdef __DOXYGEN__
@@ -212,7 +214,7 @@ rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val);
 static inline uint16_t
 rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val)
 {
-	return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST);
+	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
 }
 #endif
 
@@ -491,7 +493,7 @@ rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val);
 static inline uint32_t
 rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val)
 {
-	return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
+	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
 }
 #endif
 
@@ -769,7 +771,7 @@ rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val);
 static inline uint64_t
 rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val)
 {
-	return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
+	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
 }
 #endif
 
-- 
2.17.0

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

* Re: [dpdk-dev] [PATCH] eal: fix clang compilation error on ARM64
  2018-04-06 11:01 [dpdk-dev] [PATCH] eal: fix clang compilation error on ARM64 Pavan Nikhilesh
@ 2018-04-06 16:24 ` Thomas Monjalon
  2018-04-06 18:25   ` Pavan Nikhilesh
  2018-04-11 17:01 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2018-04-06 16:24 UTC (permalink / raw)
  To: Pavan Nikhilesh
  Cc: dev, jerin.jacob, ferruh.yigit, stephen, konstantin.ananyev

06/04/2018 13:01, Pavan Nikhilesh:
> Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).
> 
> Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")

Please, could you provide a log of the error?

Why __atomic_exchange_n is fixing the compilation?

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

* Re: [dpdk-dev] [PATCH] eal: fix clang compilation error on ARM64
  2018-04-06 16:24 ` Thomas Monjalon
@ 2018-04-06 18:25   ` Pavan Nikhilesh
  2018-04-10 15:07     ` Thomas Monjalon
  0 siblings, 1 reply; 11+ messages in thread
From: Pavan Nikhilesh @ 2018-04-06 18:25 UTC (permalink / raw)
  To: Thomas Monjalon, jerin.jacob, ferruh.yigit, stephen, konstantin.ananyev
  Cc: dev

On Fri, Apr 06, 2018 at 06:24:34PM +0200, Thomas Monjalon wrote:
> 06/04/2018 13:01, Pavan Nikhilesh:
> > Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).
> >
> > Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
>
> Please, could you provide a log of the error?

  CC eal.o
In file included from /root/dpdk/lib/librte_eal/linuxapp/eal/eal.c:33:
In file included from /root/dpdk/build/include/rte_eal_memconfig.h:13:
In file included from /root/dpdk/build/include/rte_rwlock.h:10:
In file included from /root/dpdk/build/include/generic/rte_rwlock.h:25:
In file included from /root/dpdk/build/include/rte_atomic.h:37:
In file included from /root/dpdk/build/include/rte_atomic_64.h:16:
/root/dpdk/build/include/generic/rte_atomic.h:215:9: error: implicit declaration of function '__atomic_exchange_2' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST);
               ^
/root/dpdk/build/include/generic/rte_atomic.h:215:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
/root/dpdk/build/include/generic/rte_atomic.h:494:9: error: implicit declaration of function '__atomic_exchange_4' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
               ^
/root/dpdk/build/include/generic/rte_atomic.h:494:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
/root/dpdk/build/include/generic/rte_atomic.h:772:9: error: implicit declaration of function '__atomic_exchange_8' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
               ^
/root/dpdk/build/include/generic/rte_atomic.h:772:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
6 errors generated.
make[5]: *** [/root/dpdk/mk/internal/rte.compile-pre.mk:116: eal.o] Error 1


>
> Why __atomic_exchange_n is fixing the compilation?

I guess __atomic_exchange_2/5/8 fall under c++11 standard?
https://llvm.org/docs/Atomics.html
>
>
>

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

* Re: [dpdk-dev] [PATCH] eal: fix clang compilation error on ARM64
  2018-04-06 18:25   ` Pavan Nikhilesh
@ 2018-04-10 15:07     ` Thomas Monjalon
  2018-04-10 21:35       ` Thomas Monjalon
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2018-04-10 15:07 UTC (permalink / raw)
  To: Pavan Nikhilesh
  Cc: dev, jerin.jacob, ferruh.yigit, stephen, konstantin.ananyev

06/04/2018 20:25, Pavan Nikhilesh:
> On Fri, Apr 06, 2018 at 06:24:34PM +0200, Thomas Monjalon wrote:
> > 06/04/2018 13:01, Pavan Nikhilesh:
> > > Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).
> > >
> > > Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
> >
> > Please, could you provide a log of the error?
> 
>   CC eal.o
> In file included from /root/dpdk/lib/librte_eal/linuxapp/eal/eal.c:33:
> In file included from /root/dpdk/build/include/rte_eal_memconfig.h:13:
> In file included from /root/dpdk/build/include/rte_rwlock.h:10:
> In file included from /root/dpdk/build/include/generic/rte_rwlock.h:25:
> In file included from /root/dpdk/build/include/rte_atomic.h:37:
> In file included from /root/dpdk/build/include/rte_atomic_64.h:16:
> /root/dpdk/build/include/generic/rte_atomic.h:215:9: error: implicit declaration of function '__atomic_exchange_2' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>         return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST);
>                ^
> /root/dpdk/build/include/generic/rte_atomic.h:215:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
> /root/dpdk/build/include/generic/rte_atomic.h:494:9: error: implicit declaration of function '__atomic_exchange_4' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>         return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
>                ^
> /root/dpdk/build/include/generic/rte_atomic.h:494:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
> /root/dpdk/build/include/generic/rte_atomic.h:772:9: error: implicit declaration of function '__atomic_exchange_8' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>         return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
>                ^
> /root/dpdk/build/include/generic/rte_atomic.h:772:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
> 6 errors generated.
> make[5]: *** [/root/dpdk/mk/internal/rte.compile-pre.mk:116: eal.o] Error 1
> 
> 
> >
> > Why __atomic_exchange_n is fixing the compilation?
> 
> I guess __atomic_exchange_2/5/8 fall under c++11 standard?
> https://llvm.org/docs/Atomics.html

Applied (with error log), thanks

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

* Re: [dpdk-dev] [PATCH] eal: fix clang compilation error on ARM64
  2018-04-10 15:07     ` Thomas Monjalon
@ 2018-04-10 21:35       ` Thomas Monjalon
  2018-04-11  8:38         ` Pavan Nikhilesh
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2018-04-10 21:35 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dev, techboard

Hi, big issue here.
This patch does not compile on Linux with ICC or GCC < 4.9
because of a missing C11 header:
	#include <stdatomic.h>

GCC 4.9 is recommended in doc/guides/linux_gsg/sys_reqs.rst.
But GCC 4.8 is used by SLES 12, RHEL 7, etc...

Note: Intel compilation tests are running with a backlog of one week,
so cannot catch such fail.

Exceptionnaly, I have decided to remove this patch pushed few hours ago
(not reverting), in order to avoid a serious "git bisect" breakage
in the middle of the git history.

We'll need to find a better way of fixing the compilation error
seen on ARM with clang.
To make it clear: I believe it is more important to preserve GCC 4.8
than clang compilation.
By the way, what is the version of clang which was causing the error?

The error was:
	include/generic/rte_atomic.h:215:9: error:
		implicit declaration of function '__atomic_exchange_2'
		is invalid in C99
	include/generic/rte_atomic.h:494:9: error:
		implicit declaration of function '__atomic_exchange_4'
		is invalid in C99
	include/generic/rte_atomic.h:772:9: error:
		implicit declaration of function '__atomic_exchange_8'
		is invalid in C99

The proposed solution was:
	Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8),
	and include stdatomic.h.



10/04/2018 17:07, Thomas Monjalon:
> 06/04/2018 20:25, Pavan Nikhilesh:
> > On Fri, Apr 06, 2018 at 06:24:34PM +0200, Thomas Monjalon wrote:
> > > 06/04/2018 13:01, Pavan Nikhilesh:
> > > > Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).
> > > >
> > > > Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
[...]
> Applied (with error log), thanks

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

* Re: [dpdk-dev] [PATCH] eal: fix clang compilation error on ARM64
  2018-04-10 21:35       ` Thomas Monjalon
@ 2018-04-11  8:38         ` Pavan Nikhilesh
  2018-04-11  8:46           ` Thomas Monjalon
  0 siblings, 1 reply; 11+ messages in thread
From: Pavan Nikhilesh @ 2018-04-11  8:38 UTC (permalink / raw)
  To: Thomas Monjalon, techboard; +Cc: dev

On Tue, Apr 10, 2018 at 11:35:15PM +0200, Thomas Monjalon wrote:
> Hi, big issue here.
> This patch does not compile on Linux with ICC or GCC < 4.9
> because of a missing C11 header:
> 	#include <stdatomic.h>
>
> GCC 4.9 is recommended in doc/guides/linux_gsg/sys_reqs.rst.
> But GCC 4.8 is used by SLES 12, RHEL 7, etc...
>
> Note: Intel compilation tests are running with a backlog of one week,
> so cannot catch such fail.
>
> Exceptionnaly, I have decided to remove this patch pushed few hours ago
> (not reverting), in order to avoid a serious "git bisect" breakage
> in the middle of the git history.
>
> We'll need to find a better way of fixing the compilation error
> seen on ARM with clang.
> To make it clear: I believe it is more important to preserve GCC 4.8
> than clang compilation.
> By the way, what is the version of clang which was causing the error?

I have tried with clang 4/5/6 and all have the same issue.

>
> The error was:
> 	include/generic/rte_atomic.h:215:9: error:
> 		implicit declaration of function '__atomic_exchange_2'
> 		is invalid in C99
> 	include/generic/rte_atomic.h:494:9: error:
> 		implicit declaration of function '__atomic_exchange_4'
> 		is invalid in C99
> 	include/generic/rte_atomic.h:772:9: error:
> 		implicit declaration of function '__atomic_exchange_8'
> 		is invalid in C99
>
> The proposed solution was:
> 	Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8),
> 	and include stdatomic.h.
>
>
>
> 10/04/2018 17:07, Thomas Monjalon:
> > 06/04/2018 20:25, Pavan Nikhilesh:
> > > On Fri, Apr 06, 2018 at 06:24:34PM +0200, Thomas Monjalon wrote:
> > > > 06/04/2018 13:01, Pavan Nikhilesh:
> > > > > Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).
> > > > >
> > > > > Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
> [...]
> > Applied (with error log), thanks
>
>
>

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

* Re: [dpdk-dev] [PATCH] eal: fix clang compilation error on ARM64
  2018-04-11  8:38         ` Pavan Nikhilesh
@ 2018-04-11  8:46           ` Thomas Monjalon
  2018-04-11  9:00             ` Pavan Nikhilesh
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2018-04-11  8:46 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: techboard, dev

11/04/2018 10:38, Pavan Nikhilesh:
> On Tue, Apr 10, 2018 at 11:35:15PM +0200, Thomas Monjalon wrote:
> > Hi, big issue here.
> > This patch does not compile on Linux with ICC or GCC < 4.9
> > because of a missing C11 header:
> > 	#include <stdatomic.h>
> >
> > GCC 4.9 is recommended in doc/guides/linux_gsg/sys_reqs.rst.
> > But GCC 4.8 is used by SLES 12, RHEL 7, etc...
> >
> > Note: Intel compilation tests are running with a backlog of one week,
> > so cannot catch such fail.
> >
> > Exceptionnaly, I have decided to remove this patch pushed few hours ago
> > (not reverting), in order to avoid a serious "git bisect" breakage
> > in the middle of the git history.
> >
> > We'll need to find a better way of fixing the compilation error
> > seen on ARM with clang.
> > To make it clear: I believe it is more important to preserve GCC 4.8
> > than clang compilation.
> > By the way, what is the version of clang which was causing the error?
> 
> I have tried with clang 4/5/6 and all have the same issue.

Do you know why the issue is not seen on x86?


> > The error was:
> > 	include/generic/rte_atomic.h:215:9: error:
> > 		implicit declaration of function '__atomic_exchange_2'
> > 		is invalid in C99
> > 	include/generic/rte_atomic.h:494:9: error:
> > 		implicit declaration of function '__atomic_exchange_4'
> > 		is invalid in C99
> > 	include/generic/rte_atomic.h:772:9: error:
> > 		implicit declaration of function '__atomic_exchange_8'
> > 		is invalid in C99
> >
> > The proposed solution was:
> > 	Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8),
> > 	and include stdatomic.h.
> >
> >
> >
> > 10/04/2018 17:07, Thomas Monjalon:
> > > 06/04/2018 20:25, Pavan Nikhilesh:
> > > > On Fri, Apr 06, 2018 at 06:24:34PM +0200, Thomas Monjalon wrote:
> > > > > 06/04/2018 13:01, Pavan Nikhilesh:
> > > > > > Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).
> > > > > >
> > > > > > Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
> > [...]
> > > Applied (with error log), thanks

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

* Re: [dpdk-dev] [PATCH] eal: fix clang compilation error on ARM64
  2018-04-11  8:46           ` Thomas Monjalon
@ 2018-04-11  9:00             ` Pavan Nikhilesh
  0 siblings, 0 replies; 11+ messages in thread
From: Pavan Nikhilesh @ 2018-04-11  9:00 UTC (permalink / raw)
  To: Thomas Monjalon, techboard; +Cc: dev

On Wed, Apr 11, 2018 at 10:46:47AM +0200, Thomas Monjalon wrote:
> 11/04/2018 10:38, Pavan Nikhilesh:
> > On Tue, Apr 10, 2018 at 11:35:15PM +0200, Thomas Monjalon wrote:
> > > Hi, big issue here.
> > > This patch does not compile on Linux with ICC or GCC < 4.9
> > > because of a missing C11 header:
> > > 	#include <stdatomic.h>
> > >
> > > GCC 4.9 is recommended in doc/guides/linux_gsg/sys_reqs.rst.
> > > But GCC 4.8 is used by SLES 12, RHEL 7, etc...
> > >
> > > Note: Intel compilation tests are running with a backlog of one week,
> > > so cannot catch such fail.
> > >
> > > Exceptionnaly, I have decided to remove this patch pushed few hours ago
> > > (not reverting), in order to avoid a serious "git bisect" breakage
> > > in the middle of the git history.
> > >
> > > We'll need to find a better way of fixing the compilation error
> > > seen on ARM with clang.
> > > To make it clear: I believe it is more important to preserve GCC 4.8
> > > than clang compilation.
> > > By the way, what is the version of clang which was causing the error?
> >
> > I have tried with clang 4/5/6 and all have the same issue.
>
> Do you know why the issue is not seen on x86?

Nope but I tried including the header as well as using -std=c11 in cflags but
still observing the same issue with clang.

>
>
> > > The error was:
> > > 	include/generic/rte_atomic.h:215:9: error:
> > > 		implicit declaration of function '__atomic_exchange_2'
> > > 		is invalid in C99
> > > 	include/generic/rte_atomic.h:494:9: error:
> > > 		implicit declaration of function '__atomic_exchange_4'
> > > 		is invalid in C99
> > > 	include/generic/rte_atomic.h:772:9: error:
> > > 		implicit declaration of function '__atomic_exchange_8'
> > > 		is invalid in C99
> > >
> > > The proposed solution was:
> > > 	Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8),
> > > 	and include stdatomic.h.
> > >
> > >
> > >
> > > 10/04/2018 17:07, Thomas Monjalon:
> > > > 06/04/2018 20:25, Pavan Nikhilesh:
> > > > > On Fri, Apr 06, 2018 at 06:24:34PM +0200, Thomas Monjalon wrote:
> > > > > > 06/04/2018 13:01, Pavan Nikhilesh:
> > > > > > > Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).
> > > > > > >
> > > > > > > Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
> > > [...]
> > > > Applied (with error log), thanks
>
>
>

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

* [dpdk-dev]  [PATCH v2] eal: fix clang compilation error on ARM64
  2018-04-06 11:01 [dpdk-dev] [PATCH] eal: fix clang compilation error on ARM64 Pavan Nikhilesh
  2018-04-06 16:24 ` Thomas Monjalon
@ 2018-04-11 17:01 ` Pavan Nikhilesh
  2018-04-11 20:42   ` Thomas Monjalon
  1 sibling, 1 reply; 11+ messages in thread
From: Pavan Nikhilesh @ 2018-04-11 17:01 UTC (permalink / raw)
  To: jerin.jacob, ferruh.yigit, stephen, konstantin.ananyev, thomas
  Cc: dev, Pavan Nikhilesh

Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).
The error was:
	include/generic/rte_atomic.h:215:9: error:
		implicit declaration of function '__atomic_exchange_2'
		is invalid in C99
	include/generic/rte_atomic.h:494:9: error:
		implicit declaration of function '__atomic_exchange_4'
		is invalid in C99
	include/generic/rte_atomic.h:772:9: error:
		implicit declaration of function '__atomic_exchange_8'
		is invalid in C99

Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 lib/librte_eal/common/include/generic/rte_atomic.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/librte_eal/common/include/generic/rte_atomic.h b/lib/librte_eal/common/include/generic/rte_atomic.h
index 8652c0264..b99ba4688 100644
--- a/lib/librte_eal/common/include/generic/rte_atomic.h
+++ b/lib/librte_eal/common/include/generic/rte_atomic.h
@@ -212,7 +212,11 @@ rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val);
 static inline uint16_t
 rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val)
 {
+#if defined(RTE_ARCH_ARM64) && defined(RTE_TOOLCHAIN_CLANG)
+	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
+#else
 	return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST);
+#endif
 }
 #endif
 
@@ -491,7 +495,11 @@ rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val);
 static inline uint32_t
 rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val)
 {
+#if defined(RTE_ARCH_ARM64) && defined(RTE_TOOLCHAIN_CLANG)
+	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
+#else
 	return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
+#endif
 }
 #endif
 
@@ -769,7 +777,11 @@ rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val);
 static inline uint64_t
 rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val)
 {
+#if defined(RTE_ARCH_ARM64) && defined(RTE_TOOLCHAIN_CLANG)
+	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
+#else
 	return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
+#endif
 }
 #endif
 
-- 
2.17.0

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

* Re: [dpdk-dev] [PATCH v2] eal: fix clang compilation error on ARM64
  2018-04-11 17:01 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh
@ 2018-04-11 20:42   ` Thomas Monjalon
  2018-04-11 21:48     ` Stephen Hemminger
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2018-04-11 20:42 UTC (permalink / raw)
  To: Pavan Nikhilesh
  Cc: dev, jerin.jacob, ferruh.yigit, stephen, konstantin.ananyev

11/04/2018 19:01, Pavan Nikhilesh:
> Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).
> The error was:
> 	include/generic/rte_atomic.h:215:9: error:
> 		implicit declaration of function '__atomic_exchange_2'
> 		is invalid in C99
> 	include/generic/rte_atomic.h:494:9: error:
> 		implicit declaration of function '__atomic_exchange_4'
> 		is invalid in C99
> 	include/generic/rte_atomic.h:772:9: error:
> 		implicit declaration of function '__atomic_exchange_8'
> 		is invalid in C99
> 
> Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

We did not understand why this error is seen only on ARM
(hopefully we won't discover it somewhere else),
but it is a pragmatic fix.

Applied, thanks

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

* Re: [dpdk-dev] [PATCH v2] eal: fix clang compilation error on ARM64
  2018-04-11 20:42   ` Thomas Monjalon
@ 2018-04-11 21:48     ` Stephen Hemminger
  0 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2018-04-11 21:48 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Pavan Nikhilesh, dev, jerin.jacob, ferruh.yigit, konstantin.ananyev

On Wed, 11 Apr 2018 22:42:55 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:

> 11/04/2018 19:01, Pavan Nikhilesh:
> > Use __atomic_exchange_n instead of __atomic_exchange_(2/4/8).
> > The error was:
> > 	include/generic/rte_atomic.h:215:9: error:
> > 		implicit declaration of function '__atomic_exchange_2'
> > 		is invalid in C99
> > 	include/generic/rte_atomic.h:494:9: error:
> > 		implicit declaration of function '__atomic_exchange_4'
> > 		is invalid in C99
> > 	include/generic/rte_atomic.h:772:9: error:
> > 		implicit declaration of function '__atomic_exchange_8'
> > 		is invalid in C99
> > 
> > Fixes: ff2863570fcc ("eal: introduce atomic exchange operation")
> > 
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>  
> 
> We did not understand why this error is seen only on ARM
> (hopefully we won't discover it somewhere else),
> but it is a pragmatic fix.
> 
> Applied, thanks

Maybe Gcc always defines its own builtin functions.

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

end of thread, other threads:[~2018-04-11 21:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-06 11:01 [dpdk-dev] [PATCH] eal: fix clang compilation error on ARM64 Pavan Nikhilesh
2018-04-06 16:24 ` Thomas Monjalon
2018-04-06 18:25   ` Pavan Nikhilesh
2018-04-10 15:07     ` Thomas Monjalon
2018-04-10 21:35       ` Thomas Monjalon
2018-04-11  8:38         ` Pavan Nikhilesh
2018-04-11  8:46           ` Thomas Monjalon
2018-04-11  9:00             ` Pavan Nikhilesh
2018-04-11 17:01 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh
2018-04-11 20:42   ` Thomas Monjalon
2018-04-11 21:48     ` Stephen Hemminger

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).