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 'hns3_common.c', 33 'hns3_dump.c', 34) 35 36require_iova_in_mbuf = false 37 38annotate_locks = false 39 40deps += ['hash'] 41 42if arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64') 43 sources += files('hns3_rxtx_vec.c') 44 45 # compile SVE when: 46 # a. support SVE in minimum instruction set baseline 47 # b. it's not minimum instruction set, but compiler support 48 if dpdk_conf.has('RTE_HAS_SVE_ACLE') 49 sources += files('hns3_rxtx_vec_sve.c') 50 elif cc.has_argument('-march=armv8.2-a+sve') and cc.check_header('arm_sve.h') 51 cflags += ['-DRTE_HAS_SVE_ACLE=1'] 52 sve_cflags = [] 53 foreach flag: cflags 54 if not (flag.startswith('-march=') or flag.startswith('-mcpu=') or flag.startswith('-mtune=')) 55 sve_cflags += flag 56 endif 57 endforeach 58 hns3_sve_lib = static_library('hns3_sve_lib', 59 'hns3_rxtx_vec_sve.c', 60 dependencies: [static_rte_ethdev], 61 include_directories: includes, 62 c_args: [sve_cflags, '-march=armv8.2-a+sve']) 63 objs += hns3_sve_lib.extract_objects('hns3_rxtx_vec_sve.c') 64 endif 65endif 66