44ef64b4cf789b81a6866b388a97b2589f175178
[dpdk.git] / drivers / net / ice / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Intel Corporation
3
4 subdir('base')
5 objs = [base_objs]
6
7 sources = files(
8         'ice_ethdev.c',
9         'ice_rxtx.c',
10         'ice_switch_filter.c',
11         'ice_generic_flow.c',
12         'ice_fdir_filter.c',
13         'ice_hash.c',
14         'ice_acl_filter.c'
15         )
16
17 deps += ['hash', 'net', 'common_iavf']
18 includes += include_directories('base', '../../common/iavf')
19
20 if arch_subdir == 'x86'
21         sources += files('ice_rxtx_vec_sse.c')
22
23         if is_windows and cc.get_id() != 'clang'
24                 cflags += ['-fno-asynchronous-unwind-tables']
25         endif
26
27         # compile AVX2 version if either:
28         # a. we have AVX supported in minimum instruction set baseline
29         # b. it's not minimum instruction set, but supported by compiler
30         if cc.get_define('__AVX2__', args: machine_args) != ''
31                 sources += files('ice_rxtx_vec_avx2.c')
32         elif cc.has_argument('-mavx2')
33                 ice_avx2_lib = static_library('ice_avx2_lib',
34                                 'ice_rxtx_vec_avx2.c',
35                                 dependencies: [static_rte_ethdev,
36                                         static_rte_kvargs, static_rte_hash],
37                                 include_directories: includes,
38                                 c_args: [cflags, '-mavx2'])
39                 objs += ice_avx2_lib.extract_objects('ice_rxtx_vec_avx2.c')
40         endif
41
42         ice_avx512_cpu_support = (
43                 cc.get_define('__AVX512F__', args: machine_args) != '' and
44                 cc.get_define('__AVX512BW__', args: machine_args) != '')
45
46         ice_avx512_cc_support = (
47                 not machine_args.contains('-mno-avx512f') and
48                 cc.has_argument('-mavx512f') and
49                 cc.has_argument('-mavx512bw'))
50
51         if ice_avx512_cpu_support == true or ice_avx512_cc_support == true
52                 cflags += ['-DCC_AVX512_SUPPORT']
53                 avx512_args = [cflags, '-mavx512f', '-mavx512bw']
54                 if cc.has_argument('-march=skylake-avx512')
55                         avx512_args += '-march=skylake-avx512'
56                 endif
57                 ice_avx512_lib = static_library('ice_avx512_lib',
58                                 'ice_rxtx_vec_avx512.c',
59                                 dependencies: [static_rte_ethdev,
60                                         static_rte_kvargs, static_rte_hash],
61                                 include_directories: includes,
62                                 c_args: avx512_args)
63                 objs += ice_avx512_lib.extract_objects('ice_rxtx_vec_avx512.c')
64         endif
65 endif
66
67 sources += files('ice_dcf.c',
68                  'ice_dcf_vf_representor.c',
69                  'ice_dcf_ethdev.c',
70                  'ice_dcf_parent.c')
71
72 headers = files('rte_pmd_ice.h')