DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] ethdev: add extension keyword to statement expression macro
@ 2023-11-09 20:13 Tyler Retzlaff
  2023-11-10 17:22 ` Ferruh Yigit
  0 siblings, 1 reply; 8+ messages in thread
From: Tyler Retzlaff @ 2023-11-09 20:13 UTC (permalink / raw)
  To: dev
  Cc: Andrew Rybchenko, Cristian Dumitrescu, Ferruh Yigit,
	Thomas Monjalon, Tyler Retzlaff

add missing __extension__ keyword to macros using gcc statement
expression extension.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/ethdev/rte_mtr.c | 10 +++++-----
 lib/ethdev/rte_tm.c  |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/ethdev/rte_mtr.c b/lib/ethdev/rte_mtr.c
index 4e94af9..900837b 100644
--- a/lib/ethdev/rte_mtr.c
+++ b/lib/ethdev/rte_mtr.c
@@ -41,14 +41,14 @@
 }
 
 #define RTE_MTR_FUNC(port_id, func)			\
-({							\
+__extension__ ({					\
 	const struct rte_mtr_ops *ops =			\
-		rte_mtr_ops_get(port_id, error);		\
-	if (ops == NULL)					\
+		rte_mtr_ops_get(port_id, error);	\
+	if (ops == NULL)				\
 		return -rte_errno;			\
 							\
 	if (ops->func == NULL)				\
-		return -rte_mtr_error_set(error,		\
+		return -rte_mtr_error_set(error,	\
 			ENOSYS,				\
 			RTE_MTR_ERROR_TYPE_UNSPECIFIED,	\
 			NULL,				\
@@ -58,7 +58,7 @@
 })
 
 #define RTE_MTR_HNDL_FUNC(port_id, func)		\
-({							\
+__extension__ ({					\
 	const struct rte_mtr_ops *ops =			\
 		rte_mtr_ops_get(port_id, error);	\
 	if (ops == NULL)				\
diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c
index 2d08141..d594fe0 100644
--- a/lib/ethdev/rte_tm.c
+++ b/lib/ethdev/rte_tm.c
@@ -40,11 +40,11 @@
 	return ops;
 }
 
-#define RTE_TM_FUNC(port_id, func)				\
-({							\
+#define RTE_TM_FUNC(port_id, func)			\
+__extension__ ({					\
 	const struct rte_tm_ops *ops =			\
 		rte_tm_ops_get(port_id, error);		\
-	if (ops == NULL)					\
+	if (ops == NULL)				\
 		return -rte_errno;			\
 							\
 	if (ops->func == NULL)				\
-- 
1.8.3.1


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

* Re: [PATCH] ethdev: add extension keyword to statement expression macro
  2023-11-09 20:13 [PATCH] ethdev: add extension keyword to statement expression macro Tyler Retzlaff
@ 2023-11-10 17:22 ` Ferruh Yigit
  2023-11-10 20:32   ` Ferruh Yigit
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ferruh Yigit @ 2023-11-10 17:22 UTC (permalink / raw)
  To: Tyler Retzlaff, dev
  Cc: Andrew Rybchenko, Cristian Dumitrescu, Thomas Monjalon

On 11/9/2023 8:13 PM, Tyler Retzlaff wrote:
> add missing __extension__ keyword to macros using gcc statement
> expression extension.
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> 

Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>


It seems there are a few more usage not marked in lib folder [1], and
more including drivers.

Is this compiler extension causing any problem for the Windows build or
MSVC toolchain?



[1]
$ grep -r '({' lib/ | grep -v __extension__
lib/port/rte_port_source_sink.c:({
lib/port/rte_port_source_sink.c:({
lib/pipeline/rte_swx_pipeline_internal.h:({
lib/pipeline/rte_pipeline.c:    ({ (p)->n_pkts_ah_drop =
lib/pipeline/rte_pipeline.c:    ({ (counter) += (p)->n_pkts_ah_drop;
lib/pipeline/rte_pipeline.c:    ({ (p)->pkts_drop_mask =
lib/pipeline/rte_pipeline.c:({
lib/ethdev/rte_mtr.c:({
lib/ethdev/rte_mtr.c:({
lib/ethdev/rte_tm.c:({

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

* Re: [PATCH] ethdev: add extension keyword to statement expression macro
  2023-11-10 17:22 ` Ferruh Yigit
@ 2023-11-10 20:32   ` Ferruh Yigit
  2023-11-10 20:49   ` Tyler Retzlaff
  2023-11-11 10:11   ` Thomas Monjalon
  2 siblings, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2023-11-10 20:32 UTC (permalink / raw)
  To: Tyler Retzlaff, dev
  Cc: Andrew Rybchenko, Cristian Dumitrescu, Thomas Monjalon

On 11/10/2023 5:22 PM, Ferruh Yigit wrote:
> On 11/9/2023 8:13 PM, Tyler Retzlaff wrote:
>> add missing __extension__ keyword to macros using gcc statement
>> expression extension.
>>
>> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
>>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
> 

Applied to dpdk-next-net/main, thanks.


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

* Re: [PATCH] ethdev: add extension keyword to statement expression macro
  2023-11-10 17:22 ` Ferruh Yigit
  2023-11-10 20:32   ` Ferruh Yigit
@ 2023-11-10 20:49   ` Tyler Retzlaff
  2023-11-10 23:25     ` Ferruh Yigit
  2023-11-11 10:11   ` Thomas Monjalon
  2 siblings, 1 reply; 8+ messages in thread
