xref: /dpdk/drivers/net/virtio/meson.build (revision ef7a4025cd714189dc333bb19ea60c2abdeffb7d)
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2018 Intel Corporation
3
4if is_windows
5    build = false
6    reason = 'not supported on Windows'
7    subdir_done()
8endif
9
10if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
11    subdir_done()
12endif
13
14sources += files(
15        'virtio.c',
16        'virtio_cvq.c',
17        'virtio_ethdev.c',
18        'virtio_pci_ethdev.c',
19        'virtio_pci.c',
20        'virtio_rxtx.c',
21        'virtio_rxtx_simple.c',
22        'virtqueue.c',
23)
24deps += ['kvargs', 'bus_pci']
25
26if arch_subdir == 'x86'
27    if cc_has_avx512
28        cflags += ['-DCC_AVX512_SUPPORT']
29        virtio_avx512_lib = static_library('virtio_avx512_lib',
30                'virtio_rxtx_packed.c',
31                dependencies: [static_rte_ethdev,
32                    static_rte_kvargs, static_rte_bus_pci],
33                include_directories: includes,
34                c_args: cflags + cc_avx512_flags)
35        objs += virtio_avx512_lib.extract_objects('virtio_rxtx_packed.c')
36        if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
37            cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
38        elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
39            cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
40        elif (toolchain == 'icc' and cc.version().version_compare('>=16.0.0'))
41            cflags += '-DVIRTIO_ICC_UNROLL_PRAGMA'
42        endif
43    endif
44    sources += files('virtio_rxtx_simple_sse.c')
45elif arch_subdir == 'ppc'
46    sources += files('virtio_rxtx_simple_altivec.c')
47elif arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64')
48    sources += files('virtio_rxtx_packed.c')
49    sources += files('virtio_rxtx_simple_neon.c')
50endif
51
52if is_linux
53    sources += files('virtio_user_ethdev.c',
54        'virtio_user/vhost_kernel.c',
55        'virtio_user/vhost_kernel_tap.c',
56        'virtio_user/vhost_user.c',
57        'virtio_user/vhost_vdpa.c',
58        'virtio_user/virtio_user_dev.c')
59    deps += ['bus_vdev']
60endif
61