X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=config%2Fmeson.build;h=db32499b3162d389983206c58f7357f7600077fa;hb=566b4d7a968fa454ff7deab7c43216712878af30;hp=275f00b60df8af3f0e314e4484fd7e287413a119;hpb=57ae0ec6262076788b8b9acd4ed1527c3655f9a9;p=dpdk.git diff --git a/config/meson.build b/config/meson.build index 275f00b60d..db32499b31 100644 --- a/config/meson.build +++ b/config/meson.build @@ -7,10 +7,32 @@ 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 = [] -# ppc64 does not support -march=native -if host_machine.cpu_family().startswith('ppc') and machine == 'native' + +# ppc64 does not support -march= at all, use -mcpu and -mtune for that +if host_machine.cpu_family().startswith('ppc') machine_args += '-mcpu=' + machine machine_args += '-mtune=' + machine else @@ -103,3 +125,6 @@ dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags)) dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path) install_headers('rte_config.h', subdir: get_option('include_subdir_arch')) + +# enable VFIO only if it is linux OS +dpdk_conf.set('RTE_EAL_VFIO', host_machine.system() == 'linux')