summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2018-11-14 20:40:12 +0100
committerThomas Monjalon <thomas@monjalon.net>2018-11-18 15:30:58 +0100
commitc04e679e860697f4d5f4531c498fe9a773d585fd (patch)
tree6aeaa87d57e2dd37aec17d6ccdf8a33fbb7c04fd /config
parentaba3289e874cd184fc6cc4408236e9680e009a34 (diff)
downloaddpdk-draft-windows-c04e679e860697f4d5f4531c498fe9a773d585fd.zip
dpdk-draft-windows-c04e679e860697f4d5f4531c498fe9a773d585fd.tar.gz
dpdk-draft-windows-c04e679e860697f4d5f4531c498fe9a773d585fd.tar.xz
build: establish an invariant machine type
Add the machine definition 'default' which is special compared to 'native' (most optimized for current system) or any explicit type (external entity has to decide on the type). It defaults to the per arch agreed common minimal baseline needed for DPDK to reasonable work. That might not be the most optimized, but the most portable version while still being able to support the CPU features required for DPDK. Going forward this can be bumped up by the DPDK project, but it can never be an invariant like 'native'. Distributions and other needing portable code are expected to define the machine as 'default'. Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com> Acked-by: Luca Boccassi <bluca@debian.org> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'config')
-rw-r--r--config/meson.build21
1 files changed, 21 insertions, 0 deletions
diff --git a/config/meson.build b/config/meson.build
index 1af305f..db32499 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -7,6 +7,27 @@ if meson.is_cross_build()
else
machine = get_option('machine')
endif
+
+# machine type 'default' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK.
+# That might not be the most optimized, but the most portable version while
+# still being able to support the CPU features required for DPDK.
+# This can be bumped up by the DPDK project, but it can never be an
+# invariant like 'native'
+if machine == 'default'
+ if host_machine.cpu_family().startswith('x86')
+ # matches the old pre-meson build systems default
+ machine = 'corei7'
+ elif host_machine.cpu_family().startswith('arm')
+ machine = 'armv7-a'
+ elif host_machine.cpu_family().startswith('aarch')
+ # arm64 manages defaults in config/arm/meson.build
+ machine = 'default'
+ elif host_machine.cpu_family().startswith('ppc')
+ machine = 'power8'
+ endif
+endif
+
dpdk_conf.set('RTE_MACHINE', machine)
machine_args = []