DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] remove __typeof__ from expansion of per lcore macros
@ 2023-12-19 17:27 Tyler Retzlaff
  2023-12-19 17:27 ` [PATCH 1/2] eal: provide type instead of expression to per lcore macro Tyler Retzlaff
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Tyler Retzlaff @ 2023-12-19 17:27 UTC (permalink / raw)
  To: dev; +Cc: Tyler Retzlaff

The design of the macros requires a type to be provided to the macro.

By expanding the type parameter inside of typeof it also inadvertently
allows an expression to be used which appears not to have been intended
after evaluating the parameter name and existing macro use.

Technically this is an API break but only for applications that were
using these macros outside of the original design intent.

Tyler Retzlaff (2):
  eal: provide type instead of expression to per lcore macro
  eal: remove typeof from per lcore macros

 lib/eal/common/eal_common_errno.c | 2 +-
 lib/eal/include/rte_per_lcore.h   | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

-- 
1.8.3.1


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

* [PATCH 1/2] eal: provide type instead of expression to per lcore macro
  2023-12-19 17:27 [PATCH 0/2] remove __typeof__ from expansion of per lcore macros Tyler Retzlaff
@ 2023-12-19 17:27 ` Tyler Retzlaff
  2023-12-19 17:27 ` [PATCH 2/2] eal: remove typeof from per lcore macros Tyler Retzlaff
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Tyler Retzlaff @ 2023-12-19 17:27 UTC (permalink / raw)
  To: dev; +Cc: Tyler Retzlaff

Adjust the use of per lcore macro to provide type as the first argument
as to not require __typeof__ during expansion.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/common/eal_common_errno.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c
index b30e2f0..fff8c1f 100644
--- a/lib/eal/common/eal_common_errno.c
+++ b/lib/eal/common/eal_common_errno.c
@@ -28,7 +28,7 @@
 	static const char *sep = "";
 #endif
 #define RETVAL_SZ 256
-	static RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);
+	static RTE_DEFINE_PER_LCORE(char, retval[RETVAL_SZ]);
 	char *ret = RTE_PER_LCORE(retval);
 
 	/* since some implementations of strerror_r throw an error
-- 
1.8.3.1


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

* [PATCH 2/2] eal: remove typeof from per lcore macros
  2023-12-19 17:27 [PATCH 0/2] remove __typeof__ from expansion of per lcore macros Tyler Retzlaff
  2023-12-19 17:27 ` [PATCH 1/2] eal: provide type instead of expression to per lcore macro Tyler Retzlaff
@ 2023-12-19 17:27 ` Tyler Retzlaff
  2023-12-19 17:36 ` [PATCH 0/2] remove __typeof__ from expansion of " Bruce Richardson
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Tyler Retzlaff @ 2023-12-19 17:27 UTC (permalink / raw)
  To: dev; +Cc: Tyler Retzlaff

The design of the macros requires a type to be provided to the macro.

By expanding the type parameter inside of typeof it also inadvertently
allows an expression to be used which appears not to have been intended
after evaluating the parameter name and existing macro use.

Technically this is an API break but only for applications that were
using these macros outside of the original design intent.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/include/rte_per_lcore.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/eal/include/rte_per_lcore.h b/lib/eal/include/rte_per_lcore.h
index 41fe1f0..529995e 100644
--- a/lib/eal/include/rte_per_lcore.h
+++ b/lib/eal/include/rte_per_lcore.h
@@ -24,10 +24,10 @@
 
 #ifdef RTE_TOOLCHAIN_MSVC
 #define RTE_DEFINE_PER_LCORE(type, name)			\
-	__declspec(thread) typeof(type) per_lcore_##name
+	__declspec(thread) type per_lcore_##name
 
 #define RTE_DECLARE_PER_LCORE(type, name)			\
-	extern __declspec(thread) typeof(type) per_lcore_##name
+	extern __declspec(thread) type per_lcore_##name
 #else
 /**
  * Macro to define a per lcore variable "var" of type "type", don't
@@ -35,13 +35,13 @@
  * whole macro.
  */
 #define RTE_DEFINE_PER_LCORE(type, name)			\
