DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] member: use common top-level variable for easier maintenance
@ 2025-02-28 19:01 Andre Muezerie
  2025-03-03 15:21 ` Bruce Richardson
  2025-03-03 20:47 ` [PATCH v2] " Andre Muezerie
  0 siblings, 2 replies; 5+ messages in thread
From: Andre Muezerie @ 2025-02-28 19:01 UTC (permalink / raw)
  To: Yipeng Wang, Sameh Gobriel; +Cc: dev, Andre Muezerie

Updated meson.build to use common variable cc_avx512_flags for
msvc and avoiding code duplication for other compilers.

Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
 lib/member/meson.build | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/member/meson.build b/lib/member/meson.build
index f92cbb7f25..8416dc6f8a 100644
--- a/lib/member/meson.build
+++ b/lib/member/meson.build
@@ -33,6 +33,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
     # compiler flags, and then have the .o file from static lib
     # linked into main lib.
 
+    if is_ms_compiler
+        member_avx512_args = cc_avx512_flags
+    else
+        member_avx512_args = ['-mavx512f', '-mavx512dq', '-mavx512ifma']
+    endif
+
     # check if all required flags already enabled
     sketch_avx512_flags = ['__AVX512F__', '__AVX512DQ__', '__AVX512IFMA__']
 
@@ -46,13 +52,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
     if sketch_avx512_on == true
         cflags += ['-DCC_AVX512_SUPPORT']
         sources += files('rte_member_sketch_avx512.c')
-    elif cc.has_multi_arguments('-mavx512f', '-mavx512dq', '-mavx512ifma')
+    elif cc.has_multi_arguments(member_avx512_args)
         sketch_avx512_tmp = static_library('sketch_avx512_tmp',
             'rte_member_sketch_avx512.c',
             include_directories: includes,
             dependencies: [static_rte_eal, static_rte_hash],
-            c_args: cflags +
-                ['-mavx512f', '-mavx512dq', '-mavx512ifma'])
+            c_args: cflags + member_avx512_args)
         objs += sketch_avx512_tmp.extract_objects('rte_member_sketch_avx512.c')
         cflags += ['-DCC_AVX512_SUPPORT']
     endif
-- 
2.48.1.vfs.0.0


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

* Re: [PATCH] member: use common top-level variable for easier maintenance
  2025-02-28 19:01 [PATCH] member: use common top-level variable for easier maintenance Andre Muezerie
@ 2025-03-03 15:21 ` Bruce Richardson
  2025-03-03 20:49   ` Andre Muezerie
  2025-03-03 20:47 ` [PATCH v2] " Andre Muezerie
  1 sibling, 1 reply; 5+ messages in thread
From: Bruce Richardson @ 2025-03-03 15:21 UTC (permalink / raw)
  To: Andre Muezerie; +Cc: Yipeng Wang, Sameh Gobriel, dev

On Fri, Feb 28, 2025 at 11:01:01AM -0800, Andre Muezerie wrote:
> Updated meson.build to use common variable cc_avx512_flags for
> msvc and avoiding code duplication for other compilers.
> 
> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> ---
>  lib/member/meson.build | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/member/meson.build b/lib/member/meson.build
> index f92cbb7f25..8416dc6f8a 100644
> --- a/lib/member/meson.build
> +++ b/lib/member/meson.build
> @@ -33,6 +33,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
>      # compiler flags, and then have the .o file from static lib
>      # linked into main lib.
>  
> +    if is_ms_compiler
> +        member_avx512_args = cc_avx512_flags
> +    else
> +        member_avx512_args = ['-mavx512f', '-mavx512dq', '-mavx512ifma']
> +    endif
> +

Would this be better as:

member_avx512_args = cc_avx512_flags
if not is_ms_compiler
	member_avx512_args += '-mavx512ifma'
endif

WDYT?

>      # check if all required flags already enabled
>      sketch_avx512_flags = ['__AVX512F__', '__AVX512DQ__', '__AVX512IFMA__']
>  
> @@ -46,13 +52,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
>      if sketch_avx512_on == true
>          cflags += ['-DCC_AVX512_SUPPORT']
>          sources += files('rte_member_sketch_avx512.c')
> -    elif cc.has_multi_arguments('-mavx512f', '-mavx512dq', '-mavx512ifma')
> +    elif cc.has_multi_arguments(member_avx512_args)
>          sketch_avx512_tmp = static_library('sketch_avx512_tmp',
>              'rte_member_sketch_avx512.c',
>              include_directories: includes,
>              dependencies: [static_rte_eal, static_rte_hash],
> -            c_args: cflags +
> -                ['-mavx512f', '-mavx512dq', '-mavx512ifma'])
> +            c_args: cflags + member_avx512_args)
>          objs += sketch_avx512_tmp.extract_objects('rte_member_sketch_avx512.c')
>          cflags += ['-DCC_AVX512_SUPPORT']
>      endif
> -- 
> 2.48.1.vfs.0.0
> 

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

* [PATCH v2] member: use common top-level variable for easier maintenance
  2025-02-28 19:01 [PATCH] member: use common top-level variable for easier maintenance Andre Muezerie
  2025-03-03 15:21 ` Bruce Richardson
@ 2025-03-03 20:47 ` Andre Muezerie
  2025-03-04 10:49   ` Bruce Richardson
  1 sibling, 1 reply; 5+ messages in thread
From: Andre Muezerie @ 2025-03-03 20:47 UTC (permalink / raw)
  To: andremue; +Cc: dev, sameh.gobriel, yipeng1.wang

