xref: /dpdk/drivers/net/virtio/meson.build (revision ef7a4025cd714189dc333bb19ea60c2abdeffb7d)
174979948SBruce Richardson# SPDX-License-Identifier: BSD-3-Clause
274979948SBruce Richardson# Copyright(c) 2018 Intel Corporation
374979948SBruce Richardson
4b9d60b54SPallavi Kadamif is_windows
5b9d60b54SPallavi Kadam    build = false
6b9d60b54SPallavi Kadam    reason = 'not supported on Windows'
7b9d60b54SPallavi Kadam    subdir_done()
8b9d60b54SPallavi Kadamendif
9b9d60b54SPallavi Kadam
10069fd120SThomas Monjalonif dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
11069fd120SThomas Monjalon    subdir_done()
12069fd120SThomas Monjalonendif
13069fd120SThomas Monjalon
144ad4b20aSBruce Richardsonsources += files(
154ad4b20aSBruce Richardson        'virtio.c',
1635e7012eSMaxime Coquelin        'virtio_cvq.c',
17b4f9a45aSMaxime Coquelin        'virtio_ethdev.c',
1836a7a2e7SMaxime Coquelin        'virtio_pci_ethdev.c',
1974979948SBruce Richardson        'virtio_pci.c',
2074979948SBruce Richardson        'virtio_rxtx.c',
2174979948SBruce Richardson        'virtio_rxtx_simple.c',
224ad4b20aSBruce Richardson        'virtqueue.c',
234ad4b20aSBruce Richardson)
2474979948SBruce Richardsondeps += ['kvargs', 'bus_pci']
2574979948SBruce Richardson
2674979948SBruce Richardsonif arch_subdir == 'x86'
27*ef7a4025SBruce Richardson    if cc_has_avx512
2877d66da8SMarvin Liu        cflags += ['-DCC_AVX512_SUPPORT']
299036180fSMaxime Coquelin        virtio_avx512_lib = static_library('virtio_avx512_lib',
300eaf7fc2SJoyce Kong                'virtio_rxtx_packed.c',
319036180fSMaxime Coquelin                dependencies: [static_rte_ethdev,
329036180fSMaxime Coquelin                    static_rte_kvargs, static_rte_bus_pci],
339036180fSMaxime Coquelin                include_directories: includes,
34*ef7a4025SBruce Richardson                c_args: cflags + cc_avx512_flags)
350eaf7fc2SJoyce Kong        objs += virtio_avx512_lib.extract_objects('virtio_rxtx_packed.c')
3677d66da8SMarvin Liu        if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
3786ce1441SDavid Marchand            cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
3877d66da8SMarvin Liu        elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
3986ce1441SDavid Marchand            cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
4077d66da8SMarvin Liu        elif (toolchain == 'icc' and cc.version().version_compare('>=16.0.0'))
4186ce1441SDavid Marchand            cflags += '-DVIRTIO_ICC_UNROLL_PRAGMA'
4277d66da8SMarvin Liu        endif
4377d66da8SMarvin Liu    endif
4474979948SBruce Richardson    sources += files('virtio_rxtx_simple_sse.c')
45dd45ed7eSThomas Monjalonelif arch_subdir == 'ppc'
4652b5a707SDavid Christensen    sources += files('virtio_rxtx_simple_altivec.c')
47143b6270SJuraj Linkešelif arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64')
489ef38ddbSJoyce Kong    sources += files('virtio_rxtx_packed.c')
4974979948SBruce Richardson    sources += files('virtio_rxtx_simple_neon.c')
5074979948SBruce Richardsonendif
5174979948SBruce Richardson
52adf93ca5SBruce Richardsonif is_linux
5374979948SBruce Richardson    sources += files('virtio_user_ethdev.c',
5474979948SBruce Richardson        'virtio_user/vhost_kernel.c',
5574979948SBruce Richardson        'virtio_user/vhost_kernel_tap.c',
5674979948SBruce Richardson        'virtio_user/vhost_user.c',
576b901437SMaxime Coquelin        'virtio_user/vhost_vdpa.c',
5874979948SBruce Richardson        'virtio_user/virtio_user_dev.c')
5974979948SBruce Richardson    deps += ['bus_vdev']
6074979948SBruce Richardsonendif
61