Skip to contentSkip to conversation

eal/ppc: undefine AltiVec keyword vector

PATCH In review Thomas Monjalon 4 participants 11 messages May 25, 2022 – Jun 1, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal/ppc: undefine AltiVec keyword vector

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

---
 doc/guides/rel_notes/release_22_07.rst | 5 +++++
 lib/eal/ppc/include/rte_altivec.h      | 7 +++++++
 2 files changed, 12 insertions(+)
doc/guides/rel_notes/release_22_07.rst +5 -0
index e49cacecef..ee60b17821 100644
@@ -133,6 +133,11 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* The DPDK header file ``rte_altivec.h``,
+  which is a wrapper for the PPC header file ``altivec.h``,
+  undefines the AltiVec keyword ``vector``.
+  The alternative keyword ``__vector`` should be used instead.
+
 
 ABI Changes
 -----------
lib/eal/ppc/include/rte_altivec.h +7 -0
index 1551a94544..7c088d2d16 100644
@@ -9,6 +9,13 @@
 /* To include altivec.h, GCC version must be >= 4.8 */
 #include <altivec.h>
 
+/*
+ * The keyword "vector" is defined in altivec.h,
+ * and often conflicts with code in applications or dependencies.
+ * It is preferred to use the alternative keyword "__vector".
+ */
+#undef vector
+
 /*
  * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11.
  * Otherwise there would be a type conflict between stdbool and altivec.
Signature · 1 line
2.36.0
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Thomas Monjalon

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

Tested-by on v1 1/1
#2 lore raw
In reply to Thomas Monjalon
Quoted 12 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, May 25, 2022 12:53 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; David Christensen <[email protected]>
Subject: [PATCH] eal/ppc: undefine AltiVec keyword vector

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

Quoted 8 lines

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

---

Build passes with latest rdma-core master (36395896) on Ubuntu 20.04.4.

Thanks,
Ali

#3 lore raw
Quoted 24 lines

-----Original Message-----
From: Ali Alnubani
Sent: Wednesday, May 25, 2022 2:09 PM
To: Thomas Monjalon <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; David Christensen <[email protected]>
Subject: RE: [PATCH] eal/ppc: undefine AltiVec keyword vector

Quoted 8 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, May 25, 2022 12:53 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; David Christensen <[email protected]>
Subject: [PATCH] eal/ppc: undefine AltiVec keyword vector

Quoted 6 lines

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name

"vector".

Quoted 1 line
Quoted 7 lines
Quoted 5 lines

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

---

Build passes with latest rdma-core master (36395896) on Ubuntu 20.04.4.

Compiler: powerpc64le-linux-gnu-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

Quoted 5 lines

Thanks,
Ali

Acked-by on v1 1/1
#4 lore raw
In reply to Thomas Monjalon
Quoted 7 lines · Thomas Monjalon

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name "vector".

Quoted 9 lines

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

---
 doc/guides/rel_notes/release_22_07.rst | 5 +++++
 lib/eal/ppc/include/rte_altivec.h      | 7 +++++++
 2 files changed, 12 insertions(+)
#5 lore raw

25/05/2022 13:48, Ray Kinsella:

Quoted 13 lines
Quoted 10 lines · Thomas Monjalon

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

Quoted 8 lines
Quoted 6 lines
---
 doc/guides/rel_notes/release_22_07.rst | 5 +++++
 lib/eal/ppc/include/rte_altivec.h      | 7 +++++++
 2 files changed, 12 insertions(+)

Just to make sure, we are all OK to break compatibility of rte_altivec.h? It means the keyword vector is not available anymore with this #include. Please confirm it is OK to merge in DPDK 22.07.

#6 lore raw
Quoted 21 lines · Thomas Monjalon

25/05/2022 13:48, Ray Kinsella:

Quoted 20 lines
Quoted 16 lines · Thomas Monjalon

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

---
 doc/guides/rel_notes/release_22_07.rst | 5 +++++
 lib/eal/ppc/include/rte_altivec.h      | 7 +++++++
 2 files changed, 12 insertions(+)
Quoted 5 lines
Quoted 1 line

Just to make sure, we are all OK to break compatibility of rte_altivec.h? It means the keyword vector is not available anymore with this #include. Please confirm it is OK to merge in DPDK 22.07.

I did think about it yes ;-).
I can't see how it would break the ABI in the short term. And it makes sense to preclude this keyword in the long term.

So I ack'ed - did I miss something?

Signature · 1 line
Regards, Ray K
#7 lore raw
Quoted 30 lines · Ray Kinsella
Quoted 21 lines · Thomas Monjalon

25/05/2022 13:48, Ray Kinsella:

Quoted 20 lines
Quoted 16 lines · Thomas Monjalon

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

---
 doc/guides/rel_notes/release_22_07.rst | 5 +++++
 lib/eal/ppc/include/rte_altivec.h      | 7 +++++++
 2 files changed, 12 insertions(+)
Quoted 5 lines
Quoted 1 line

Just to make sure, we are all OK to break compatibility of rte_altivec.h? It means the keyword vector is not available anymore with this #include. Please confirm it is OK to merge in DPDK 22.07.

Quoted 5 lines

I did think about it yes ;-).
I can't see how it would break the ABI in the short term. And it makes sense to preclude this keyword in the long term.

So I ack'ed - did I miss something?

double ack, impact of break is understood as follows.

* this is not an issue with abi it is an issue with api.
* the break will cause a compile failure, the action to resolve is to replace vector with __vector.

Quoted 4 lines
Signature · 2 lines
-- 
Regards, Ray K
#8 lore raw

25/05/2022 20:34, Tyler Retzlaff:

Quoted 34 lines · Ray Kinsella
Quoted 27 lines
Quoted 20 lines · Thomas Monjalon

25/05/2022 13:48, Ray Kinsella:

Quoted 19 lines
Quoted 16 lines · Thomas Monjalon

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

---
 doc/guides/rel_notes/release_22_07.rst | 5 +++++
 lib/eal/ppc/include/rte_altivec.h      | 7 +++++++
 2 files changed, 12 insertions(+)
Quoted 5 lines
Quoted 1 line

Just to make sure, we are all OK to break compatibility of rte_altivec.h? It means the keyword vector is not available anymore with this #include. Please confirm it is OK to merge in DPDK 22.07.

Quoted 5 lines

I did think about it yes ;-).
I can't see how it would break the ABI in the short term. And it makes sense to preclude this keyword in the long term.

So I ack'ed - did I miss something?

Quoted 7 lines

double ack, impact of break is understood as follows.

* this is not an issue with abi it is an issue with api.
* the break will cause a compile failure, the action to resolve is to replace vector with __vector.

Exactly

I'll wait few days or acks from the techboard, and will apply.

#9 lore raw
Quoted 39 lines · Thomas Monjalon

25/05/2022 20:34, Tyler Retzlaff:

Quoted 38 lines · Ray Kinsella
Quoted 27 lines
Quoted 20 lines · Thomas Monjalon

25/05/2022 13:48, Ray Kinsella:

Quoted 19 lines
Quoted 16 lines · Thomas Monjalon

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

---
 doc/guides/rel_notes/release_22_07.rst | 5 +++++
 lib/eal/ppc/include/rte_altivec.h      | 7 +++++++
 2 files changed, 12 insertions(+)
Quoted 5 lines
Quoted 1 line

Just to make sure, we are all OK to break compatibility of rte_altivec.h? It means the keyword vector is not available anymore with this #include. Please confirm it is OK to merge in DPDK 22.07.

Quoted 5 lines

I did think about it yes ;-).
I can't see how it would break the ABI in the short term. And it makes sense to preclude this keyword in the long term.

So I ack'ed - did I miss something?

double ack, impact of break is understood as follows.

Quoted 7 lines
Quoted 3 lines

* this is not an issue with abi it is an issue with api.
* the break will cause a compile failure, the action to resolve is to replace vector with __vector.

Exactly

I'll wait few days or acks from the techboard, and will apply.

+1

Signature · 1 line
Regards, Ray K
author Applied
#10 lore raw

26/05/2022 13:02, Ray Kinsella:

Quoted 44 lines
Quoted 43 lines · Thomas Monjalon

25/05/2022 20:34, Tyler Retzlaff:

Quoted 41 lines · Ray Kinsella
Quoted 27 lines
Quoted 20 lines · Thomas Monjalon

25/05/2022 13:48, Ray Kinsella:

Quoted 19 lines
Quoted 16 lines · Thomas Monjalon

The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector", so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using the keyword "vector" for its AltiVec meaning.

---
 doc/guides/rel_notes/release_22_07.rst | 5 +++++
 lib/eal/ppc/include/rte_altivec.h      | 7 +++++++
 2 files changed, 12 insertions(+)
Quoted 5 lines
Quoted 1 line

Just to make sure, we are all OK to break compatibility of rte_altivec.h? It means the keyword vector is not available anymore with this #include. Please confirm it is OK to merge in DPDK 22.07.

Quoted 5 lines

I did think about it yes ;-).
I can't see how it would break the ABI in the short term. And it makes sense to preclude this keyword in the long term.

So I ack'ed - did I miss something?

double ack, impact of break is understood as follows.

* this is not an issue with abi it is an issue with api.
* the break will cause a compile failure, the action to resolve is to replace vector with __vector.

Quoted 5 lines
Quoted 3 lines

Exactly

I'll wait few days or acks from the techboard, and will apply.

+1

Applied