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