199a2dd95SBruce Richardson# SPDX-License-Identifier: BSD-3-Clause 299a2dd95SBruce Richardson# Copyright(c) 2017-2018 Intel Corporation 399a2dd95SBruce Richardson 499a2dd95SBruce Richardsonif not is_linux 599a2dd95SBruce Richardson build = false 699a2dd95SBruce Richardson reason = 'only supported on Linux' 799a2dd95SBruce Richardsonendif 81776af6fSBruce Richardsonif has_libnuma 999a2dd95SBruce Richardson dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true) 1099a2dd95SBruce Richardsonendif 1199a2dd95SBruce Richardsonif (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0')) 1299a2dd95SBruce Richardson cflags += '-DVHOST_GCC_UNROLL_PRAGMA' 1399a2dd95SBruce Richardsonelif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0')) 1499a2dd95SBruce Richardson cflags += '-DVHOST_CLANG_UNROLL_PRAGMA' 1599a2dd95SBruce Richardsonelif (toolchain == 'icc' and cc.version().version_compare('>=16.0.0')) 1699a2dd95SBruce Richardson cflags += '-DVHOST_ICC_UNROLL_PRAGMA' 1799a2dd95SBruce Richardsonendif 1899a2dd95SBruce Richardsondpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', cc.has_header('linux/userfaultfd.h')) 1963c9142bSBruce Richardsoncflags += [ 2063c9142bSBruce Richardson '-fno-strict-aliasing', 2163c9142bSBruce Richardson '-Wno-address-of-packed-member', 2263c9142bSBruce Richardson] 23183bdfe2SDavid Marchand 2499a2dd95SBruce Richardsonsources = files( 2599a2dd95SBruce Richardson 'fd_man.c', 2699a2dd95SBruce Richardson 'iotlb.c', 2799a2dd95SBruce Richardson 'socket.c', 2899a2dd95SBruce Richardson 'vdpa.c', 2999a2dd95SBruce Richardson 'vhost.c', 3099a2dd95SBruce Richardson 'vhost_crypto.c', 3199a2dd95SBruce Richardson 'vhost_user.c', 3299a2dd95SBruce Richardson 'virtio_net.c', 33474f4d78SMaxime Coquelin 'virtio_net_ctrl.c', 3499a2dd95SBruce Richardson) 35*4025e36fSStephen Hemmingerif cc.has_header('linux/vduse.h') 36*4025e36fSStephen Hemminger sources += files('vduse.c') 37*4025e36fSStephen Hemminger cflags += '-DVHOST_HAS_VDUSE' 38*4025e36fSStephen Hemmingerendif 3999a2dd95SBruce Richardsonheaders = files( 4099a2dd95SBruce Richardson 'rte_vdpa.h', 4199a2dd95SBruce Richardson 'rte_vhost.h', 4299a2dd95SBruce Richardson 'rte_vhost_async.h', 4399a2dd95SBruce Richardson 'rte_vhost_crypto.h', 4499a2dd95SBruce Richardson) 4594c16e89SMaxime Coquelindriver_sdk_headers = files( 4694c16e89SMaxime Coquelin 'vdpa_driver.h', 4794c16e89SMaxime Coquelin) 4853d3f477SJiayu Hudeps += ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev'] 49