From patchwork Mon Nov 2 13:21:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83399 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 90B21A04E7; Mon, 2 Nov 2020 14:21:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CFF20C86C; Mon, 2 Nov 2020 14:21:26 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 3BA11C86A for ; Mon, 2 Nov 2020 14:21:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 2D202B6B63; Mon, 2 Nov 2020 14:21:21 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XtPlabw2PI2e; Mon, 2 Nov 2020 14:21:20 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 27009B6B54; Mon, 2 Nov 2020 14:21:20 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:08 +0100 Message-Id: <1604323278-18039-2-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 01/11] build: alias default build as generic X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The current machine='default' build name is not descriptive. The actual default build is machine='native'. Add an alternative string which does the same build and better describes what we're building: machine='generic'. Leave machine='default' for backwards compatibility. Signed-off-by: Juraj Linkeš --- config/arm/meson.build | 5 +++-- config/meson.build | 9 +++++---- doc/guides/prog_guide/build-sdk-meson.rst | 4 ++-- meson_options.txt | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index b49203fa8..4fd32f0ca 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -1,12 +1,13 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation. # Copyright(c) 2017 Cavium, Inc +# Copyright(c) 2020 PANTHEON.tech s.r.o. # for checking defines we need to use the correct compiler flags march_opt = '-march=@0@'.format(machine) arm_force_native_march = false -arm_force_default_march = (machine == 'default') +arm_force_generic_march = (machine == 'generic') flags_common_default = [ # Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest) @@ -145,7 +146,7 @@ else cmd_generic = ['generic', '', '', 'default', ''] cmd_output = cmd_generic # Set generic by default machine_args = [] # Clear previous machine args - if arm_force_default_march and not meson.is_cross_build() + if arm_force_generic_march and not meson.is_cross_build() machine = impl_generic impl_pn = 'default' elif not meson.is_cross_build() diff --git a/config/meson.build b/config/meson.build index 258b01d06..c7f7aa6e2 100644 --- a/config/meson.build +++ b/config/meson.build @@ -68,13 +68,14 @@ else machine = get_option('machine') endif -# machine type 'default' is special, it defaults to the per arch agreed common -# minimal baseline needed for DPDK. +# machine type 'generic' is special, it defaults to the per arch agreed common +# minimal baseline needed for DPDK. Machine type 'default' is also supported +# with the same meaning for backwards compatibility. # That might not be the most optimized, but the most portable version while # still being able to support the CPU features required for DPDK. # This can be bumped up by the DPDK project, but it can never be an # invariant like 'native' -if machine == 'default' +if machine == 'default' or machine == 'generic' if host_machine.cpu_family().startswith('x86') # matches the old pre-meson build systems default machine = 'corei7' @@ -82,7 +83,7 @@ if machine == 'default' machine = 'armv7-a' elif host_machine.cpu_family().startswith('aarch') # arm64 manages defaults in config/arm/meson.build - machine = 'default' + machine = 'generic' elif host_machine.cpu_family().startswith('ppc') machine = 'power8' endif diff --git a/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst index 3429e2647..c7e12eedf 100644 --- a/doc/guides/prog_guide/build-sdk-meson.rst +++ b/doc/guides/prog_guide/build-sdk-meson.rst @@ -85,7 +85,7 @@ Project-specific options are passed used -Doption=value:: meson -Denable_docs=true fullbuild # build and install docs - meson -Dmachine=default # use builder-independent baseline -march + meson -Dmachine=generic # use builder-independent baseline -march meson -Ddisable_drivers=event/*,net/tap # disable tap driver and all # eventdev PMDs for a smaller build @@ -114,7 +114,7 @@ Examples of setting some of the same options using meson configure:: re-scan from meson. .. note:: - machine=default uses a config that works on all supported architectures + machine=generic uses a config that works on all supported architectures regardless of the capabilities of the machine where the build is happening. As well as those settings taken from ``meson configure``, other options diff --git a/meson_options.txt b/meson_options.txt index 9bf18ab6b..ce23289e3 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -23,7 +23,7 @@ option('kernel_dir', type: 'string', value: '', option('lib_musdk_dir', type: 'string', value: '', description: 'path to the MUSDK library installation directory') option('machine', type: 'string', value: 'native', - description: 'set the target machine type') + description: 'set the target machine type. Set to generic for a build usable on most machines of the build machine architecture, set to native to let the compiler choose the best fit for the build machine.') option('max_ethports', type: 'integer', value: 32, description: 'maximum number of Ethernet devices') option('max_lcores', type: 'integer', value: 128, From patchwork Mon Nov 2 13:21:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83401 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8843CA04E7; Mon, 2 Nov 2020 14:22:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A1E71C8D4; Mon, 2 Nov 2020 14:21:31 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 96077C88E for ; Mon, 2 Nov 2020 14:21:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 78E69B6B65; Mon, 2 Nov 2020 14:21:24 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cyypc7G6egal; Mon, 2 Nov 2020 14:21:23 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id BC5C4B6B5E; Mon, 2 Nov 2020 14:21:20 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:09 +0100 Message-Id: <1604323278-18039-3-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 02/11] build: rename Arm build variables X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Rename Arm build variables and values so that they better conform to Arm specifications. Also rename generically sounding variable to names that better capture what the variables hold. Rename machine_args_generic to part_number_config_arm since the variable contains more than just the generic machine args and is used mainly as the fallback arm configuration. Rename the default machine args to generic machine args to reflect that. The rest of the variables are self-explanatory. Signed-off-by: Juraj Linkeš Reviewed-by: Ruifeng Wang --- config/arm/arm64_armada_linux_gcc | 2 +- config/arm/arm64_armv8_linux_gcc | 8 +- config/arm/arm64_bluefield_linux_gcc | 4 +- config/arm/arm64_dpaa_linux_gcc | 2 +- config/arm/arm64_emag_linux_gcc | 2 +- config/arm/arm64_n1sdp_linux_gcc | 4 +- config/arm/arm64_octeontx2_linux_gcc | 4 +- config/arm/arm64_stingray_linux_gcc | 4 +- config/arm/arm64_thunderx2_linux_gcc | 4 +- config/arm/arm64_thunderx_linux_gcc | 2 +- config/arm/meson.build | 110 +++++++++++++-------------- 11 files changed, 73 insertions(+), 73 deletions(-) diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc index fa40c0398..52c5f4476 100644 --- a/config/arm/arm64_armada_linux_gcc +++ b/config/arm/arm64_armada_linux_gcc @@ -14,4 +14,4 @@ cpu = 'armv8-a' endian = 'little' [properties] -implementor_id = '0x56' +implementer_id = '0x56' diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc index 88f0ff9da..13ee8b223 100644 --- a/config/arm/arm64_armv8_linux_gcc +++ b/config/arm/arm64_armv8_linux_gcc @@ -13,10 +13,10 @@ cpu = 'armv8-a' endian = 'little' [properties] -implementor_id = 'generic' +implementer_id = 'generic' -# Valid options for Arm's implementor_pn: -# 'default': valid for all armv8-a architectures (default value) +# Valid options for Arm's part_number: +# 'generic': valid for all armv8-a architectures (default value) # '0xd03': cortex-a53 # '0xd04': cortex-a35 # '0xd05': cortex-a55 @@ -25,4 +25,4 @@ implementor_id = 'generic' # '0xd09': cortex-a73 # '0xd0a': cortex-a75 # '0xd0b': cortex-a76 -implementor_pn = 'default' +part_number = 'generic' diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc index 86797d23c..b79389d85 100644 --- a/config/arm/arm64_bluefield_linux_gcc +++ b/config/arm/arm64_bluefield_linux_gcc @@ -13,5 +13,5 @@ cpu = 'armv8-a' endian = 'little' [properties] -implementor_id = '0x41' -implementor_pn = '0xd08' +implementer_id = '0x41' +part_number = '0xd08' diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc index 1a4682154..573ae7e42 100644 --- a/config/arm/arm64_dpaa_linux_gcc +++ b/config/arm/arm64_dpaa_linux_gcc @@ -14,4 +14,4 @@ cpu = 'armv8-a' endian = 'little' [properties] -implementor_id = 'dpaa' +implementer_id = 'dpaa' diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc index 8edcd3e97..24f3d533e 100644 --- a/config/arm/arm64_emag_linux_gcc +++ b/config/arm/arm64_emag_linux_gcc @@ -13,4 +13,4 @@ cpu = 'armv8-a' endian = 'little' [properties] -implementor_id = '0x50' +implementer_id = '0x50' diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc index 022e06303..6fb3f02ea 100644 --- a/config/arm/arm64_n1sdp_linux_gcc +++ b/config/arm/arm64_n1sdp_linux_gcc @@ -13,5 +13,5 @@ cpu = 'armv8-a' endian = 'little' [properties] -implementor_id = '0x41' -implementor_pn = '0xd0c' +implementer_id = '0x41' +part_number = '0xd0c' diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc index 365bd7cbd..ac1042806 100644 --- a/config/arm/arm64_octeontx2_linux_gcc +++ b/config/arm/arm64_octeontx2_linux_gcc @@ -13,5 +13,5 @@ cpu = 'armv8-a' endian = 'little' [properties] -implementor_id = '0x43' -implementor_pn = '0xb2' +implementer_id = '0x43' +part_number = '0xb2' diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc index 86797d23c..b79389d85 100644 --- a/config/arm/arm64_stingray_linux_gcc +++ b/config/arm/arm64_stingray_linux_gcc @@ -13,5 +13,5 @@ cpu = 'armv8-a' endian = 'little' [properties] -implementor_id = '0x41' -implementor_pn = '0xd08' +implementer_id = '0x41' +part_number = '0xd08' diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc index 2b41acc61..dd257745e 100644 --- a/config/arm/arm64_thunderx2_linux_gcc +++ b/config/arm/arm64_thunderx2_linux_gcc @@ -13,5 +13,5 @@ cpu = 'armv8-a' endian = 'little' [properties] -implementor_id = '0x43' -implementor_pn = '0xaf' +implementer_id = '0x43' +part_number = '0xaf' diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc index 6572ab615..670764437 100644 --- a/config/arm/arm64_thunderx_linux_gcc +++ b/config/arm/arm64_thunderx_linux_gcc @@ -13,4 +13,4 @@ cpu = 'armv8-a' endian = 'little' [properties] -implementor_id = '0x43' +implementer_id = '0x43' diff --git a/config/arm/meson.build b/config/arm/meson.build index 4fd32f0ca..b84d122a0 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -30,57 +30,57 @@ flags_common_default = [ ['RTE_ARM_USE_WFE', false], ] -flags_generic = [ +flags_implementer_generic = [ ['RTE_MACHINE', '"armv8a"'], ['RTE_MAX_LCORE', 256], ['RTE_USE_C11_MEM_MODEL', true], ['RTE_CACHE_LINE_SIZE', 128]] -flags_arm = [ +flags_implementer_arm = [ ['RTE_MACHINE', '"armv8a"'], ['RTE_MAX_LCORE', 16], ['RTE_USE_C11_MEM_MODEL', true], ['RTE_CACHE_LINE_SIZE', 64]] -flags_cavium = [ +flags_implementer_cavium = [ ['RTE_CACHE_LINE_SIZE', 128], ['RTE_MAX_NUMA_NODES', 2], ['RTE_MAX_LCORE', 96], ['RTE_MAX_VFIO_GROUPS', 128]] -flags_dpaa = [ +flags_implementer_dpaa = [ ['RTE_MACHINE', '"dpaa"'], ['RTE_USE_C11_MEM_MODEL', true], ['RTE_CACHE_LINE_SIZE', 64], ['RTE_MAX_NUMA_NODES', 1], ['RTE_MAX_LCORE', 16], ['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]] -flags_emag = [ +flags_implementer_emag = [ ['RTE_MACHINE', '"emag"'], ['RTE_CACHE_LINE_SIZE', 64], ['RTE_MAX_NUMA_NODES', 1], ['RTE_MAX_LCORE', 32]] -flags_armada = [ +flags_implementer_armada = [ ['RTE_MACHINE', '"armv8a"'], ['RTE_CACHE_LINE_SIZE', 64], ['RTE_MAX_NUMA_NODES', 1], ['RTE_MAX_LCORE', 16]] -flags_default_extra = [] -flags_n1sdp_extra = [ +flags_part_number_default = [] +flags_part_number_n1generic = [ ['RTE_MACHINE', '"n1sdp"'], ['RTE_MAX_NUMA_NODES', 1], ['RTE_MAX_LCORE', 4], ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false], ['RTE_LIBRTE_VHOST_NUMA', false]] -flags_thunderx_extra = [ +flags_part_number_thunderx = [ ['RTE_MACHINE', '"thunderx"'], ['RTE_USE_C11_MEM_MODEL', false]] -flags_thunderx2_extra = [ +flags_part_number_thunderx2 = [ ['RTE_MACHINE', '"thunderx2"'], ['RTE_CACHE_LINE_SIZE', 64], ['RTE_MAX_NUMA_NODES', 2], ['RTE_MAX_LCORE', 256], ['RTE_ARM_FEATURE_ATOMICS', true], ['RTE_USE_C11_MEM_MODEL', true]] -flags_octeontx2_extra = [ +flags_part_number_octeontx2 = [ ['RTE_MACHINE', '"octeontx2"'], ['RTE_MAX_NUMA_NODES', 1], ['RTE_MAX_LCORE', 36], @@ -88,8 +88,8 @@ flags_octeontx2_extra = [ ['RTE_EAL_IGB_UIO', false], ['RTE_USE_C11_MEM_MODEL', true]] -machine_args_generic = [ - ['default', ['-march=armv8-a+crc', '-moutline-atomics']], +part_number_config_arm = [ + ['generic', ['-march=armv8-a+crc', '-moutline-atomics']], ['native', ['-march=native']], ['0xd03', ['-mcpu=cortex-a53']], ['0xd04', ['-mcpu=cortex-a35']], @@ -98,36 +98,36 @@ machine_args_generic = [ ['0xd09', ['-mcpu=cortex-a73']], ['0xd0a', ['-mcpu=cortex-a75']], ['0xd0b', ['-mcpu=cortex-a76']], - ['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]] + ['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]] -machine_args_cavium = [ - ['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']], +part_number_config_cavium = [ + ['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']], ['native', ['-march=native']], - ['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra], - ['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra], - ['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra], - ['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra], - ['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]] - -machine_args_emag = [ - ['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']], + ['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx], + ['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx], + ['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx], + ['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2], + ['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]] + +part_number_config_emag = [ + ['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']], ['native', ['-march=native']]] ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321) -impl_generic = ['Generic armv8', flags_generic, machine_args_generic] -impl_0x41 = ['Arm', flags_arm, machine_args_generic] -impl_0x42 = ['Broadcom', flags_generic, machine_args_generic] -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium] -impl_0x44 = ['DEC', flags_generic, machine_args_generic] -impl_0x49 = ['Infineon', flags_generic, machine_args_generic] -impl_0x4d = ['Motorola', flags_generic, machine_args_generic] -impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic] -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag] -impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic] -impl_0x53 = ['Samsung', flags_generic, machine_args_generic] -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic] -impl_0x69 = ['Intel', flags_generic, machine_args_generic] -impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic] +implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm] +implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm] +implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm] +implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium] +implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm] +implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm] +implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm] +implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm] +implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag] +implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm] +implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm] +implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm] +implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm] +implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm] dpdk_conf.set('RTE_ARCH_ARM', 1) dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -142,13 +142,13 @@ else dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128) dpdk_conf.set('RTE_ARCH_ARM64', 1) - machine = [] - cmd_generic = ['generic', '', '', 'default', ''] + implementer_config = [] + cmd_generic = ['generic', '', '', 'generic', ''] cmd_output = cmd_generic # Set generic by default machine_args = [] # Clear previous machine args if arm_force_generic_march and not meson.is_cross_build() - machine = impl_generic - impl_pn = 'default' + implementer_config = implementer_generic + part_number = 'generic' elif not meson.is_cross_build() # The script returns ['Implementer', 'Variant', 'Architecture', # 'Primary Part number', 'Revision'] @@ -159,19 +159,19 @@ else cmd_output = cmd.stdout().to_lower().strip().split(' ') endif # Set to generic if variable is not found - machine = get_variable('impl_' + cmd_output[0], ['generic']) - if machine[0] == 'generic' - machine = impl_generic + implementer_config = get_variable('implementer_' + cmd_output[0], ['generic']) + if implementer_config[0] == 'generic' + implementer_config = implementer_generic cmd_output = cmd_generic endif - impl_pn = cmd_output[3] + part_number = cmd_output[3] if arm_force_native_march == true - impl_pn = 'native' + part_number = 'native' endif else - impl_id = meson.get_cross_property('implementor_id', 'generic') - impl_pn = meson.get_cross_property('implementor_pn', 'default') - machine = get_variable('impl_' + impl_id) + implementer_id = meson.get_cross_property('implementer_id', 'generic') + part_number = meson.get_cross_property('part_number', 'generic') + implementer_config = get_variable('implementer_' + implementer_id) endif # Apply Common Defaults. These settings may be overwritten by machine @@ -182,22 +182,22 @@ else endif endforeach - message('Implementer : ' + machine[0]) - foreach flag: machine[1] + message('Implementer : ' + implementer_config[0]) + foreach flag: implementer_config[1] if flag.length() > 0 dpdk_conf.set(flag[0], flag[1]) endif endforeach - foreach marg: machine[2] - if marg[0] == impl_pn + foreach marg: implementer_config[2] + if marg[0] == part_number foreach flag: marg[1] if cc.has_argument(flag) machine_args += flag endif endforeach # Apply any extra machine specific flags. - foreach flag: marg.get(2, flags_default_extra) + foreach flag: marg.get(2, flags_part_number_default) if flag.length() > 0 dpdk_conf.set(flag[0], flag[1]) endif From patchwork Mon Nov 2 13:21:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83402 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9A29AA04E7; Mon, 2 Nov 2020 14:22:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DE4A4C8E0; Mon, 2 Nov 2020 14:21:33 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 8F29DC87E for ; Mon, 2 Nov 2020 14:21:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id E1D4BB6B66; Mon, 2 Nov 2020 14:21:24 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GEQ0u-5SJPim; Mon, 2 Nov 2020 14:21:23 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 6325FB6B61; Mon, 2 Nov 2020 14:21:21 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:10 +0100 Message-Id: <1604323278-18039-4-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 03/11] build: remove unused or superfluous variables X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Remove variables that were either not used, referenced just once or not needed. Signed-off-by: Juraj Linkeš Reviewed-by: Ruifeng Wang --- config/arm/meson.build | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index b84d122a0..2347908ed 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -3,11 +3,7 @@ # Copyright(c) 2017 Cavium, Inc # Copyright(c) 2020 PANTHEON.tech s.r.o. -# for checking defines we need to use the correct compiler flags -march_opt = '-march=@0@'.format(machine) - arm_force_native_march = false -arm_force_generic_march = (machine == 'generic') flags_common_default = [ # Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest) @@ -63,7 +59,6 @@ flags_implementer_armada = [ ['RTE_MAX_NUMA_NODES', 1], ['RTE_MAX_LCORE', 16]] -flags_part_number_default = [] flags_part_number_n1generic = [ ['RTE_MACHINE', '"n1sdp"'], ['RTE_MAX_NUMA_NODES', 1], @@ -142,11 +137,9 @@ else dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128) dpdk_conf.set('RTE_ARCH_ARM64', 1) - implementer_config = [] - cmd_generic = ['generic', '', '', 'generic', ''] - cmd_output = cmd_generic # Set generic by default + implementer_id = 'generic' machine_args = [] # Clear previous machine args - if arm_force_generic_march and not meson.is_cross_build() + if machine == 'generic' and not meson.is_cross_build() implementer_config = implementer_generic part_number = 'generic' elif not meson.is_cross_build() @@ -157,14 +150,15 @@ else cmd = run_command(detect_vendor.path()) if cmd.returncode() == 0 cmd_output = cmd.stdout().to_lower().strip().split(' ') + implementer_id = cmd_output[0] + part_number = cmd_output[3] endif # Set to generic if variable is not found - implementer_config = get_variable('implementer_' + cmd_output[0], ['generic']) + implementer_config = get_variable('implementer_' + implementer_id, ['generic']) if implementer_config[0] == 'generic' implementer_config = implementer_generic - cmd_output = cmd_generic + part_number = 'generic' endif - part_number = cmd_output[3] if arm_force_native_march == true part_number = 'native' endif @@ -197,7 +191,7 @@ else endif endforeach # Apply any extra machine specific flags. - foreach flag: marg.get(2, flags_part_number_default) + foreach flag: marg.get(2, []) if flag.length() > 0 dpdk_conf.set(flag[0], flag[1]) endif From patchwork Mon Nov 2 13:21:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83403 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A784A04E7; Mon, 2 Nov 2020 14:22:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3282DC8F6; Mon, 2 Nov 2020 14:21:36 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 4BFABC8C4 for ; Mon, 2 Nov 2020 14:21:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 6E8E7B6B6A; Mon, 2 Nov 2020 14:21:27 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NTniJHYxmo_p; Mon, 2 Nov 2020 14:21:26 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 8F5FAB6B55; Mon, 2 Nov 2020 14:21:22 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:11 +0100 Message-Id: <1604323278-18039-5-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 04/11] build: reformat and move Arm config and comments X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Change formatting so that it's more consistent and readable, add/modify comments/stdout messages, move configuration options to more appropriate places and make the order consistent according to these rules: 1. First list generic configuration options, then list options that may be overwritten. List SoC-specific options last. 2. For SoC-specific options, list number of cores before the number of NUMA nodes, to make it consistent with config/meson.build. Signed-off-by: Juraj Linkeš --- config/arm/meson.build | 87 +++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 35 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index 2347908ed..91e4ea222 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -5,6 +5,7 @@ arm_force_native_march = false +# common flags to all aarch64 builds, with lowest priority flags_common_default = [ # Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest) # to determine the best threshold in code. Refer to notes in source file @@ -12,8 +13,8 @@ flags_common_default = [ ['RTE_ARCH_ARM64_MEMCPY', false], # ['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048], # ['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512], - # Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're - # strong reasons. + # Leave below RTE_ARM64_MEMCPY_xxx options commented out, + # unless there are strong reasons. # ['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false], # ['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF], # ['RTE_ARM64_MEMCPY_STRICT_ALIGN', false], @@ -24,65 +25,82 @@ flags_common_default = [ ['RTE_SCHED_VECTOR', false], ['RTE_ARM_USE_WFE', false], + ['RTE_ARCH_ARM64', true], + ['RTE_CACHE_LINE_SIZE', 128] ] +# implementer specific aarch64 flags, with middle priority +# (will overwrite common flags) flags_implementer_generic = [ ['RTE_MACHINE', '"armv8a"'], - ['RTE_MAX_LCORE', 256], ['RTE_USE_C11_MEM_MODEL', true], - ['RTE_CACHE_LINE_SIZE', 128]] + ['RTE_CACHE_LINE_SIZE', 128], + ['RTE_MAX_LCORE', 256] +] flags_implementer_arm = [ ['RTE_MACHINE', '"armv8a"'], - ['RTE_MAX_LCORE', 16], ['RTE_USE_C11_MEM_MODEL', true], - ['RTE_CACHE_LINE_SIZE', 64]] + ['RTE_CACHE_LINE_SIZE', 64], + ['RTE_MAX_LCORE', 16] +] flags_implementer_cavium = [ + ['RTE_MAX_VFIO_GROUPS', 128], ['RTE_CACHE_LINE_SIZE', 128], - ['RTE_MAX_NUMA_NODES', 2], ['RTE_MAX_LCORE', 96], - ['RTE_MAX_VFIO_GROUPS', 128]] + ['RTE_MAX_NUMA_NODES', 2] +] flags_implementer_dpaa = [ ['RTE_MACHINE', '"dpaa"'], + ['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false], ['RTE_USE_C11_MEM_MODEL', true], ['RTE_CACHE_LINE_SIZE', 64], - ['RTE_MAX_NUMA_NODES', 1], ['RTE_MAX_LCORE', 16], - ['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]] + ['RTE_MAX_NUMA_NODES', 1] +] flags_implementer_emag = [ ['RTE_MACHINE', '"emag"'], ['RTE_CACHE_LINE_SIZE', 64], - ['RTE_MAX_NUMA_NODES', 1], - ['RTE_MAX_LCORE', 32]] + ['RTE_MAX_LCORE', 32], + ['RTE_MAX_NUMA_NODES', 1] +] flags_implementer_armada = [ ['RTE_MACHINE', '"armv8a"'], ['RTE_CACHE_LINE_SIZE', 64], - ['RTE_MAX_NUMA_NODES', 1], - ['RTE_MAX_LCORE', 16]] + ['RTE_MAX_LCORE', 16], + ['RTE_MAX_NUMA_NODES', 1] +] +# part number specific aarch64 flags, with highest priority +# (will overwrite both common and implementer specific flags) flags_part_number_n1generic = [ ['RTE_MACHINE', '"n1sdp"'], - ['RTE_MAX_NUMA_NODES', 1], - ['RTE_MAX_LCORE', 4], ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false], - ['RTE_LIBRTE_VHOST_NUMA', false]] + ['RTE_LIBRTE_VHOST_NUMA', false], + ['RTE_MAX_LCORE', 4], + ['RTE_MAX_NUMA_NODES', 1] +] flags_part_number_thunderx = [ ['RTE_MACHINE', '"thunderx"'], - ['RTE_USE_C11_MEM_MODEL', false]] + ['RTE_USE_C11_MEM_MODEL', false] +] flags_part_number_thunderx2 = [ ['RTE_MACHINE', '"thunderx2"'], + ['RTE_ARM_FEATURE_ATOMICS', true], + ['RTE_USE_C11_MEM_MODEL', true], ['RTE_CACHE_LINE_SIZE', 64], - ['RTE_MAX_NUMA_NODES', 2], ['RTE_MAX_LCORE', 256], - ['RTE_ARM_FEATURE_ATOMICS', true], - ['RTE_USE_C11_MEM_MODEL', true]] + ['RTE_MAX_NUMA_NODES', 2] +] flags_part_number_octeontx2 = [ ['RTE_MACHINE', '"octeontx2"'], - ['RTE_MAX_NUMA_NODES', 1], - ['RTE_MAX_LCORE', 36], ['RTE_ARM_FEATURE_ATOMICS', true], + ['RTE_USE_C11_MEM_MODEL', true], ['RTE_EAL_IGB_UIO', false], - ['RTE_USE_C11_MEM_MODEL', true]] + ['RTE_MAX_LCORE', 36], + ['RTE_MAX_NUMA_NODES', 1] +] +# arm config (implementer 0x41) is the default config part_number_config_arm = [ ['generic', ['-march=armv8-a+crc', '-moutline-atomics']], ['native', ['-march=native']], @@ -93,8 +111,8 @@ part_number_config_arm = [ ['0xd09', ['-mcpu=cortex-a73']], ['0xd0a', ['-mcpu=cortex-a75']], ['0xd0b', ['-mcpu=cortex-a76']], - ['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]] - + ['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic] +] part_number_config_cavium = [ ['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']], ['native', ['-march=native']], @@ -102,13 +120,14 @@ part_number_config_cavium = [ ['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx], ['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx], ['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2], - ['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]] - + ['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2] +] part_number_config_emag = [ ['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']], - ['native', ['-march=native']]] + ['native', ['-march=native']] +] -## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321) +## Arm implementer ID (MIDR in Arm Architecture Reference Manual) implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm] implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm] implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm] @@ -128,15 +147,13 @@ dpdk_conf.set('RTE_ARCH_ARM', 1) dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) if dpdk_conf.get('RTE_ARCH_32') + # armv7 build dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64) dpdk_conf.set('RTE_ARCH_ARMv7', 1) # the minimum architecture supported, armv7-a, needs the following, - # mk/machine/armv7a/rte.vars.mk sets it too machine_args += '-mfpu=neon' else - dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128) - dpdk_conf.set('RTE_ARCH_ARM64', 1) - + # aarch64 build implementer_id = 'generic' machine_args = [] # Clear previous machine args if machine == 'generic' and not meson.is_cross_build() @@ -199,7 +216,7 @@ else endif endforeach endif -message(machine_args) +message('Using machine args: @0@'.format(machine_args)) if (cc.get_define('__ARM_NEON', args: machine_args) != '' or cc.get_define('__aarch64__', args: machine_args) != '') From patchwork Mon Nov 2 13:21:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83404 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1DA9CA04E7; Mon, 2 Nov 2020 14:23:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CE4DBC902; Mon, 2 Nov 2020 14:21:37 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 50396C8C6 for ; Mon, 2 Nov 2020 14:21:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 465E7B6B69; Mon, 2 Nov 2020 14:21:27 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w_PCwhMFJAVV; Mon, 2 Nov 2020 14:21:26 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id A3B7EB6A8F; Mon, 2 Nov 2020 14:21:23 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:12 +0100 Message-Id: <1604323278-18039-6-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 05/11] build: simplify how Arm flags are processed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Set flags in one loop. Append flags to a list and use the list in the loop. Signed-off-by: Juraj Linkeš --- config/arm/meson.build | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index 91e4ea222..6d9236a7f 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -155,7 +155,6 @@ if dpdk_conf.get('RTE_ARCH_32') else # aarch64 build implementer_id = 'generic' - machine_args = [] # Clear previous machine args if machine == 'generic' and not meson.is_cross_build() implementer_config = implementer_generic part_number = 'generic' @@ -185,34 +184,32 @@ else implementer_config = get_variable('implementer_' + implementer_id) endif - # Apply Common Defaults. These settings may be overwritten by machine - # settings later. - foreach flag: flags_common_default - if flag.length() > 0 - dpdk_conf.set(flag[0], flag[1]) - endif - endforeach + message('Arm implementer: ' + implementer_config[0]) + message('Arm part number: ' + part_number) - message('Implementer : ' + implementer_config[0]) - foreach flag: implementer_config[1] - if flag.length() > 0 - dpdk_conf.set(flag[0], flag[1]) - endif - endforeach + # use default flags with implementer flags + dpdk_flags = flags_common_default + implementer_config[1] + machine_args = [] # Clear previous machine args foreach marg: implementer_config[2] if marg[0] == part_number + # apply supported machine args foreach flag: marg[1] if cc.has_argument(flag) machine_args += flag endif endforeach - # Apply any extra machine specific flags. - foreach flag: marg.get(2, []) - if flag.length() > 0 - dpdk_conf.set(flag[0], flag[1]) - endif - endforeach + if marg.length() > 2 + # add extra flags for the part + dpdk_flags += marg[2] + endif + endif + endforeach + + # apply flags + foreach flag: dpdk_flags + if flag.length() > 0 + dpdk_conf.set(flag[0], flag[1]) endif endforeach endif From patchwork Mon Nov 2 13:21:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83406 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1259A04E7; Mon, 2 Nov 2020 14:23:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 41A21C924; Mon, 2 Nov 2020 14:21:40 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 6B1FDC8DC for ; Mon, 2 Nov 2020 14:21:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 1410BB6B5F; Mon, 2 Nov 2020 14:21:30 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pn3V7S6Hd0SQ; Mon, 2 Nov 2020 14:21:29 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 5189DB6B5D; Mon, 2 Nov 2020 14:21:24 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:13 +0100 Message-Id: <1604323278-18039-7-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 06/11] build: use dict in Arm part number config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use dictionary lookup instead of iterating over all elements in the list. Fallback to generic part number if the discovered part number is unknown. Signed-off-by: Juraj Linkeš --- config/arm/meson.build | 85 ++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index 6d9236a7f..8dc946761 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -101,31 +101,31 @@ flags_part_number_octeontx2 = [ ] # arm config (implementer 0x41) is the default config -part_number_config_arm = [ - ['generic', ['-march=armv8-a+crc', '-moutline-atomics']], - ['native', ['-march=native']], - ['0xd03', ['-mcpu=cortex-a53']], - ['0xd04', ['-mcpu=cortex-a35']], - ['0xd07', ['-mcpu=cortex-a57']], - ['0xd08', ['-mcpu=cortex-a72']], - ['0xd09', ['-mcpu=cortex-a73']], - ['0xd0a', ['-mcpu=cortex-a75']], - ['0xd0b', ['-mcpu=cortex-a76']], - ['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic] -] -part_number_config_cavium = [ - ['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']], - ['native', ['-march=native']], - ['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx], - ['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx], - ['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx], - ['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2], - ['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2] -] -part_number_config_emag = [ - ['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']], - ['native', ['-march=native']] -] +part_number_config_arm = { + 'generic': [['-march=armv8-a+crc', '-moutline-atomics']], + 'native': [['-march=native']], + '0xd03': [['-mcpu=cortex-a53']], + '0xd04': [['-mcpu=cortex-a35']], + '0xd07': [['-mcpu=cortex-a57']], + '0xd08': [['-mcpu=cortex-a72']], + '0xd09': [['-mcpu=cortex-a73']], + '0xd0a': [['-mcpu=cortex-a75']], + '0xd0b': [['-mcpu=cortex-a76']], + '0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic] +} +part_number_config_cavium = { + 'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']], + 'native': [['-march=native']], + '0xa1': [['-mcpu=thunderxt88'], flags_part_number_thunderx], + '0xa2': [['-mcpu=thunderxt81'], flags_part_number_thunderx], + '0xa3': [['-mcpu=thunderxt83'], flags_part_number_thunderx], + '0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2], + '0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2] +} +part_number_config_emag = { + 'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']], + 'native': [['-march=native']] +} ## Arm implementer ID (MIDR in Arm Architecture Reference Manual) implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm] @@ -187,22 +187,33 @@ else message('Arm implementer: ' + implementer_config[0]) message('Arm part number: ' + part_number) + part_number_config = implementer_config[2] + if part_number_config.has_key(part_number) + # use the specified part_number machine args if found + part_number_config = part_number_config[part_number] + elif not meson.is_cross_build() + # default to generic machine args if part_number is not found + # and not forcing native machine args + # but don't default in cross-builds; if part_number is specified + # incorrectly in a cross-file, it needs to be fixed there + part_number_config = part_number_config['generic'] + else + # doing cross build and part number is not in part_number_config + error('Cross build part number 0@0 not found.'.format(part_number)) + endif + # use default flags with implementer flags dpdk_flags = flags_common_default + implementer_config[1] + if part_number_config.length() > 1 + # add extra flags from the part number + dpdk_flags += part_number_config[1] + endif + # apply supported machine args machine_args = [] # Clear previous machine args - foreach marg: implementer_config[2] - if marg[0] == part_number - # apply supported machine args - foreach flag: marg[1] - if cc.has_argument(flag) - machine_args += flag - endif - endforeach - if marg.length() > 2 - # add extra flags for the part - dpdk_flags += marg[2] - endif + foreach flag: part_number_config[0] + if cc.has_argument(flag) + machine_args += flag endif endforeach From patchwork Mon Nov 2 13:21:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83405 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D340CA04E7; Mon, 2 Nov 2020 14:23:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 44B3FC91A; Mon, 2 Nov 2020 14:21:39 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 69F88C8DA for ; Mon, 2 Nov 2020 14:21:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 4F1EBB6B61; Mon, 2 Nov 2020 14:21:30 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QmkMwg9buttV; Mon, 2 Nov 2020 14:21:29 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 7303AB6B67; Mon, 2 Nov 2020 14:21:25 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:14 +0100 Message-Id: <1604323278-18039-8-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 07/11] build: streamline Arm build setup and machine args X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Modify the Arm build system so it satisfies the following: * Use predefined configuration values and predefined machine args the generic portable build. * Use configuration values based on MIDR and native machine args for native builds. * Use configuration values and machine args based on MIDR implementer ID and part number specified in cross files for cross builds. Require these to be specified. Signed-off-by: Juraj Linkeš --- config/arm/arm64_armada_linux_gcc | 1 + config/arm/arm64_dpaa_linux_gcc | 1 + config/arm/arm64_emag_linux_gcc | 1 + config/arm/arm64_thunderx_linux_gcc | 1 + config/arm/meson.build | 158 +++++++++++++--------------- 5 files changed, 80 insertions(+), 82 deletions(-) diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc index 52c5f4476..52214f2d8 100644 --- a/config/arm/arm64_armada_linux_gcc +++ b/config/arm/arm64_armada_linux_gcc @@ -15,3 +15,4 @@ endian = 'little' [properties] implementer_id = '0x56' +part_number = 'generic' diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc index 573ae7e42..29f1581de 100644 --- a/config/arm/arm64_dpaa_linux_gcc +++ b/config/arm/arm64_dpaa_linux_gcc @@ -15,3 +15,4 @@ endian = 'little' [properties] implementer_id = 'dpaa' +part_number = 'generic' diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc index 24f3d533e..14ecf9a12 100644 --- a/config/arm/arm64_emag_linux_gcc +++ b/config/arm/arm64_emag_linux_gcc @@ -14,3 +14,4 @@ endian = 'little' [properties] implementer_id = '0x50' +part_number = 'generic' diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc index 670764437..6fa29886d 100644 --- a/config/arm/arm64_thunderx_linux_gcc +++ b/config/arm/arm64_thunderx_linux_gcc @@ -14,3 +14,4 @@ endian = 'little' [properties] implementer_id = '0x43' +part_number = 'generic' diff --git a/config/arm/meson.build b/config/arm/meson.build index 8dc946761..4cb5274b1 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -3,8 +3,6 @@ # Copyright(c) 2017 Cavium, Inc # Copyright(c) 2020 PANTHEON.tech s.r.o. -arm_force_native_march = false - # common flags to all aarch64 builds, with lowest priority flags_common_default = [ # Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest) @@ -28,6 +26,8 @@ flags_common_default = [ ['RTE_ARCH_ARM64', true], ['RTE_CACHE_LINE_SIZE', 128] ] +generic_machine_args = ['-march=armv8-a+crc', '-moutline-atomics'] +native_machine_args = ['-march=native', '-mtune=native'] # implementer specific aarch64 flags, with middle priority # (will overwrite common flags) @@ -101,47 +101,46 @@ flags_part_number_octeontx2 = [ ] # arm config (implementer 0x41) is the default config -part_number_config_arm = { - 'generic': [['-march=armv8-a+crc', '-moutline-atomics']], - 'native': [['-march=native']], - '0xd03': [['-mcpu=cortex-a53']], - '0xd04': [['-mcpu=cortex-a35']], - '0xd07': [['-mcpu=cortex-a57']], - '0xd08': [['-mcpu=cortex-a72']], - '0xd09': [['-mcpu=cortex-a73']], - '0xd0a': [['-mcpu=cortex-a75']], - '0xd0b': [['-mcpu=cortex-a76']], - '0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic] -} -part_number_config_cavium = { - 'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']], - 'native': [['-march=native']], - '0xa1': [['-mcpu=thunderxt88'], flags_part_number_thunderx], - '0xa2': [['-mcpu=thunderxt81'], flags_part_number_thunderx], - '0xa3': [['-mcpu=thunderxt83'], flags_part_number_thunderx], - '0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2], - '0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2] +part_number_machine_args = { + '0xd03': ['-mcpu=cortex-a53'], + '0xd04': ['-mcpu=cortex-a35'], + '0xd07': ['-mcpu=cortex-a57'], + '0xd08': ['-mcpu=cortex-a72'], + '0xd09': ['-mcpu=cortex-a73'], + '0xd0a': ['-mcpu=cortex-a75'], + '0xd0b': ['-mcpu=cortex-a76'], + '0xd0c': ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], + '0xa1': ['-mcpu=thunderxt88'], + '0xa2': ['-mcpu=thunderxt81'], + '0xa3': ['-mcpu=thunderxt83'], + '0xaf': ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], + '0xb2': ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'] } -part_number_config_emag = { - 'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']], - 'native': [['-march=native']] + +part_number_flags = { + '0xd0c': flags_part_number_n1generic, + '0xa1': flags_part_number_thunderx, + '0xa2': flags_part_number_thunderx, + '0xa3': flags_part_number_thunderx, + '0xaf': flags_part_number_thunderx2, + '0xb2': flags_part_number_octeontx2 } ## Arm implementer ID (MIDR in Arm Architecture Reference Manual) -implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm] -implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm] -implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm] -implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium] -implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm] -implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm] -implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm] -implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm] -implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag] -implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm] -implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm] -implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm] -implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm] -implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm] +implementer_generic = ['Generic armv8', flags_implementer_generic] +implementer_0x41 = ['Arm', flags_implementer_arm] +implementer_0x42 = ['Broadcom', flags_implementer_generic] +implementer_0x43 = ['Cavium', flags_implementer_cavium] +implementer_0x44 = ['DEC', flags_implementer_generic] +implementer_0x49 = ['Infineon', flags_implementer_generic] +implementer_0x4d = ['Motorola', flags_implementer_generic] +implementer_0x4e = ['NVIDIA', flags_implementer_generic] +implementer_0x50 = ['Ampere Computing', flags_implementer_emag] +implementer_0x51 = ['Qualcomm', flags_implementer_generic] +implementer_0x53 = ['Samsung', flags_implementer_generic] +implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada] +implementer_0x69 = ['Intel', flags_implementer_generic] +implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa] dpdk_conf.set('RTE_ARCH_ARM', 1) dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -154,69 +153,64 @@ if dpdk_conf.get('RTE_ARCH_32') machine_args += '-mfpu=neon' else # aarch64 build - implementer_id = 'generic' - if machine == 'generic' and not meson.is_cross_build() - implementer_config = implementer_generic - part_number = 'generic' - elif not meson.is_cross_build() - # The script returns ['Implementer', 'Variant', 'Architecture', - # 'Primary Part number', 'Revision'] - detect_vendor = find_program(join_paths( - meson.current_source_dir(), 'armv8_machine.py')) - cmd = run_command(detect_vendor.path()) - if cmd.returncode() == 0 - cmd_output = cmd.stdout().to_lower().strip().split(' ') - implementer_id = cmd_output[0] - part_number = cmd_output[3] - endif - # Set to generic if variable is not found - implementer_config = get_variable('implementer_' + implementer_id, ['generic']) - if implementer_config[0] == 'generic' + if not meson.is_cross_build() + if machine == 'generic' + # generic native build implementer_config = implementer_generic part_number = 'generic' - endif - if arm_force_native_march == true - part_number = 'native' + target_machine_args = generic_machine_args + else + # native build + # The script returns ['Implementer', 'Variant', 'Architecture', + # 'Primary Part number', 'Revision'] + detect_vendor = find_program(join_paths( + meson.current_source_dir(), 'armv8_machine.py')) + cmd = run_command(detect_vendor.path()) + if cmd.returncode() == 0 + cmd_output = cmd.stdout().to_lower().strip().split(' ') + implementer_id = cmd_output[0] + part_number = cmd_output[3] + else + error('Failed to get Arm MIDR information.') + endif + # Set to generic if implementer is not found + implementer_config = get_variable('implementer_' + implementer_id, implementer_generic) + target_machine_args = native_machine_args endif else - implementer_id = meson.get_cross_property('implementer_id', 'generic') - part_number = meson.get_cross_property('part_number', 'generic') + # cross build + implementer_id = meson.get_cross_property('implementer_id', '') + if implementer_id == '' + error('Arm implementer ID must be specified in the cross file.') + endif implementer_config = get_variable('implementer_' + implementer_id) + part_number = meson.get_cross_property('part_number', '') + if part_number == '' + error('Arm part number must be specified in the cross file.') + elif part_number == 'generic' + target_machine_args = generic_machine_args + else + target_machine_args = part_number_machine_args[part_number] + endif endif message('Arm implementer: ' + implementer_config[0]) message('Arm part number: ' + part_number) - part_number_config = implementer_config[2] - if part_number_config.has_key(part_number) - # use the specified part_number machine args if found - part_number_config = part_number_config[part_number] - elif not meson.is_cross_build() - # default to generic machine args if part_number is not found - # and not forcing native machine args - # but don't default in cross-builds; if part_number is specified - # incorrectly in a cross-file, it needs to be fixed there - part_number_config = part_number_config['generic'] - else - # doing cross build and part number is not in part_number_config - error('Cross build part number 0@0 not found.'.format(part_number)) - endif - - # use default flags with implementer flags dpdk_flags = flags_common_default + implementer_config[1] - if part_number_config.length() > 1 - # add extra flags from the part number - dpdk_flags += part_number_config[1] + if part_number_flags.has_key(part_number) + dpdk_flags += part_number_flags[part_number] endif # apply supported machine args machine_args = [] # Clear previous machine args - foreach flag: part_number_config[0] + foreach flag: target_machine_args if cc.has_argument(flag) machine_args += flag endif endforeach + # use default flags with implementer flags and part number flags # apply flags foreach flag: dpdk_flags if flag.length() > 0 From patchwork Mon Nov 2 13:21:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83408 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8F8B9A04E7; Mon, 2 Nov 2020 14:24:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B5B44C93E; Mon, 2 Nov 2020 14:21:42 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id A7584C8F2 for ; Mon, 2 Nov 2020 14:21:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 4731CB6B5E; Mon, 2 Nov 2020 14:21:32 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XK9eSM5E0c7D; Mon, 2 Nov 2020 14:21:31 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 6E50CB6B54; Mon, 2 Nov 2020 14:21:26 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:15 +0100 Message-Id: <1604323278-18039-9-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 08/11] build: optional NUMA and cpu counts detection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add an option to automatically discover the host's numa and cpu counts and use those values for a non cross-build. Give users the option to override the per-arch default values or values from cross files by specifying them on the command line with -Dmax_lcores and -Dmax_numa_nodes. Signed-off-by: Juraj Linkeš Acked-by: Bruce Richardson --- buildtools/get_cpu_count.py | 7 ++++++ buildtools/get_numa_count.py | 22 +++++++++++++++++ buildtools/meson.build | 2 ++ config/meson.build | 47 ++++++++++++++++++++++++++++++++++-- config/x86/meson.build | 2 ++ meson_options.txt | 8 +++--- 6 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 buildtools/get_cpu_count.py create mode 100644 buildtools/get_numa_count.py diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py new file mode 100644 index 000000000..b269d557b --- /dev/null +++ b/buildtools/get_cpu_count.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 PANTHEON.tech s.r.o. + +import os + +print(os.cpu_count()) diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py new file mode 100644 index 000000000..be73c5c3f --- /dev/null +++ b/buildtools/get_numa_count.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 PANTHEON.tech s.r.o. + +import ctypes +import glob +import os +import subprocess + +if os.name == 'posix': + if os.path.isdir('/sys/devices/system/node'): + print(len(glob.glob('/sys/devices/system/node/node*'))) + else: + subprocess.run(['sysctl', '-n', 'vm.ndomains']) + +elif os.name == 'nt': + libkernel32 = ctypes.windll.kernel32 + + count = ctypes.c_ulong() + + libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count)) + print(count.value + 1) diff --git a/buildtools/meson.build b/buildtools/meson.build index 04808dabc..925e733b1 100644 --- a/buildtools/meson.build +++ b/buildtools/meson.build @@ -17,3 +17,5 @@ else endif map_to_win_cmd = py3 + files('map_to_win.py') sphinx_wrapper = py3 + files('call-sphinx-build.py') +get_cpu_count_cmd = py3 + files('get_cpu_count.py') +get_numa_count_cmd = py3 + files('get_numa_count.py') diff --git a/config/meson.build b/config/meson.build index c7f7aa6e2..700e32b00 100644 --- a/config/meson.build +++ b/config/meson.build @@ -231,8 +231,6 @@ foreach arg: warning_flags endforeach # set other values pulled from the build options -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores')) -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes')) dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports')) dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp')) @@ -251,6 +249,51 @@ compile_time_cpuflags = [] subdir(arch_subdir) dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags)) +max_lcores = get_option('max_lcores') +max_numa_nodes = get_option('max_numa_nodes') +if max_lcores > 0 + # Overwrite the default value from arch_subdir with user input + dpdk_conf.set('RTE_MAX_LCORE', max_lcores) +elif max_lcores == -1 + # Overwrite the default value with discovered values + if meson.is_cross_build() + error('Discovered values (user setting -1) are not supported be used when cross-compiling.') + endif + # Discovery makes sense only for non-cross builds + max_lcores = run_command(get_cpu_count_cmd).stdout().to_int() + min_lcores = 2 + # DPDK must be build for at least 2 cores + if max_lcores < min_lcores + message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores)) + max_lcores = min_lcores + else + message('Found @0@ cores'.format(max_lcores)) + endif + dpdk_conf.set('RTE_MAX_LCORE', max_lcores) +endif + +if max_numa_nodes > 0 + # Overwrite the default value from arch_subdir with user input + dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) +elif max_numa_nodes == -1 + # Overwrite the default value with discovered values + if meson.is_cross_build() + error('Discovered values (user setting -1) are not supported be used when cross-compiling.') + endif + # Discovery makes sense only for non-cross builds + max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int() + message('Found @0@ numa nodes'.format(max_numa_nodes)) + dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) +endif + +# check that cpu and numa count is set and error out if it's not set +if not dpdk_conf.has('RTE_MAX_LCORE') + error('Number of cores not specified.') +endif +if not dpdk_conf.has('RTE_MAX_NUMA_NODES') + error('Number of numa nodes not specified.') +endif + # set the install path for the drivers dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path) diff --git a/config/x86/meson.build b/config/x86/meson.build index 31bfa63b1..4989d47f3 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -57,3 +57,5 @@ else endif dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64) +dpdk_conf.set('RTE_MAX_LCORE', 128) +dpdk_conf.set('RTE_MAX_NUMA_NODES', 4) diff --git a/meson_options.txt b/meson_options.txt index ce23289e3..e1059fb16 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native', description: 'set the target machine type. Set to generic for a build usable on most machines of the build machine architecture, set to native to let the compiler choose the best fit for the build machine.') option('max_ethports', type: 'integer', value: 32, description: 'maximum number of Ethernet devices') -option('max_lcores', type: 'integer', value: 128, - description: 'maximum number of cores/threads supported by EAL') -option('max_numa_nodes', type: 'integer', value: 4, - description: 'maximum number of NUMA nodes supported by EAL') +option('max_lcores', type: 'integer', value: 0, + description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of cores on the build machine.') +option('max_numa_nodes', type: 'integer', value: 0, + description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of numa nodes on the build machine.') option('enable_trace_fp', type: 'boolean', value: false, description: 'enable fast path trace points.') option('tests', type: 'boolean', value: true, From patchwork Mon Nov 2 13:21:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83407 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 01DEFA04E7; Mon, 2 Nov 2020 14:24:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AC3CEC932; Mon, 2 Nov 2020 14:21:41 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 9F4D4C8E6 for ; Mon, 2 Nov 2020 14:21:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 7BE76B6B63; Mon, 2 Nov 2020 14:21:32 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EDZRKk5HFFrR; Mon, 2 Nov 2020 14:21:31 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id F277DB6B68; Mon, 2 Nov 2020 14:21:26 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:16 +0100 Message-Id: <1604323278-18039-10-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 09/11] build: add core and NUMA counts to cross files X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add support for setting core count and numa nodes in cross files. The values specified in cross files will override the default values. Also add missing default values to Arm config. Signed-off-by: Juraj Linkeš --- config/arm/arm64_armada_linux_gcc | 2 ++ config/arm/arm64_armv8_linux_gcc | 6 ++++++ config/arm/arm64_bluefield_linux_gcc | 2 ++ config/arm/arm64_dpaa_linux_gcc | 2 ++ config/arm/arm64_emag_linux_gcc | 2 ++ config/arm/arm64_n1sdp_linux_gcc | 2 ++ config/arm/arm64_octeontx2_linux_gcc | 2 ++ config/arm/arm64_stingray_linux_gcc | 2 ++ config/arm/arm64_thunderx2_linux_gcc | 2 ++ config/arm/arm64_thunderx_linux_gcc | 2 ++ config/arm/meson.build | 6 ++++-- config/meson.build | 15 +++++++++++++++ 12 files changed, 43 insertions(+), 2 deletions(-) diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc index 52214f2d8..381971cc5 100644 --- a/config/arm/arm64_armada_linux_gcc +++ b/config/arm/arm64_armada_linux_gcc @@ -16,3 +16,5 @@ endian = 'little' [properties] implementer_id = '0x56' part_number = 'generic' +max_numa_nodes = 1 +max_lcores = 16 diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc index 13ee8b223..779333199 100644 --- a/config/arm/arm64_armv8_linux_gcc +++ b/config/arm/arm64_armv8_linux_gcc @@ -26,3 +26,9 @@ implementer_id = 'generic' # '0xd0a': cortex-a75 # '0xd0b': cortex-a76 part_number = 'generic' + +# Supported extra configuration +# max_numa_nodes = n # will set RTE_MAX_NUMA_NODES +# max_lcores = n # will set RTE_MAX_LCORE +max_lcores = 256 +max_numa_nodes = 4 diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc index b79389d85..7ff6fd309 100644 --- a/config/arm/arm64_bluefield_linux_gcc +++ b/config/arm/arm64_bluefield_linux_gcc @@ -15,3 +15,5 @@ endian = 'little' [properties] implementer_id = '0x41' part_number = '0xd08' +max_numa_nodes = 1 +max_lcores = 16 diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc index 29f1581de..79e1ddb95 100644 --- a/config/arm/arm64_dpaa_linux_gcc +++ b/config/arm/arm64_dpaa_linux_gcc @@ -16,3 +16,5 @@ endian = 'little' [properties] implementer_id = 'dpaa' part_number = 'generic' +max_numa_nodes = 1 +max_lcores = 16 diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc index 14ecf9a12..23a4a7971 100644 --- a/config/arm/arm64_emag_linux_gcc +++ b/config/arm/arm64_emag_linux_gcc @@ -15,3 +15,5 @@ endian = 'little' [properties] implementer_id = '0x50' part_number = 'generic' +max_numa_nodes = 1 +max_lcores = 32 diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc index 6fb3f02ea..3a8b46812 100644 --- a/config/arm/arm64_n1sdp_linux_gcc +++ b/config/arm/arm64_n1sdp_linux_gcc @@ -15,3 +15,5 @@ endian = 'little' [properties] implementer_id = '0x41' part_number = '0xd0c' +max_numa_nodes = 1 +max_lcores = 4 diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc index ac1042806..2baf95a2a 100644 --- a/config/arm/arm64_octeontx2_linux_gcc +++ b/config/arm/arm64_octeontx2_linux_gcc @@ -15,3 +15,5 @@ endian = 'little' [properties] implementer_id = '0x43' part_number = '0xb2' +max_numa_nodes = 1 +max_lcores = 36 diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc index b79389d85..7ff6fd309 100644 --- a/config/arm/arm64_stingray_linux_gcc +++ b/config/arm/arm64_stingray_linux_gcc @@ -15,3 +15,5 @@ endian = 'little' [properties] implementer_id = '0x41' part_number = '0xd08' +max_numa_nodes = 1 +max_lcores = 16 diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc index dd257745e..07440fe5f 100644 --- a/config/arm/arm64_thunderx2_linux_gcc +++ b/config/arm/arm64_thunderx2_linux_gcc @@ -15,3 +15,5 @@ endian = 'little' [properties] implementer_id = '0x43' part_number = '0xaf' +max_numa_nodes = 2 +max_lcores = 256 diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc index 6fa29886d..b9c55d60f 100644 --- a/config/arm/arm64_thunderx_linux_gcc +++ b/config/arm/arm64_thunderx_linux_gcc @@ -15,3 +15,5 @@ endian = 'little' [properties] implementer_id = '0x43' part_number = 'generic' +max_numa_nodes = 1 +max_lcores = 96 diff --git a/config/arm/meson.build b/config/arm/meson.build index 4cb5274b1..e65d06e5d 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -35,13 +35,15 @@ flags_implementer_generic = [ ['RTE_MACHINE', '"armv8a"'], ['RTE_USE_C11_MEM_MODEL', true], ['RTE_CACHE_LINE_SIZE', 128], - ['RTE_MAX_LCORE', 256] + ['RTE_MAX_LCORE', 256], + ['RTE_MAX_NUMA_NODES', 4] ] flags_implementer_arm = [ ['RTE_MACHINE', '"armv8a"'], ['RTE_USE_C11_MEM_MODEL', true], ['RTE_CACHE_LINE_SIZE', 64], - ['RTE_MAX_LCORE', 16] + ['RTE_MAX_LCORE', 16], + ['RTE_MAX_NUMA_NODES', 1] ] flags_implementer_cavium = [ ['RTE_MAX_VFIO_GROUPS', 128], diff --git a/config/meson.build b/config/meson.build index 700e32b00..7b822890a 100644 --- a/config/meson.build +++ b/config/meson.build @@ -249,6 +249,21 @@ compile_time_cpuflags = [] subdir(arch_subdir) dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags)) +# apply cross-specific options +if meson.is_cross_build() + # configure RTE_MAX_NUMA_NODES and RTE_MAX_LCORE from cross file + cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0) + if cross_max_numa_nodes != 0 + message('Setting RTE_MAX_NUMA_NODES from cross file') + dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes) + endif + cross_max_lcores = meson.get_cross_property('max_lcores', 0) + if cross_max_lcores != 0 + message('Setting RTE_MAX_LCORE from cross file') + dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores) + endif +endif + max_lcores = get_option('max_lcores') max_numa_nodes = get_option('max_numa_nodes') if max_lcores > 0 From patchwork Mon Nov 2 13:21:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83410 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E3850A04E7; Mon, 2 Nov 2020 14:25:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 83504C966; Mon, 2 Nov 2020 14:21:45 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id D3A6FC8FE for ; Mon, 2 Nov 2020 14:21:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 59E4DB6B66; Mon, 2 Nov 2020 14:21:34 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VWj3Pus_Fk_f; Mon, 2 Nov 2020 14:21:33 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id D5D9FB6B6B; Mon, 2 Nov 2020 14:21:27 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:17 +0100 Message-Id: <1604323278-18039-11-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 10/11] build: disable Arm drivers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" A few options that disabled drivers in the old makefiles were improperly ported to the meson build system. Fix this by adding a to the list of disabled drivers, similarly how the command line option works. Remove unneeded driver options ported from the old makefile system. Add support for removing drivers for cross builds. Signed-off-by: Juraj Linkeš Acked-by: Bruce Richardson --- config/arm/arm64_armada_linux_gcc | 1 + config/arm/arm64_armv8_linux_gcc | 3 +++ config/arm/meson.build | 8 +++----- drivers/meson.build | 6 +++++- meson.build | 1 + 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc index 381971cc5..5adf27cd7 100644 --- a/config/arm/arm64_armada_linux_gcc +++ b/config/arm/arm64_armada_linux_gcc @@ -18,3 +18,4 @@ implementer_id = '0x56' part_number = 'generic' max_numa_nodes = 1 max_lcores = 16 +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax'] diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc index 779333199..72cb4cd5d 100644 --- a/config/arm/arm64_armv8_linux_gcc +++ b/config/arm/arm64_armv8_linux_gcc @@ -32,3 +32,6 @@ part_number = 'generic' # max_lcores = n # will set RTE_MAX_LCORE max_lcores = 256 max_numa_nodes = 4 + +# disabled_drivers = ['bus/dpaa', 'crypto'] + # add to the set of disabled libraries diff --git a/config/arm/meson.build b/config/arm/meson.build index e65d06e5d..30088ee68 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -3,6 +3,9 @@ # Copyright(c) 2017 Cavium, Inc # Copyright(c) 2020 PANTHEON.tech s.r.o. +# disable Arm drivers for all builds +disabled_drivers += ['net/avp', 'net/fm10k', 'net/sfc'] + # common flags to all aarch64 builds, with lowest priority flags_common_default = [ # Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest) @@ -17,10 +20,6 @@ flags_common_default = [ # ['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF], # ['RTE_ARM64_MEMCPY_STRICT_ALIGN', false], - ['RTE_NET_FM10K', false], - ['RTE_NET_SFC_EFX', false], - ['RTE_NET_AVP', false], - ['RTE_SCHED_VECTOR', false], ['RTE_ARM_USE_WFE', false], ['RTE_ARCH_ARM64', true], @@ -97,7 +96,6 @@ flags_part_number_octeontx2 = [ ['RTE_MACHINE', '"octeontx2"'], ['RTE_ARM_FEATURE_ATOMICS', true], ['RTE_USE_C11_MEM_MODEL', true], - ['RTE_EAL_IGB_UIO', false], ['RTE_MAX_LCORE', 36], ['RTE_MAX_NUMA_NODES', 1] ] diff --git a/drivers/meson.build b/drivers/meson.build index 4bb7e9218..a997387ad 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -18,9 +18,13 @@ subdirs = [ 'baseband', # depends on common and bus. ] -disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'), +disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'), ).stdout().split() +if meson.is_cross_build() + disabled_drivers += meson.get_cross_property('disabled_drivers', []) +endif + default_cflags = machine_args default_cflags += ['-DALLOW_EXPERIMENTAL_API'] default_cflags += ['-DALLOW_INTERNAL_API'] diff --git a/meson.build b/meson.build index 61d9a4f5f..8dadd70dc 100644 --- a/meson.build +++ b/meson.build @@ -21,6 +21,7 @@ dpdk_drivers = [] dpdk_extra_ldflags = [] dpdk_libs_disabled = [] dpdk_drvs_disabled = [] +disabled_drivers = [] abi_version_file = files('ABI_VERSION') if host_machine.cpu_family().startswith('x86') From patchwork Mon Nov 2 13:21:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 83409 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3EC5DA04E7; Mon, 2 Nov 2020 14:24:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A940C95C; Mon, 2 Nov 2020 14:21:44 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id D373CC8FC for ; Mon, 2 Nov 2020 14:21:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 585BFB6B5D; Mon, 2 Nov 2020 14:21:34 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ffMcM1xXSOJZ; Mon, 2 Nov 2020 14:21:33 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id F1525B6A8F; Mon, 2 Nov 2020 14:21:28 +0100 (CET) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: bruce.richardson@intel.com, Ruifeng.Wang@arm.com, Honnappa.Nagarahalli@arm.com, Phil.Yang@arm.com, vcchunga@amazon.com, Dharmik.Thakkar@arm.com, jerinjacobk@gmail.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Date: Mon, 2 Nov 2020 14:21:18 +0100 Message-Id: <1604323278-18039-12-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> <1604323278-18039-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 11/11] build: disable libnuma in cross builds X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA for cross build and disabled NUMA in Arm cross files. Signed-off-by: Juraj Linkeš --- config/arm/arm64_armada_linux_gcc | 1 + config/arm/arm64_armv8_linux_gcc | 1 + config/arm/arm64_bluefield_linux_gcc | 1 + config/arm/arm64_dpaa_linux_gcc | 1 + config/arm/arm64_n1sdp_linux_gcc | 1 + config/arm/arm64_octeontx2_linux_gcc | 1 + config/arm/arm64_stingray_linux_gcc | 1 + config/meson.build | 4 ++++ 8 files changed, 11 insertions(+) diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc index 5adf27cd7..90d9eed75 100644 --- a/config/arm/arm64_armada_linux_gcc +++ b/config/arm/arm64_armada_linux_gcc @@ -18,4 +18,5 @@ implementer_id = '0x56' part_number = 'generic' max_numa_nodes = 1 max_lcores = 16 +has_libnuma = 0 disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax'] diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc index 72cb4cd5d..844685c10 100644 --- a/config/arm/arm64_armv8_linux_gcc +++ b/config/arm/arm64_armv8_linux_gcc @@ -33,5 +33,6 @@ part_number = 'generic' max_lcores = 256 max_numa_nodes = 4 +# has_libnuma = 0 # set to 0 if the SoC is not a NUMA system # disabled_drivers = ['bus/dpaa', 'crypto'] # add to the set of disabled libraries diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc index 7ff6fd309..e154ac4fd 100644 --- a/config/arm/arm64_bluefield_linux_gcc +++ b/config/arm/arm64_bluefield_linux_gcc @@ -17,3 +17,4 @@ implementer_id = '0x41' part_number = '0xd08' max_numa_nodes = 1 max_lcores = 16 +has_libnuma = 0 diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc index 79e1ddb95..5e28da16b 100644 --- a/config/arm/arm64_dpaa_linux_gcc +++ b/config/arm/arm64_dpaa_linux_gcc @@ -18,3 +18,4 @@ implementer_id = 'dpaa' part_number = 'generic' max_numa_nodes = 1 max_lcores = 16 +has_libnuma = 0 diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc index 3a8b46812..4493227f3 100644 --- a/config/arm/arm64_n1sdp_linux_gcc +++ b/config/arm/arm64_n1sdp_linux_gcc @@ -17,3 +17,4 @@ implementer_id = '0x41' part_number = '0xd0c' max_numa_nodes = 1 max_lcores = 4 +has_libnuma = 0 diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc index 2baf95a2a..ff9e5c403 100644 --- a/config/arm/arm64_octeontx2_linux_gcc +++ b/config/arm/arm64_octeontx2_linux_gcc @@ -17,3 +17,4 @@ implementer_id = '0x43' part_number = '0xb2' max_numa_nodes = 1 max_lcores = 36 +has_libnuma = 0 diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc index 7ff6fd309..e154ac4fd 100644 --- a/config/arm/arm64_stingray_linux_gcc +++ b/config/arm/arm64_stingray_linux_gcc @@ -17,3 +17,4 @@ implementer_id = '0x41' part_number = '0xd08' max_numa_nodes = 1 max_lcores = 16 +has_libnuma = 0 diff --git a/config/meson.build b/config/meson.build index 7b822890a..c1b9f7667 100644 --- a/config/meson.build +++ b/config/meson.build @@ -262,6 +262,10 @@ if meson.is_cross_build() message('Setting RTE_MAX_LCORE from cross file') dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores) endif + cross_has_libnuma = meson.get_cross_property('has_libnuma', '') + if cross_has_libnuma != '' + has_libnuma = cross_has_libnuma + endif endif max_lcores = get_option('max_lcores')