-	__thread __typeof__(type) per_lcore_##name
+	__thread type per_lcore_##name
 
 /**
  * Macro to declare an extern per lcore variable "var" of type "type"
  */
 #define RTE_DECLARE_PER_LCORE(type, name)			\
-	extern __thread __typeof__(type) per_lcore_##name
+	extern __thread type per_lcore_##name
 #endif
 
 /**
-- 
1.8.3.1


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

* Re: [PATCH 0/2] remove __typeof__ from expansion of per lcore macros
  2023-12-19 17:27 [PATCH 0/2] remove __typeof__ from expansion of per lcore macros Tyler Retzlaff
  2023-12-19 17:27 ` [PATCH 1/2] eal: provide type instead of expression to per lcore macro Tyler Retzlaff
  2023-12-19 17:27 ` [PATCH 2/2] eal: remove typeof from per lcore macros Tyler Retzlaff
@ 2023-12-19 17:36 ` Bruce Richardson
  2024-01-02 23:44 ` [PATCH v2 0/3] " Tyler Retzlaff
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Bruce Richardson @ 2023-12-19 17:36 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: dev

On Tue, Dec 19, 2023 at 09:27:42AM -0800, Tyler Retzlaff wrote:
> The design of the macros requires a type to be provided to the macro.
> 
> By expanding the type parameter inside of typeof it also inadvertently
> allows an expression to be used which appears not to have been intended
> after evaluating the parameter name and existing macro use.
> 
> Technically this is an API break but only for applications that were
> using these macros outside of the original design intent.
> 
> Tyler Retzlaff (2):
>   eal: provide type instead of expression to per lcore macro
>   eal: remove typeof from per lcore macros
> 
Series-acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* [PATCH v2 0/3] remove __typeof__ from expansion of per lcore macros
  2023-12-19 17:27 [PATCH 0/2] remove __typeof__ from expansion of per lcore macros Tyler Retzlaff
                   ` (2 preceding siblings ...)
  2023-12-19 17:36 ` [PATCH 0/2] remove __typeof__ from expansion of " Bruce Richardson
@ 2024-01-02 23:44 ` Tyler Retzlaff
  2024-01-02 23:45   ` [PATCH v2 1/3] eal: provide type to per lcore macro Tyler Retzlaff
                     ` (3 more replies)
  2024-02-13 11:12 ` [PATCH 0/2] " David Marchand
  2024-02-13 19:12 ` [PATCH v3 0/3] " Tyler Retzlaff
  5 siblings, 4 replies; 16+ messages in thread
From: Tyler Retzlaff @ 2024-01-02 23:44 UTC (permalink / raw)
  To: dev; +Cc: Kai Ji, Pablo de Lara, Tyler Retzlaff

The design of the macros requires a type to be provided to the macro.

By expanding the type parameter inside of typeof it also inadvertently
allows an expression to be used which appears not to have been intended
after evaluating the parameter name and existing macro use.

Technically this is an API break but only for applications that were
using these macros outside of the original design intent.

v2:
  * add additional patch to adjust usage for crypto/ipsec_mb 

Tyler Retzlaff (3):
  eal: provide type to per lcore macro
  crypto/ipsec_mb: provide type to per lcore macro
  eal: remove typeof from per lcore macros

 drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h | 2 +-
 lib/eal/common/eal_common_errno.c            | 2 +-
 lib/eal/include/rte_per_lcore.h              | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

-- 
1.8.3.1


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

* [PATCH v2 1/3] eal: provide type to per lcore macro
  2024-01-02 23:44 ` [PATCH v2 0/3] " Tyler Retzlaff
@ 2024-01-02 23:45   ` Tyler Retzlaff
  2024-01-02 23:45   ` [PATCH v2 2/3] crypto/ipsec_mb: " Tyler Retzlaff
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: Tyler Retzlaff @ 2024-01-02 23:45 UTC (permalink / raw)
  To: dev; +Cc: Kai Ji, Pablo de Lara, Tyler Retzlaff

Adjust the use of per lcore macro to provide type as the first argument
as to not require __typeof__ during expansion.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/common/eal_common_errno.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c
index b30e2f0..fff8c1f 100644
--- a/lib/eal/common/eal_common_errno.c
+++ b/lib/eal/common/eal_common_errno.c
@@ -28,7 +28,7 @@
 	static const char *sep = "";
 #endif
 #define RETVAL_SZ 256
-	static RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);
+	static RTE_DEFINE_PER_LCORE(char, retval[RETVAL_SZ]);
 	char *ret = RTE_PER_LCORE(retval);
 
 	/* since some implementations of strerror_r throw an error
-- 
1.8.3.1


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

* [PATCH v2 2/3] crypto/ipsec_mb: provide type to per lcore macro
  2024-01-02 23:44 ` [PATCH v2 0/3] " Tyler Retzlaff
  2024-01-02 23:45   ` [PATCH v2 1/3] eal: provide type to per lcore macro Tyler Retzlaff
@ 2024-01-02 23:45   ` Tyler Retzlaff
  2024-01-02 23:45   ` [PATCH v2 3/3] eal: remove typeof from per lcore macros Tyler Retzlaff
  2024-01-08 10:45   ` [PATCH v2 0/3] remove __typeof__ from expansion of " Bruce Richardson
  3 siblings, 0 replies; 16+ messages in thread
From: Tyler Retzlaff @ 2024-01-02 23:45 UTC (permalink / raw)
  To: dev; +Cc: Kai Ji, Pablo de Lara, Tyler Retzlaff

Adjust the use of per lcore macro to provide type as the first
argument as to not require __typeof__ during expansion.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h
index 55a0416..8a5a41f 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h
@@ -130,7 +130,7 @@ struct aesni_gcm_ops {
 	aesni_gmac_finalize_t gmac_finalize;
 };
 
-RTE_DEFINE_PER_LCORE(struct aesni_gcm_ops[GCM_NUM_KEY_TYPES], gcm_ops);
+RTE_DEFINE_PER_LCORE(struct aesni_gcm_ops, gcm_ops[GCM_NUM_KEY_TYPES]);
 
 struct aesni_gcm_qp_data {
 	struct gcm_context_data gcm_ctx_data;
-- 
1.8.3.1


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

* [PATCH v2 3/3] eal: remove typeof from per lcore macros
  2024-01-02 23:44 ` [PATCH v2 0/3] " Tyler Retzlaff
  2024-01-02 23:45   ` [PATCH v2 1/3] eal: provide type to per lcore macro Tyler Retzlaff
  2024-01-02 23:45   ` [PATCH v2 2/3] crypto/ipsec_mb: " Tyler Retzlaff
@ 2024-01-02 23:45   ` Tyler Retzlaff
  2024-01-08 10:45   ` [PATCH v2 0/3] remove __typeof__ from expansion of " Bruce Richardson
  3 siblings, 0 replies; 16+ messages in thread
From: Tyler Retzlaff @ 2024-01-02 23:45 UTC (permalink / raw)
  To: dev; +Cc: Kai Ji, Pablo de Lara, Tyler Retzlaff

The design of the macros requires a type to be provided to the macro.

By expanding the type parameter inside of typeof it also inadvertently
allows an expression to be used which appears not to have been intended
after evaluating the parameter name and existing macro use.

Technically this is an API break but only for applications that were
using these macros outside of the original design intent.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/include/rte_per_lcore.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/eal/include/rte_per_lcore.h b/lib/eal/include/rte_per_lcore.h
index 41fe1f0..529995e 100644
--- a/lib/eal/include/rte_per_lcore.h
+++ b/lib/eal/include/rte_per_lcore.h
@@ -24,10 +24,10 @@
 
 #ifdef RTE_TOOLCHAIN_MSVC
 #define RTE_DEFINE_PER_LCORE(type, name)			\
-	__declspec(thread) typeof(type) per_lcore_##name
+	__declspec(thread) type per_lcore_##name
 
 #define RTE_DECLARE_PER_LCORE(type, name)			\
-	extern __declspec(thread) typeof(type) per_lcore_##name
+	extern __declspec(thread) type per_lcore_##name
 #else
 /**
  * Macro to define a per lcore variable "var" of type "type", don't
@@ -35,13 +35,13 @@
  * whole macro.
  */
 #define RTE_DEFINE_PER_LCORE(type, name)			\
