rte_trace: fix build on PPC64
PATCH 1/1 rte_trace: fix build on PPC64
The AltiVec header file breaks boolean type:
In file included from ../lib/librte_mempool/rte_mempool_trace_fp.h:18:0,
from ../lib/librte_mempool/rte_mempool.h:54,
from ../lib/librte_mbuf/rte_mbuf.h:38,
from ../lib/librte_net/rte_ether.h:23,
from ../drivers/common/mlx5/mlx5_nl.h:10,
from ../drivers/common/mlx5/mlx5_nl.c:23:../lib/librte_eal/include/rte_trace_point.h: In function ‘__rte_trace_point_fp_is_enabled’:../lib/librte_eal/include/rte_trace_point.h:226:9: error: incompatible types when returning type ‘int’ but ‘__vector __bool int {aka __vector(4) __bool int}’ was expected
return false;
This is the same as
https://git.dpdk.org/dpdk/commit/?id=725f5dd
and yet, there is no better solution for it
--- lib/librte_eal/include/rte_trace_point.h | 6 ++++++ 1 file changed, 6 insertions(+)
lib/librte_eal/include/rte_trace_point.h +6 -0
@@ -26,6 +26,12 @@ extern "C" {#include <rte_common.h> #include <rte_compat.h> +#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) +#undef bool +/* redefine as in stdbool.h */ +#define bool _Bool +#endif +/** The tracepoint object. */ typedef uint64_t rte_trace_point_t ;
Signature · 1 line
2.17.1
Jerin Jacob
NAKQuoted 31 lines · Thinh Tran
The AltiVec header file breaks boolean type:
In file included from
../lib/librte_mempool/rte_mempool_trace_fp.h:18:0,from ../lib/librte_mempool/rte_mempool.h:54, from ../lib/librte_mbuf/rte_mbuf.h:38, from ../lib/librte_net/rte_ether.h:23, from ../drivers/common/mlx5/mlx5_nl.h:10, from ../drivers/common/mlx5/mlx5_nl.c:23:
../lib/librte_eal/include/rte_trace_point.h: In function ‘__rte_trace_point_fp_is_enabled’:../lib/librte_eal/include/rte_trace_point.h:226:9: error: incompatible types when returning type ‘int’ but ‘__vector__boolint {aka__vector(4)__boolint}’ was expected
return false;This is the same as
https://git.dpdk.org/dpdk/commit/?id=725f5ddand yet, there is no better solution for it
Signed-off-by Thinh Tran <[email protected]>--- lib/librte_eal/include/rte_trace_point.h | 6 ++++++ 1 file changed, 6 insertions(+)lib/librte_eal/include/rte_trace_point.h +0
-0
lib/librte_eal/include/rte_trace_point.h extern "C" { · line 33
Quoted 8 lines
lib/librte_eal/include/rte_trace_point.h +5
-0@@ -26,6 +26,12 @@ extern "C" {#include <rte_common.h> #include <rte_compat.h> +#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) +#undef bool +/* redefine as in stdbool.h */ +#define bool _Bool +#endif
NACK.
Please move the fix to rte_common.h or similar as it not specific to trace. if you do so, the following hack also not need.
https://git.dpdk.org/dpdk/commit/?id=725f5dd
Quoted 7 lines
lib/librte_eal/include/rte_trace_point.h +1
-1+/** The tracepoint object. */ typedef uint64_t rte_trace_point_t ; --2.17.1
Quoted 44 lines · Jerin Jacob
Quoted 31 lines · Thinh Tran
The AltiVec header file breaks boolean type:
In file included from
../lib/librte_mempool/rte_mempool_trace_fp.h:18:0,from ../lib/librte_mempool/rte_mempool.h:54, from ../lib/librte_mbuf/rte_mbuf.h:38, from ../lib/librte_net/rte_ether.h:23, from ../drivers/common/mlx5/mlx5_nl.h:10, from ../drivers/common/mlx5/mlx5_nl.c:23:
../lib/librte_eal/include/rte_trace_point.h: In function ‘__rte_trace_point_fp_is_enabled’:../lib/librte_eal/include/rte_trace_point.h:226:9: error: incompatible types when returning type ‘int’ but ‘__vector__boolint {aka__vector(4)__boolint}’ was expected
return false;This is the same as
https://git.dpdk.org/dpdk/commit/?id=725f5ddand yet, there is no better solution for it
Signed-off-by Thinh Tran <[email protected]>--- lib/librte_eal/include/rte_trace_point.h | 6 ++++++ 1 file changed, 6 insertions(+)lib/librte_eal/include/rte_trace_point.h +0
-0lib/librte_eal/include/rte_trace_point.h extern "C" { · line 33
Quoted 8 lines
lib/librte_eal/include/rte_trace_point.h +5
-0@@ -26,6 +26,12 @@ extern "C" {#include <rte_common.h> #include <rte_compat.h> +#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) +#undef bool +/* redefine as in stdbool.h */ +#define bool _Bool +#endif NACK.
Quoted 3 lines
Please move the fix to
rte_common.hor similar as it not specific to trace. if you do so, the following hack also not need.
https://git.dpdk.org/dpdk/commit/?id=725f5dd
+1
Signature · 1 line
David Marchand
Agreed, this is not rte_trace issue. Moving to rte_common.h does not work neither, because altivec.h is included after and redefine bool This conflict happens on PPC64, I'll create a different patch.
Thanks,
Thinh Tran
Quoted 54 lines · Jerin Jacob
Quoted 31 lines · Thinh Tran
The AltiVec header file breaks boolean type:
In file included from
../lib/librte_mempool/rte_mempool_trace_fp.h:18:0,from ../lib/librte_mempool/rte_mempool.h:54, from ../lib/librte_mbuf/rte_mbuf.h:38, from ../lib/librte_net/rte_ether.h:23, from ../drivers/common/mlx5/mlx5_nl.h:10, from ../drivers/common/mlx5/mlx5_nl.c:23:
../lib/librte_eal/include/rte_trace_point.h: In function ‘__rte_trace_point_fp_is_enabled’:../lib/librte_eal/include/rte_trace_point.h:226:9: error: incompatible types when returning type ‘int’ but ‘__vector__boolint {aka__vector(4)__boolint}’ was expected
return false;This is the same as
https://git.dpdk.org/dpdk/commit/?id=725f5ddand yet, there is no better solution for it
Signed-off-by Thinh Tran <[email protected]>--- lib/librte_eal/include/rte_trace_point.h | 6 ++++++ 1 file changed, 6 insertions(+)lib/librte_eal/include/rte_trace_point.h +0
-0lib/librte_eal/include/rte_trace_point.h extern "C" { · line 33
Quoted 8 lines
lib/librte_eal/include/rte_trace_point.h +5
-0@@ -26,6 +26,12 @@ extern "C" {#include <rte_common.h> #include <rte_compat.h> +#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) +#undef bool +/* redefine as in stdbool.h */ +#define bool _Bool +#endif NACK.
Please move the fix to
rte_common.hor similar as it not specific to trace. if you do so, the following hack also not need.
https://git.dpdk.org/dpdk/commit/?id=725f5ddQuoted 7 lines
lib/librte_eal/include/rte_trace_point.h +1
-1+/** The tracepoint object. */ typedef uint64_t rte_trace_point_t ; --2.17.1
Quoted 4 lines · Thinh Tran
Agreed, this is not
rte_traceissue. Moving torte_common.hdoes not work neither, becausealtivec.his included after and redefine bool This conflict happens on PPC64, I'll create a different patch.
Please look at Ori patch.
Thanks.
http://patchwork.dpdk.org/patch/69426/
Signature · 1 line
David Marchand
I looked at it, but I have a simpler patch below that can resolve the conflict, including after removing previous patches in mlx4/mlx5
Thanks,
Thinh Tran
diff --git a/lib/librte_eal/ppc/include/rte_memcpy.hb/lib/librte_eal/ppc/include/rte_memcpy.h index 25311ba1d..abeede231 100644
lib/librte_eal/ppc/include/rte_memcpy.h +4 -0
@@ -11,6 +11,10 @@/*To include altivec.h, GCC version must >= 4.8 */ #include <altivec.h> +/* redefine as in stdbool.h */ +#undef bool +#define bool _Bool +#ifdef __cplusplusextern "C" {#endif
Quoted 11 lines · David Marchand
Quoted 4 lines · Thinh Tran
Agreed, this is not
rte_traceissue. Moving torte_common.hdoes not work neither, becausealtivec.his included after and redefine bool This conflict happens on PPC64, I'll create a different patch.Please look at Ori patch.
Thanks.