Skip to contentSkip to conversation

rte_trace: fix build on PPC64

PATCH NAK Thinh Tran 3 participants 6 messages Apr 27, 2020 – Apr 28, 2020

lore
Share & tools
lore

Thinh Tran

author
#0 lore raw

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
index 4d956ec16..2ede9e3ba 100644
@@ -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
#1 lore raw
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 __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 +0 -0
index 4d956ec16..2ede9e3ba 100644

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

#2 lore raw
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 __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 +0 -0
index 4d956ec16..2ede9e3ba 100644

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.

Quoted 3 lines

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

+1

Signature · 1 line
David Marchand
author
#3 lore raw
In reply to Jerin Jacob

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 __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 +0 -0
index 4d956ec16..2ede9e3ba 100644

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

#4 lore raw
Quoted 4 lines · Thinh Tran

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.

Please look at Ori patch.
Thanks.

http://patchwork.dpdk.org/patch/69426/

Signature · 1 line
David Marchand
author
#5 lore raw

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.h
b/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 __cplusplus
 extern "C" {
 #endif
Quoted 11 lines · David Marchand
Quoted 4 lines · Thinh Tran

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.

Please look at Ori patch.
Thanks.

http://patchwork.dpdk.org/patch/69426/