From: Andre Muezerie <andremue@linux.microsoft.com>
To: Bruce Richardson <bruce.richardson@intel.com>,
Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Cc: dev@dpdk.org, Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH] config: move existing code that is common to the top
Date: Fri, 28 Feb 2025 07:52:20 -0800 [thread overview]
Message-ID: <1740757940-10253-1-git-send-email-andremue@linux.microsoft.com> (raw)
In preparation to add better MSVC support, existing common code was
moved up.
A split was added which in future will call an MSVC specific meson.build
file:
if is_ms_compiler
subdir_done()
endif
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
config/x86/meson.build | 91 ++++++++++++++++++++++--------------------
1 file changed, 48 insertions(+), 43 deletions(-)
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 47a5b0c04a..68fcdc4993 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -1,6 +1,52 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017-2020 Intel Corporation
+cc_has_avx512 = false
+target_has_avx512 = false
+
+dpdk_conf.set('RTE_ARCH_X86', 1)
+if dpdk_conf.get('RTE_ARCH_64')
+ dpdk_conf.set('RTE_ARCH_X86_64', 1)
+ dpdk_conf.set('RTE_ARCH', 'x86_64')
+else
+ dpdk_conf.set('RTE_ARCH_I686', 1)
+ dpdk_conf.set('RTE_ARCH', 'i686')
+endif
+
+dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
+dpdk_conf.set('RTE_MAX_LCORE', 128)
+
+epyc_zen_cores = {
+ '__znver5__':768,
+ '__znver4__':512,
+ '__znver3__':256,
+ '__znver2__':256,
+ '__znver1__':128
+ }
+
+cpu_instruction_set = get_option('cpu_instruction_set')
+if cpu_instruction_set == 'native'
+ foreach m:epyc_zen_cores.keys()
+ if cc.get_define(m, args: machine_args) != ''
+ dpdk_conf.set('RTE_MAX_LCORE', epyc_zen_cores[m])
+ break
+ endif
+ endforeach
+else
+ foreach m:epyc_zen_cores.keys()
+ if m.contains(cpu_instruction_set)
+ dpdk_conf.set('RTE_MAX_LCORE', epyc_zen_cores[m])
+ break
+ endif
+ endforeach
+endif
+
+dpdk_conf.set('RTE_MAX_NUMA_NODES', 32)
+
+if is_ms_compiler
+ subdir_done()
+endif
+
# get binutils version for the workaround of Bug 97
binutils_ok = true
if is_linux or cc.get_id() == 'gcc'
@@ -14,9 +60,8 @@ if is_linux or cc.get_id() == 'gcc'
endif
endif
-cc_avx512_flags = ['-mavx512f', '-mavx512vl', '-mavx512dq', '-mavx512bw']
-cc_has_avx512 = false
-target_has_avx512 = false
+cc_avx2_flags = ['-mavx2']
+cc_avx512_flags = ['-mavx512f', '-mavx512vl', '-mavx512dq', '-mavx512bw', '-mavx512cd']
if (binutils_ok and cc.has_multi_arguments(cc_avx512_flags)
and '-mno-avx512f' not in get_option('c_args'))
# check if compiler is working with _mm512_extracti64x4_epi64
@@ -82,43 +127,3 @@ foreach f:optional_flags
compile_time_cpuflags += ['RTE_CPUFLAG_' + f]
endif
endforeach
-
-
-dpdk_conf.set('RTE_ARCH_X86', 1)
-if dpdk_conf.get('RTE_ARCH_64')
- dpdk_conf.set('RTE_ARCH_X86_64', 1)
- dpdk_conf.set('RTE_ARCH', 'x86_64')
-else
- dpdk_conf.set('RTE_ARCH_I686', 1)
- dpdk_conf.set('RTE_ARCH', 'i686')
-endif
-
-dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
-dpdk_conf.set('RTE_MAX_LCORE', 128)
-
-epyc_zen_cores = {
- '__znver5__':768,
- '__znver4__':512,
- '__znver3__':256,
- '__znver2__':256,
- '__znver1__':128
- }
-
-cpu_instruction_set = get_option('cpu_instruction_set')
-if cpu_instruction_set == 'native'
- foreach m:epyc_zen_cores.keys()
- if cc.get_define(m, args: machine_args) != ''
- dpdk_conf.set('RTE_MAX_LCORE', epyc_zen_cores[m])
- break
- endif
- endforeach
-else
- foreach m:epyc_zen_cores.keys()
- if m.contains(cpu_instruction_set)
- dpdk_conf.set('RTE_MAX_LCORE', epyc_zen_cores[m])
- break
- endif
- endforeach
-endif
-
-dpdk_conf.set('RTE_MAX_NUMA_NODES', 32)
--
2.48.1.vfs.0.0
next reply other threads:[~2025-02-28 15:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 15:52 Andre Muezerie [this message]
2025-02-28 22:03 ` [PATCH v2 0/1] " Andre Muezerie
2025-02-28 22:03 ` [PATCH v2 1/1] config: " Andre Muezerie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1740757940-10253-1-git-send-email-andremue@linux.microsoft.com \
--to=andremue@linux.microsoft.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.v.ananyev@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).