Updated meson.build to use common variable cc_avx512_flags for
msvc and avoiding code duplication for other compilers.

Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
 lib/member/meson.build | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/member/meson.build b/lib/member/meson.build
index f92cbb7f25..4341b424df 100644
--- a/lib/member/meson.build
+++ b/lib/member/meson.build
@@ -33,6 +33,11 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
     # compiler flags, and then have the .o file from static lib
     # linked into main lib.
 
+    member_avx512_args = cc_avx512_flags
+    if not is_ms_compiler
+            member_avx512_args += '-mavx512ifma'
+    endif
+
     # check if all required flags already enabled
     sketch_avx512_flags = ['__AVX512F__', '__AVX512DQ__', '__AVX512IFMA__']
 
@@ -46,13 +51,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
     if sketch_avx512_on == true
         cflags += ['-DCC_AVX512_SUPPORT']
         sources += files('rte_member_sketch_avx512.c')
-    elif cc.has_multi_arguments('-mavx512f', '-mavx512dq', '-mavx512ifma')
+    elif cc.has_multi_arguments(member_avx512_args)
         sketch_avx512_tmp = static_library('sketch_avx512_tmp',
             'rte_member_sketch_avx512.c',
             include_directories: includes,
             dependencies: [static_rte_eal, static_rte_hash],
-            c_args: cflags +
-                ['-mavx512f', '-mavx512dq', '-mavx512ifma'])
+            c_args: cflags + member_avx512_args)
         objs += sketch_avx512_tmp.extract_objects('rte_member_sketch_avx512.c')
         cflags += ['-DCC_AVX512_SUPPORT']
     endif
-- 
2.48.1.vfs.0.0


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

* Re: [PATCH] member: use common top-level variable for easier maintenance
  2025-03-03 15:21 ` Bruce Richardson
@ 2025-03-03 20:49   ` Andre Muezerie
  0 siblings, 0 replies; 5+ messages in thread
From: Andre Muezerie @ 2025-03-03 20:49 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Yipeng Wang, Sameh Gobriel, dev

On Mon, Mar 03, 2025 at 03:21:40PM +0000, Bruce Richardson wrote:
> On Fri, Feb 28, 2025 at 11:01:01AM -0800, Andre Muezerie wrote:
> > Updated meson.build to use common variable cc_avx512_flags for
> > msvc and avoiding code duplication for other compilers.
> > 
> > Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> > ---
> >  lib/member/meson.build | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> > 
> > diff --git a/lib/member/meson.build b/lib/member/meson.build
> > index f92cbb7f25..8416dc6f8a 100644
> > --- a/lib/member/meson.build
> > +++ b/lib/member/meson.build
> > @@ -33,6 +33,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
> >      # compiler flags, and then have the .o file from static lib
> >      # linked into main lib.
> >  
> > +    if is_ms_compiler
> > +        member_avx512_args = cc_avx512_flags
> > +    else
> > +        member_avx512_args = ['-mavx512f', '-mavx512dq', '-mavx512ifma']
> > +    endif
> > +
> 
> Would this be better as:
> 
> member_avx512_args = cc_avx512_flags
> if not is_ms_compiler
> 	member_avx512_args += '-mavx512ifma'
> endif
> 
> WDYT?

That is slightly simpler. I updated the patch accordingly.

> 
> >      # check if all required flags already enabled
> >      sketch_avx512_flags = ['__AVX512F__', '__AVX512DQ__', '__AVX512IFMA__']
> >  
> > @@ -46,13 +52,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
> >      if sketch_avx512_on == true
> >          cflags += ['-DCC_AVX512_SUPPORT']
> >          sources += files('rte_member_sketch_avx512.c')
> > -    elif cc.has_multi_arguments('-mavx512f', '-mavx512dq', '-mavx512ifma')
> > +    elif cc.has_multi_arguments(member_avx512_args)
> >          sketch_avx512_tmp = static_library('sketch_avx512_tmp',
> >              'rte_member_sketch_avx512.c',
> >              include_directories: includes,
> >              dependencies: [static_rte_eal, static_rte_hash],
> > -            c_args: cflags +
> > -                ['-mavx512f', '-mavx512dq', '-mavx512ifma'])
> > +            c_args: cflags + member_avx512_args)
> >          objs += sketch_avx512_tmp.extract_objects('rte_member_sketch_avx512.c')
> >          cflags += ['-DCC_AVX512_SUPPORT']
> >      endif
> > -- 
> > 2.48.1.vfs.0.0
> > 

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

* Re: [PATCH v2] member: use common top-level variable for easier maintenance
  2025-03-03 20:47 ` [PATCH v2] " Andre Muezerie
@ 2025-03-04 10:49   ` Bruce Richardson
  0 siblings, 0 replies; 5+ messages in thread
From: Bruce Richardson @ 2025-03-04 10:49 UTC (permalink / raw)
  To: Andre Muezerie; +Cc: dev, sameh.gobriel, yipeng1.wang

On Mon, Mar 03, 2025 at 12:47:54PM -0800, Andre Muezerie wrote:
> Updated meson.build to use common variable cc_avx512_flags for
> msvc and avoiding code duplication for other compilers.
> 
> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

end of thread, other threads:[~2025-03-04 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-28 19:01 [PATCH] member: use common top-level variable for easier maintenance Andre Muezerie
2025-03-03 15:21 ` Bruce Richardson
2025-03-03 20:49   ` Andre Muezerie
2025-03-03 20:47 ` [PATCH v2] " Andre Muezerie
2025-03-04 10:49   ` Bruce Richardson

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