dpdk/drivers/net/hns3/meson.build
<<
>>
Prefs
   1# SPDX-License-Identifier: BSD-3-Clause
   2# Copyright(c) 2018-2021 Hisilicon Limited
   3
   4if not is_linux
   5    build = false
   6    reason = 'only supported on Linux'
   7    subdir_done()
   8endif
   9
  10if arch_subdir != 'x86' and arch_subdir != 'arm' or not dpdk_conf.get('RTE_ARCH_64')
  11    build = false
  12    reason = 'only supported on x86_64 and aarch64'
  13    subdir_done()
  14endif
  15
  16sources = files(
  17        'hns3_cmd.c',
  18        'hns3_dcb.c',
  19        'hns3_intr.c',
  20        'hns3_ethdev.c',
  21        'hns3_ethdev_vf.c',
  22        'hns3_fdir.c',
  23        'hns3_flow.c',
  24        'hns3_mbx.c',
  25        'hns3_regs.c',
  26        'hns3_rss.c',
  27        'hns3_rxtx.c',
  28        'hns3_stats.c',
  29        'hns3_mp.c',
  30        'hns3_tm.c',
  31        'hns3_ptp.c',
  32)
  33
  34deps += ['hash']
  35
  36if arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64')
  37    sources += files('hns3_rxtx_vec.c')
  38
  39    # compile SVE when:
  40    # a. support SVE in minimum instruction set baseline
  41    # b. it's not minimum instruction set, but compiler support
  42    if dpdk_conf.has('RTE_HAS_SVE_ACLE')
  43        sources += files('hns3_rxtx_vec_sve.c')
  44    elif cc.has_argument('-march=armv8.2-a+sve') and cc.check_header('arm_sve.h')
  45        cflags += ['-DRTE_HAS_SVE_ACLE=1']
  46        sve_cflags = []
  47        foreach flag: cflags
  48            if not (flag.startswith('-march=') or flag.startswith('-mcpu=') or flag.startswith('-mtune='))
  49                sve_cflags += flag
  50            endif
  51        endforeach
  52        hns3_sve_lib = static_library('hns3_sve_lib',
  53                        'hns3_rxtx_vec_sve.c',
  54                        dependencies: [static_rte_ethdev],
  55                        include_directories: includes,
  56                        c_args: [sve_cflags, '-march=armv8.2-a+sve'])
  57        objs += hns3_sve_lib.extract_objects('hns3_rxtx_vec_sve.c')
  58    endif
  59endif
  60