eaed46373dca347bbb9dae60edaae3553b63d5dd
[dpdk.git] / drivers / net / virtio / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Intel Corporation
3
4 sources += files('virtio_ethdev.c',
5         'virtio_pci.c',
6         'virtio_rxtx.c',
7         'virtio_rxtx_simple.c',
8         'virtqueue.c')
9 deps += ['kvargs', 'bus_pci']
10
11 if arch_subdir == 'x86'
12         if not machine_args.contains('-mno-avx512f')
13                 if cc.has_argument('-mavx512f') and cc.has_argument('-mavx512vl') and cc.has_argument('-mavx512bw')
14                         cflags += ['-DCC_AVX512_SUPPORT']
15                         virtio_avx512_lib = static_library('virtio_avx512_lib',
16                                               'virtio_rxtx_packed_avx.c',
17                                               dependencies: [static_rte_ethdev,
18                                                 static_rte_kvargs, static_rte_bus_pci],
19                                               include_directories: includes,
20                                               c_args: [cflags, '-mavx512f', '-mavx512bw', '-mavx512vl'])
21                         objs += virtio_avx512_lib.extract_objects('virtio_rxtx_packed_avx.c')
22                         if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
23                                 cflags += '-DVHOST_GCC_UNROLL_PRAGMA'
24                         elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
25                                 cflags += '-DVHOST_CLANG_UNROLL_PRAGMA'
26                         elif (toolchain == 'icc' and cc.version().version_compare('>=16.0.0'))
27                                 cflags += '-DVHOST_ICC_UNROLL_PRAGMA'
28                         endif
29                 endif
30         endif
31         sources += files('virtio_rxtx_simple_sse.c')
32 elif arch_subdir == 'ppc'
33         sources += files('virtio_rxtx_simple_altivec.c')
34 elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64')
35         sources += files('virtio_rxtx_simple_neon.c')
36 endif
37
38 if is_linux
39         dpdk_conf.set('RTE_VIRTIO_USER', 1)
40
41         sources += files('virtio_user_ethdev.c',
42                 'virtio_user/vhost_kernel.c',
43                 'virtio_user/vhost_kernel_tap.c',
44                 'virtio_user/vhost_user.c',
45                 'virtio_user/vhost_vdpa.c',
46                 'virtio_user/virtio_user_dev.c')
47         deps += ['bus_vdev']
48 endif