From: Tyler Retzlaff @ 2023-11-10 20:49 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Andrew Rybchenko, Cristian Dumitrescu, Thomas Monjalon

On Fri, Nov 10, 2023 at 05:22:52PM +0000, Ferruh Yigit wrote:
> On 11/9/2023 8:13 PM, Tyler Retzlaff wrote:
> > add missing __extension__ keyword to macros using gcc statement
> > expression extension.
> > 
> > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> > 
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
> 
> 
> It seems there are a few more usage not marked in lib folder [1], and
> more including drivers.

yeah, sorry i'm not doing them all at once. though given the number of
instances left i'll see if i can find a few minutes maybe just clear
lib/* entirely drivers like for everything else are lower priority for
me right now (always open to help of course).

> 
> Is this compiler extension causing any problem for the Windows build or
> MSVC toolchain?

just the msvc toolchain, builds with gcc/clang targeting windows work fine.

i'm working internally with the msvc toolchain team to enable support
for the extension on the condition that it be marked with the
__extension__ keyword so i'm just making sure it is applied
consistently.

> 
> 
> 
> [1]
> $ grep -r '({' lib/ | grep -v __extension__
> lib/port/rte_port_source_sink.c:({
> lib/port/rte_port_source_sink.c:({
> lib/pipeline/rte_swx_pipeline_internal.h:({
> lib/pipeline/rte_pipeline.c:    ({ (p)->n_pkts_ah_drop =
> lib/pipeline/rte_pipeline.c:    ({ (counter) += (p)->n_pkts_ah_drop;
> lib/pipeline/rte_pipeline.c:    ({ (p)->pkts_drop_mask =
> lib/pipeline/rte_pipeline.c:({
> lib/ethdev/rte_mtr.c:({
> lib/ethdev/rte_mtr.c:({
> lib/ethdev/rte_tm.c:({

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

* Re: [PATCH] ethdev: add extension keyword to statement expression macro
  2023-11-10 20:49   ` Tyler Retzlaff
@ 2023-11-10 23:25     ` Ferruh Yigit
  2023-11-11 10:26       ` Thomas Monjalon
  0 siblings, 1 reply; 8+ messages in thread
From: Ferruh Yigit @ 2023-11-10 23:25 UTC (permalink / raw)
  To: Tyler Retzlaff
  Cc: dev, Andrew Rybchenko, Cristian Dumitrescu, Thomas Monjalon

On 11/10/2023 8:49 PM, Tyler Retzlaff wrote:
> On Fri, Nov 10, 2023 at 05:22:52PM +0000, Ferruh Yigit wrote:
>> On 11/9/2023 8:13 PM, Tyler Retzlaff wrote:
>>> add missing __extension__ keyword to macros using gcc statement
>>> expression extension.
>>>
>>> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
>>>
>>
>> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
>>
>>
>> It seems there are a few more usage not marked in lib folder [1], and
>> more including drivers.
> 
> yeah, sorry i'm not doing them all at once. though given the number of
> instances left i'll see if i can find a few minutes maybe just clear
> lib/* entirely drivers like for everything else are lower priority for
> me right now (always open to help of course).
> 

that is OK, I just want to remind

>>
>> Is this compiler extension causing any problem for the Windows build or
>> MSVC toolchain?
> 
> just the msvc toolchain, builds with gcc/clang targeting windows work fine.
> 
> i'm working internally with the msvc toolchain team to enable support
> for the extension on the condition that it be marked with the
> __extension__ keyword so i'm just making sure it is applied
> consistently.
> 

Nice, if just marking extensions is sufficient, that is easy to do.

>>
>>
>>
>> [1]
>> $ grep -r '({' lib/ | grep -v __extension__
>> lib/port/rte_port_source_sink.c:({
>> lib/port/rte_port_source_sink.c:({
>> lib/pipeline/rte_swx_pipeline_internal.h:({
>> lib/pipeline/rte_pipeline.c:    ({ (p)->n_pkts_ah_drop =
>> lib/pipeline/rte_pipeline.c:    ({ (counter) += (p)->n_pkts_ah_drop;
>> lib/pipeline/rte_pipeline.c:    ({ (p)->pkts_drop_mask =
>> lib/pipeline/rte_pipeline.c:({
>> lib/ethdev/rte_mtr.c:({
>> lib/ethdev/rte_mtr.c:({
>> lib/ethdev/rte_tm.c:({


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

* Re: [PATCH] ethdev: add extension keyword to statement expression macro
  2023-11-10 17:22 ` Ferruh Yigit
  2023-11-10 20:32   ` Ferruh Yigit
  2023-11-10 20:49   ` Tyler Retzlaff
@ 2023-11-11 10:11   ` Thomas Monjalon
  2 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2023-11-11 10:11 UTC (permalink / raw)
  To: Tyler Retzlaff, Ferruh Yigit; +Cc: dev, Andrew Rybchenko, Cristian Dumitrescu

10/11/2023 18:22, Ferruh Yigit:
> On 11/9/2023 8:13 PM, Tyler Retzlaff wrote:
> > add missing __extension__ keyword to macros using gcc statement
> > expression extension.
> > 
> > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> > 
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
> 
> 
> It seems there are a few more usage not marked in lib folder [1], and
> more including drivers.

Please let's mark all at once.

> Is this compiler extension causing any problem for the Windows build or
> MSVC toolchain?

I have the same question: is __extension__ supported in MSVC?

> [1]
> $ grep -r '({' lib/ | grep -v __extension__
> lib/port/rte_port_source_sink.c:({
> lib/port/rte_port_source_sink.c:({
> lib/pipeline/rte_swx_pipeline_internal.h:({
> lib/pipeline/rte_pipeline.c:    ({ (p)->n_pkts_ah_drop =
> lib/pipeline/rte_pipeline.c:    ({ (counter) += (p)->n_pkts_ah_drop;
> lib/pipeline/rte_pipeline.c:    ({ (p)->pkts_drop_mask =
> lib/pipeline/rte_pipeline.c:({
> lib/ethdev/rte_mtr.c:({
> lib/ethdev/rte_mtr.c:({
> lib/ethdev/rte_tm.c:({




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

* Re: [PATCH] ethdev: add extension keyword to statement expression macro
  2023-11-10 23:25     ` Ferruh Yigit
@ 2023-11-11 10:26       ` Thomas Monjalon
  2023-11-14 14:49         ` Ferruh Yigit
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2023-11-11 10:26 UTC (permalink / raw)
  To: Tyler Retzlaff, Ferruh Yigit; +Cc: dev, Andrew Rybchenko, Cristian Dumitrescu

11/11/2023 00:25, Ferruh Yigit:
> On 11/10/2023 8:49 PM, Tyler Retzlaff wrote:
> > On Fri, Nov 10, 2023 at 05:22:52PM +0000, Ferruh Yigit wrote:
> >> On 11/9/2023 8:13 PM, Tyler Retzlaff wrote:
> >>> add missing __extension__ keyword to macros using gcc statement
> >>> expression extension.
> >>>
> >>> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> >>>
> >>
> >> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
> >>
> >>
> >> It seems there are a few more usage not marked in lib folder [1], and
> >> more including drivers.
> > 
> > yeah, sorry i'm not doing them all at once. though given the number of
> > instances left i'll see if i can find a few minutes maybe just clear
> > lib/* entirely drivers like for everything else are lower priority for
> > me right now (always open to help of course).
> > 
> 
> that is OK, I just want to remind

A commit on all libs would have more sense.
Here it is not even all ethdev.
I would not apply half a patch.



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

* Re: [PATCH] ethdev: add extension keyword to statement expression macro
  2023-11-11 10:26       ` Thomas Monjalon
@ 2023-11-14 14:49         ` Ferruh Yigit
  0 siblings, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2023-11-14 14:49 UTC (permalink / raw)
  To: Thomas Monjalon, Tyler Retzlaff
  Cc: dev, Andrew Rybchenko, Cristian Dumitrescu

On 11/11/2023 10:26 AM, Thomas Monjalon wrote:
> 11/11/2023 00:25, Ferruh Yigit:
>> On 11/10/2023 8:49 PM, Tyler Retzlaff wrote:
>>> On Fri, Nov 10, 2023 at 05:22:52PM +0000, Ferruh Yigit wrote:
>>>> On 11/9/2023 8:13 PM, Tyler Retzlaff wrote:
>>>>> add missing __extension__ keyword to macros using gcc statement
>>>>> expression extension.
>>>>>
>>>>> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
>>>>>
>>>>
>>>> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
>>>>
>>>>
>>>> It seems there are a few more usage not marked in lib folder [1], and
>>>> more including drivers.
>>>
>>> yeah, sorry i'm not doing them all at once. though given the number of
>>> instances left i'll see if i can find a few minutes maybe just clear
>>> lib/* entirely drivers like for everything else are lower priority for
>>> me right now (always open to help of course).
>>>
>>
>> that is OK, I just want to remind
> 
> A commit on all libs would have more sense.
> Here it is not even all ethdev.
> I would not apply half a patch.
> 
> 

Dropping patch from next-net, for the sake of more complete patch.

Patchwork status is now "change requested".

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

end of thread, other threads:[~2023-11-14 14:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-09 20:13 [PATCH] ethdev: add extension keyword to statement expression macro Tyler Retzlaff
2023-11-10 17:22 ` Ferruh Yigit
2023-11-10 20:32   ` Ferruh Yigit
2023-11-10 20:49   ` Tyler Retzlaff
2023-11-10 23:25     ` Ferruh Yigit
2023-11-11 10:26       ` Thomas Monjalon
2023-11-14 14:49         ` Ferruh Yigit
2023-11-11 10:11   ` Thomas Monjalon

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