xref: /dpdk/drivers/net/ice/meson.build (revision f88b0b89)
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2018 Intel Corporation
3
4subdir('base')
5objs = [base_objs]
6
7sources = files(
8        'ice_acl_filter.c',
9        'ice_ethdev.c',
10        'ice_fdir_filter.c',
11        'ice_generic_flow.c',
12        'ice_hash.c',
13        'ice_rxtx.c',
14        'ice_switch_filter.c',
15)
16
17deps += ['hash', 'net', 'common_iavf']
18includes += include_directories('base', '../../common/iavf')
19
20if 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        cflags += ['-DCC_AVX2_SUPPORT']
32        sources += files('ice_rxtx_vec_avx2.c')
33    elif cc.has_argument('-mavx2')
34        cflags += ['-DCC_AVX2_SUPPORT']
35        ice_avx2_lib = static_library('ice_avx2_lib',
36                'ice_rxtx_vec_avx2.c',
37                dependencies: [static_rte_ethdev, static_rte_kvargs, static_rte_hash],
38                include_directories: includes,
39                c_args: [cflags, '-mavx2'])
40        objs += ice_avx2_lib.extract_objects('ice_rxtx_vec_avx2.c')
41    endif
42
43    ice_avx512_cpu_support = (
44            cc.get_define('__AVX512F__', args: machine_args) != '' and
45                cc.get_define('__AVX512BW__', args: machine_args) != ''
46    )
47
48    ice_avx512_cc_support = (
49            not machine_args.contains('-mno-avx512f') and
50                cc.has_argument('-mavx512f') and
51                cc.has_argument('-mavx512bw')
52    )
53
54    if ice_avx512_cpu_support == true or ice_avx512_cc_support == true
55        cflags += ['-DCC_AVX512_SUPPORT']
56        avx512_args = [cflags, '-mavx512f', '-mavx512bw']
57        if cc.has_argument('-march=skylake-avx512')
58            avx512_args += '-march=skylake-avx512'
59        endif
60        ice_avx512_lib = static_library('ice_avx512_lib',
61                'ice_rxtx_vec_avx512.c',
62                dependencies: [static_rte_ethdev,
63                    static_rte_kvargs, static_rte_hash],
64                include_directories: includes,
65                c_args: avx512_args)
66        objs += ice_avx512_lib.extract_objects('ice_rxtx_vec_avx512.c')
67    endif
68endif
69
70sources += files(
71        'ice_dcf.c',
72        'ice_dcf_vf_representor.c',
73        'ice_dcf_ethdev.c',
74        'ice_dcf_parent.c',
75        'ice_dcf_sched.c',
76)
77
78headers = files('rte_pmd_ice.h')
79