-	__thread __typeof__(type) per_lcore_##name
+	__thread type per_lcore_##name
 
 /**
  * Macro to declare an extern per lcore variable "var" of type "type"
  */
 #define RTE_DECLARE_PER_LCORE(type, name)			\
-	extern __thread __typeof__(type) per_lcore_##name
+	extern __thread type per_lcore_##name
 #endif
 
 /**
-- 
1.8.3.1


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

* Re: [PATCH v2 0/3] remove __typeof__ from expansion of per lcore macros
  2024-01-02 23:44 ` [PATCH v2 0/3] " Tyler Retzlaff
                     ` (2 preceding siblings ...)
  2024-01-02 23:45   ` [PATCH v2 3/3] eal: remove typeof from per lcore macros Tyler Retzlaff
@ 2024-01-08 10:45   ` Bruce Richardson
  3 siblings, 0 replies; 16+ messages in thread
From: Bruce Richardson @ 2024-01-08 10:45 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: dev, Kai Ji, Pablo de Lara

On Tue, Jan 02, 2024 at 03:44:59PM -0800, Tyler Retzlaff wrote:
> The design of the macros requires a type to be provided to the macro.
> 
> By expanding the type parameter inside of typeof it also inadvertently
> allows an expression to be used which appears not to have been intended
> after evaluating the parameter name and existing macro use.
> 
> Technically this is an API break but only for applications that were
> using these macros outside of the original design intent.
> 
> v2:
>   * add additional patch to adjust usage for crypto/ipsec_mb 
> 
Series-acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [PATCH 0/2] remove __typeof__ from expansion of per lcore macros
  2023-12-19 17:27 [PATCH 0/2] remove __typeof__ from expansion of per lcore macros Tyler Retzlaff
                   ` (3 preceding siblings ...)
  2024-01-02 23:44 ` [PATCH v2 0/3] " Tyler Retzlaff
@ 2024-02-13 11:12 ` David Marchand
  2024-02-13 19:12 ` [PATCH v3 0/3] " Tyler Retzlaff
  5 siblings, 0 replies; 16+ messages in thread
From: David Marchand @ 2024-02-13 11:12 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: dev

On Tue, Dec 19, 2023 at 6:28 PM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> The design of the macros requires a type to be provided to the macro.
>
> By expanding the type parameter inside of typeof it also inadvertently
> allows an expression to be used which appears not to have been intended
> after evaluating the parameter name and existing macro use.
>
> Technically this is an API break but only for applications that were
> using these macros outside of the original design intent.

Please add a release note on this topic (I am fine with just a reply
to this mail, I can fold this change when applying).

The rest lgtm.


-- 
David Marchand


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

* [PATCH v3 0/3] remove __typeof__ from expansion of per lcore macros
  2023-12-19 17:27 [PATCH 0/2] remove __typeof__ from expansion of per lcore macros Tyler Retzlaff
                   ` (4 preceding siblings ...)
  2024-02-13 11:12 ` [PATCH 0/2] " David Marchand
@ 2024-02-13 19:12 ` Tyler Retzlaff
  2024-02-13 19:12   ` [PATCH v3 1/3] eal: provide type to per lcore macro Tyler Retzlaff
                     ` (3 more replies)
  5 siblings, 4 replies; 16+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 19:12 UTC (permalink / raw)
  To: dev
  Cc: Kai Ji, Pablo de Lara, bruce.richardson, david.marchand, Tyler Retzlaff

The design of the macros requires a type to be provided to the macro.

By expanding the type parameter inside of typeof it also inadvertently
allows an expression to be used which appears not to have been intended
after evaluating the parameter name and existing macro use.

Technically this is an API break but only for applications that were
using these macros outside of the original design intent.

v3:
  * provide notice in release_24_03.rst about change in macro
    expansion.
v2:
  * add additional patch to adjust usage for crypto/ipsec_mb

Tyler Retzlaff (3):
  eal: provide type to per lcore macro
  crypto/ipsec_mb: provide type to per lcore macro
  eal: remove typeof from per lcore macros

 doc/guides/rel_notes/release_24_03.rst       | 5 +++++
 drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h | 2 +-
 lib/eal/common/eal_common_errno.c            | 2 +-
 lib/eal/include/rte_per_lcore.h              | 8 ++++----
 4 files changed, 11 insertions(+), 6 deletions(-)

-- 
1.8.3.1


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

* [PATCH v3 1/3] eal: provide type to per lcore macro
  2024-02-13 19:12 ` [PATCH v3 0/3] " Tyler Retzlaff
@ 2024-02-13 19:12   ` Tyler Retzlaff
  2024-02-13 19:12   ` [PATCH v3 2/3] crypto/ipsec_mb: " Tyler Retzlaff
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 19:12 UTC (permalink / raw)
  To: dev
  Cc: Kai Ji, Pablo de Lara, bruce.richardson, david.marchand, Tyler Retzlaff

Adjust the use of per lcore macro to provide type as the first argument
as to not require __typeof__ during expansion.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eal/common/eal_common_errno.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c
index b30e2f0..fff8c1f 100644
--- a/lib/eal/common/eal_common_errno.c
+++ b/lib/eal/common/eal_common_errno.c
@@ -28,7 +28,7 @@
 	static const char *sep = "";
 #endif
 #define RETVAL_SZ 256
-	static RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);
+	static RTE_DEFINE_PER_LCORE(char, retval[RETVAL_SZ]);
 	char *ret = RTE_PER_LCORE(retval);
 
 	/* since some implementations of strerror_r throw an error
-- 
1.8.3.1


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

* [PATCH v3 2/3] crypto/ipsec_mb: provide type to per lcore macro
  2024-02-13 19:12 ` [PATCH v3 0/3] " Tyler Retzlaff
  2024-02-13 19:12   ` [PATCH v3 1/3] eal: provide type to per lcore macro Tyler Retzlaff
@ 2024-02-13 19:12   ` Tyler Retzlaff
  2024-02-13 19:12   ` [PATCH v3 3/3] eal: remove typeof from per lcore macros Tyler Retzlaff
  2024-02-14  8:19   ` [PATCH v3 0/3] remove __typeof__ from expansion of " David Marchand
  3 siblings, 0 replies; 16+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 19:12 UTC (permalink / raw)
  To: dev
  Cc: Kai Ji, Pablo de Lara, bruce.richardson, david.marchand, Tyler Retzlaff

Adjust the use of per lcore macro to provide type as the first
argument as to not require __typeof__ during expansion.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h
index 55a0416..8a5a41f 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h
@@ -130,7 +130,7 @@ struct aesni_gcm_ops {
 	aesni_gmac_finalize_t gmac_finalize;
 };
 
-RTE_DEFINE_PER_LCORE(struct aesni_gcm_ops[GCM_NUM_KEY_TYPES], gcm_ops);
+RTE_DEFINE_PER_LCORE(struct aesni_gcm_ops, gcm_ops[GCM_NUM_KEY_TYPES]);
 
 struct aesni_gcm_qp_data {
 	struct gcm_context_data gcm_ctx_data;
-- 
1.8.3.1


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

* [PATCH v3 3/3] eal: remove typeof from per lcore macros
  2024-02-13 19:12 ` [PATCH v3 0/3] " Tyler Retzlaff
  2024-02-13 19:12   ` [PATCH v3 1/3] eal: provide type to per lcore macro Tyler Retzlaff
  2024-02-13 19:12   ` [PATCH v3 2/3] crypto/ipsec_mb: " Tyler Retzlaff
@ 2024-02-13 19:12   ` Tyler Retzlaff
  2024-02-13 19:32     ` Morten Brørup
  2024-02-14  8:19   ` [PATCH v3 0/3] remove __typeof__ from expansion of " David Marchand
  3 siblings, 1 reply; 16+ messages in thread
From: Tyler Retzlaff @ 2024-02-13 19:12 UTC (permalink / raw)
  To: dev
  Cc: Kai Ji, Pablo de Lara, bruce.richardson, david.marchand, Tyler Retzlaff

The design of the macros requires a type to be provided to the macro.

By expanding the type parameter inside of typeof it also inadvertently
allows an expression to be used which appears not to have been intended
after evaluating the parameter name and existing macro use.

Technically this is an API break but only for applications that were
using these macros outside of the original design intent.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 doc/guides/rel_notes/release_24_03.rst | 5 +++++
 lib/eal/include/rte_per_lcore.h        | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
index 6741947..39088da 100644
--- a/doc/guides/rel_notes/release_24_03.rst
+++ b/doc/guides/rel_notes/release_24_03.rst
@@ -89,6 +89,11 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* eal: Removed ``typeof(type)`` from the expansion of ``RTE_DEFINE_PER_LCORE``
+  and ``RTE_DECLARE_PER_LCORE`` macros aligning them with their intended design.
+  If use with an expression is desired applications can adapt by supplying
+  ``typeof(e)`` as an argument.
+
 * gso: ``rte_gso_segment`` now returns -ENOTSUP for unknown protocols.
 
 
diff --git a/lib/eal/include/rte_per_lcore.h b/lib/eal/include/rte_per_lcore.h
index 41fe1f0..529995e 100644
--- a/lib/eal/include/rte_per_lcore.h
+++ b/lib/eal/include/rte_per_lcore.h
@@ -24,10 +24,10 @@
 
 #ifdef RTE_TOOLCHAIN_MSVC
 #define RTE_DEFINE_PER_LCORE(type, name)			\
-	__declspec(thread) typeof(type) per_lcore_##name
+	__declspec(thread) type per_lcore_##name
 
 #define RTE_DECLARE_PER_LCORE(type, name)			\
-	extern __declspec(thread) typeof(type) per_lcore_##name
+	extern __declspec(thread) type per_lcore_##name
 #else
 /**
  * Macro to define a per lcore variable "var" of type "type", don't
@@ -35,13 +35,13 @@
  * whole macro.
  */
 #define RTE_DEFINE_PER_LCORE(type, name)			\
-	__thread __typeof__(type) per_lcore_##name
+	__thread type per_lcore_##name
 
 /**
  * Macro to declare an extern per lcore variable "var" of type "type"
  */
 #define RTE_DECLARE_PER_LCORE(type, name)			\
-	extern __thread __typeof__(type) per_lcore_##name
+	extern __thread type per_lcore_##name
 #endif
 
 /**
-- 
1.8.3.1


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

* RE: [PATCH v3 3/3] eal: remove typeof from per lcore macros
  2024-02-13 19:12   ` [PATCH v3 3/3] eal: remove typeof from per lcore macros Tyler Retzlaff
@ 2024-02-13 19:32     ` Morten Brørup
  0 siblings, 0 replies; 16+ messages in thread
From: Morten Brørup @ 2024-02-13 19:32 UTC (permalink / raw)
  To: Tyler Retzlaff, dev
  Cc: Kai Ji, Pablo de Lara, bruce.richardson, david.marchand

> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> Sent: Tuesday, 13 February 2024 20.12
> 
> The design of the macros requires a type to be provided to the macro.
> 
> By expanding the type parameter inside of typeof it also inadvertently
> allows an expression to be used which appears not to have been intended
> after evaluating the parameter name and existing macro use.
> 
> Technically this is an API break but only for applications that were
> using these macros outside of the original design intent.
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Series-acked-by: Morten Brørup <mb@smartsharesystems.com>


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

* Re: [PATCH v3 0/3] remove __typeof__ from expansion of per lcore macros
  2024-02-13 19:12 ` [PATCH v3 0/3] " Tyler Retzlaff
                     ` (2 preceding siblings ...)
  2024-02-13 19:12   ` [PATCH v3 3/3] eal: remove typeof from per lcore macros Tyler Retzlaff
@ 2024-02-14  8:19   ` David Marchand
  3 siblings, 0 replies; 16+ messages in thread
From: David Marchand @ 2024-02-14  8:19 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: dev, Kai Ji, Pablo de Lara, bruce.richardson

On Tue, Feb 13, 2024 at 8:12 PM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> The design of the macros requires a type to be provided to the macro.
>
> By expanding the type parameter inside of typeof it also inadvertently
> allows an expression to be used which appears not to have been intended
> after evaluating the parameter name and existing macro use.
>
> Technically this is an API break but only for applications that were
> using these macros outside of the original design intent.
>
> v3:
>   * provide notice in release_24_03.rst about change in macro
>     expansion.
> v2:
>   * add additional patch to adjust usage for crypto/ipsec_mb
>
> Tyler Retzlaff (3):
>   eal: provide type to per lcore macro
>   crypto/ipsec_mb: provide type to per lcore macro
>   eal: remove typeof from per lcore macros
>
>  doc/guides/rel_notes/release_24_03.rst       | 5 +++++
>  drivers/crypto/ipsec_mb/pmd_aesni_gcm_priv.h | 2 +-
>  lib/eal/common/eal_common_errno.c            | 2 +-
>  lib/eal/include/rte_per_lcore.h              | 8 ++++----
>  4 files changed, 11 insertions(+), 6 deletions(-)

Thanks Tyler.
Series applied.


-- 
David Marchand


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

end of thread, other threads:[~2024-02-14  8:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-19 17:27 [PATCH 0/2] remove __typeof__ from expansion of per lcore macros Tyler Retzlaff
2023-12-19 17:27 ` [PATCH 1/2] eal: provide type instead of expression to per lcore macro Tyler Retzlaff
2023-12-19 17:27 ` [PATCH 2/2] eal: remove typeof from per lcore macros Tyler Retzlaff
2023-12-19 17:36 ` [PATCH 0/2] remove __typeof__ from expansion of " Bruce Richardson
2024-01-02 23:44 ` [PATCH v2 0/3] " Tyler Retzlaff
2024-01-02 23:45   ` [PATCH v2 1/3] eal: provide type to per lcore macro Tyler Retzlaff
2024-01-02 23:45   ` [PATCH v2 2/3] crypto/ipsec_mb: " Tyler Retzlaff
2024-01-02 23:45   ` [PATCH v2 3/3] eal: remove typeof from per lcore macros Tyler Retzlaff
2024-01-08 10:45   ` [PATCH v2 0/3] remove __typeof__ from expansion of " Bruce Richardson
2024-02-13 11:12 ` [PATCH 0/2] " David Marchand
2024-02-13 19:12 ` [PATCH v3 0/3] " Tyler Retzlaff
2024-02-13 19:12   ` [PATCH v3 1/3] eal: provide type to per lcore macro Tyler Retzlaff
2024-02-13 19:12   ` [PATCH v3 2/3] crypto/ipsec_mb: " Tyler Retzlaff
2024-02-13 19:12   ` [PATCH v3 3/3] eal: remove typeof from per lcore macros Tyler Retzlaff
2024-02-13 19:32     ` Morten Brørup
2024-02-14  8:19   ` [PATCH v3 0/3] remove __typeof__ from expansion of " David Marchand

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