From patchwork Wed Oct 28 14:03:55 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: 82660 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 47C72A04DD; Wed, 28 Oct 2020 15:05:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 51341CB2E; Wed, 28 Oct 2020 15:04:23 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 13D83CB00 for ; Wed, 28 Oct 2020 15:04:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 31D50B6B5D; Wed, 28 Oct 2020 15:04:12 +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 6DBYk2i4dgsk; Wed, 28 Oct 2020 15:04:07 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id AD2FAB6B43; Wed, 28 Oct 2020 15:04:06 +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: Wed, 28 Oct 2020 15:03:55 +0100 Message-Id: <1603893845-5736-2-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 +++++---- 2 files changed, 8 insertions(+), 6 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 From patchwork Wed Oct 28 14:03:56 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: 82658 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 DA3B2A04DD; Wed, 28 Oct 2020 15:04:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D20BCCB06; Wed, 28 Oct 2020 15:04:19 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id ADB76CB00 for ; Wed, 28 Oct 2020 15:04:12 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 66775B6B59; Wed, 28 Oct 2020 15:04:10 +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 wH3JnEVfCq2E; Wed, 28 Oct 2020 15:04:09 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 3DAA2B6B4E; Wed, 28 Oct 2020 15:04:07 +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: Wed, 28 Oct 2020 15:03:56 +0100 Message-Id: <1603893845-5736-3-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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_default since the variable contains more than just the generic machine args and is referenced multiple times with the intended use as a default value. 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 | 72 ++++++++++++++-------------- 11 files changed, 54 insertions(+), 54 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..dacbb947b 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -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_default = [ + ['generic', ['-march=armv8-a+crc', '-moutline-atomics']], ['native', ['-march=native']], ['0xd03', ['-mcpu=cortex-a53']], ['0xd04', ['-mcpu=cortex-a35']], @@ -100,8 +100,8 @@ machine_args_generic = [ ['0xd0b', ['-mcpu=cortex-a76']], ['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]] -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], @@ -109,25 +109,25 @@ machine_args_cavium = [ ['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']], +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_generic, part_number_config_default] +implementer_0x41 = ['Arm', flags_arm, part_number_config_default] +implementer_0x42 = ['Broadcom', flags_generic, part_number_config_default] +implementer_0x43 = ['Cavium', flags_cavium, part_number_config_cavium] +implementer_0x44 = ['DEC', flags_generic, part_number_config_default] +implementer_0x49 = ['Infineon', flags_generic, part_number_config_default] +implementer_0x4d = ['Motorola', flags_generic, part_number_config_default] +implementer_0x4e = ['NVIDIA', flags_generic, part_number_config_default] +implementer_0x50 = ['Ampere Computing', flags_emag, part_number_config_emag] +implementer_0x51 = ['Qualcomm', flags_generic, part_number_config_default] +implementer_0x53 = ['Samsung', flags_generic, part_number_config_default] +implementer_0x56 = ['Marvell ARMADA', flags_armada, part_number_config_default] +implementer_0x69 = ['Intel', flags_generic, part_number_config_default] +implementer_dpaa = ['NXP DPAA', flags_dpaa, part_number_config_default] 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,15 +182,15 @@ 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 From patchwork Wed Oct 28 14:03:57 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: 82659 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 49CC4A04DD; Wed, 28 Oct 2020 15:04:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 668D9CB12; Wed, 28 Oct 2020 15:04:21 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 5D5F0CB00 for ; Wed, 28 Oct 2020 15:04:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 63C6DB6B5E; Wed, 28 Oct 2020 15:04:12 +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 ZXHUb6o1oVK8; Wed, 28 Oct 2020 15:04:11 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id CE898B6B55; Wed, 28 Oct 2020 15:04:07 +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: Wed, 28 Oct 2020 15:03:57 +0100 Message-Id: <1603893845-5736-4-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 dacbb947b..bd2acfc21 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_armada = [ ['RTE_MAX_NUMA_NODES', 1], ['RTE_MAX_LCORE', 16]] -flags_default_extra = [] flags_n1sdp_extra = [ ['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_default_extra) + foreach flag: marg.get(2, []) if flag.length() > 0 dpdk_conf.set(flag[0], flag[1]) endif From patchwork Wed Oct 28 14:03:58 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: 82662 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 07733A04DD; Wed, 28 Oct 2020 15:06:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B2376CB6B; Wed, 28 Oct 2020 15:04:26 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 68FB1CB04 for ; Wed, 28 Oct 2020 15:04:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 1EC69B6B64; Wed, 28 Oct 2020 15:04:15 +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 2igyccH1wK81; Wed, 28 Oct 2020 15:04:13 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id B0EA4B6B56; Wed, 28 Oct 2020 15:04:08 +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: Wed, 28 Oct 2020 15:03:58 +0100 Message-Id: <1603893845-5736-5-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 04/11] build: Arm reformat, comments, move 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" 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 | 84 +++++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 33 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index bd2acfc21..c970c8803 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 generic aarch64 flags, with middle priority +# (will overwrite common flags) flags_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_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_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_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_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_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_n1sdp_extra = [ ['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_thunderx_extra = [ ['RTE_MACHINE', '"thunderx"'], - ['RTE_USE_C11_MEM_MODEL', false]] + ['RTE_USE_C11_MEM_MODEL', false] +] flags_thunderx2_extra = [ ['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_octeontx2_extra = [ ['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_default = [ ['generic', ['-march=armv8-a+crc', '-moutline-atomics']], ['native', ['-march=native']], @@ -93,8 +111,8 @@ part_number_config_default = [ ['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_n1sdp_extra] +] part_number_config_cavium = [ ['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']], ['native', ['-march=native']], @@ -102,11 +120,12 @@ part_number_config_cavium = [ ['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]] - + ['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra] +] 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) implementer_generic = ['Generic armv8', flags_generic, part_number_config_default] @@ -128,15 +147,14 @@ 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 +217,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 Wed Oct 28 14:03:59 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: 82661 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 B9667A04DD; Wed, 28 Oct 2020 15:05:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 11401CB43; Wed, 28 Oct 2020 15:04:25 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 5684ACB00 for ; Wed, 28 Oct 2020 15:04:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 07B6FB6B55; Wed, 28 Oct 2020 15:04:14 +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 8TV_TTyPX0MI; Wed, 28 Oct 2020 15:04:14 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 66FB2B6B40; Wed, 28 Oct 2020 15:04:09 +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: Wed, 28 Oct 2020 15:03:59 +0100 Message-Id: <1603893845-5736-6-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index c970c8803..133a0d7fd 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -186,34 +186,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 Wed Oct 28 14:04:00 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: 82663 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 118E8A04DD; Wed, 28 Oct 2020 15:06:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 40CD9CB97; Wed, 28 Oct 2020 15:04:51 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id A5EF2CB04 for ; Wed, 28 Oct 2020 15:04:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 2E827B6B54; Wed, 28 Oct 2020 15:04:17 +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 rUVTcpJh_Gi6; Wed, 28 Oct 2020 15:04:16 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id E985BB6B57; Wed, 28 Oct 2020 15:04:09 +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: Wed, 28 Oct 2020 15:04:00 +0100 Message-Id: <1603893845-5736-7-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 133a0d7fd..2f89cb2a8 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -101,31 +101,31 @@ flags_octeontx2_extra = [ ] # arm config (implementer 0x41) is the default config -part_number_config_default = [ - ['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_n1sdp_extra] -] -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] -] -part_number_config_emag = [ - ['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']], - ['native', ['-march=native']] -] +part_number_config_default = { + '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_n1sdp_extra] +} +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], +} +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) implementer_generic = ['Generic armv8', flags_generic, part_number_config_default] @@ -189,22 +189,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 Wed Oct 28 14:04:01 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: 82664 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 963D4A04DD; Wed, 28 Oct 2020 15:06:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B54ACCBB4; Wed, 28 Oct 2020 15:04:52 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 9EEE7CB00 for ; Wed, 28 Oct 2020 15:04:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 4B833B6B56; Wed, 28 Oct 2020 15:04:17 +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 l6n_INHaetp6; Wed, 28 Oct 2020 15:04:16 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 7D4C0B6B5B; Wed, 28 Oct 2020 15:04:10 +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: Wed, 28 Oct 2020 15:04:01 +0100 Message-Id: <1603893845-5736-8-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 07/11] build: Arm generic and native build setup 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" Simplify the code. Define native machine args in one place since they're the same regardless of which Arm environment we're building on. Signed-off-by: Juraj Linkeš --- config/arm/meson.build | 56 +++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index 2f89cb2a8..1866ad961 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -3,7 +3,10 @@ # Copyright(c) 2017 Cavium, Inc # Copyright(c) 2020 PANTHEON.tech s.r.o. +# set arm_force_native_march if you want to use machine args below +# instead of discovered values in native builds arm_force_native_march = false +native_machine_args = ['-march=native', '-mtune=native'] # common flags to all aarch64 builds, with lowest priority flags_common_default = [ @@ -103,7 +106,6 @@ flags_octeontx2_extra = [ # arm config (implementer 0x41) is the default config part_number_config_default = { 'generic': [['-march=armv8-a+crc', '-moutline-atomics']], - 'native': [['-march=native']], '0xd03': [['-mcpu=cortex-a53']], '0xd04': [['-mcpu=cortex-a35']], '0xd07': [['-mcpu=cortex-a57']], @@ -115,7 +117,6 @@ part_number_config_default = { } 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], @@ -123,8 +124,7 @@ part_number_config_cavium = { '0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra], } part_number_config_emag = { - 'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']], - 'native': [['-march=native']] + 'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']] } ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321) @@ -155,32 +155,35 @@ if dpdk_conf.get('RTE_ARCH_32') machine_args += '-mfpu=neon' 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' - 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' + 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 + implementer_id = 'generic' + part_number = 'generic' + endif + # Set to generic if implementer is not found + implementer_config = get_variable('implementer_' + implementer_id, implementer_generic) + if arm_force_native_march == true + part_number = 'native' + endif endif else + # cross build 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) @@ -193,6 +196,9 @@ else 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 part_number == 'native' + # use native machine args + part_number_config = [[native_machine_args]] elif not meson.is_cross_build() # default to generic machine args if part_number is not found # and not forcing native machine args From patchwork Wed Oct 28 14:04:02 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: 82666 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 C40C2A04DD; Wed, 28 Oct 2020 15:07:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0AEECCC43; Wed, 28 Oct 2020 15:04:56 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id D88CECAD4 for ; Wed, 28 Oct 2020 15:04:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 861B3B6B57; Wed, 28 Oct 2020 15:04:19 +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 Z3txMBxspMz5; Wed, 28 Oct 2020 15:04:18 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 62191B6B5C; Wed, 28 Oct 2020 15:04:11 +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: Wed, 28 Oct 2020 15:04:02 +0100 Message-Id: <1603893845-5736-9-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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š --- buildtools/get_cpu_count.py | 7 ++++++ buildtools/get_numa_count.py | 22 +++++++++++++++++ buildtools/meson.build | 2 ++ config/meson.build | 48 ++++++++++++++++++++++++++++++++++-- config/x86/meson.build | 2 ++ meson_options.txt | 8 +++--- 6 files changed, 83 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..386f85f8b --- /dev/null +++ b/buildtools/get_cpu_count.py @@ -0,0 +1,7 @@ +#!/usr/bin/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..e7f3de6b0 --- /dev/null +++ b/buildtools/get_numa_count.py @@ -0,0 +1,22 @@ +#!/usr/bin/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', '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..a51000ab2 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,52 @@ 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 not meson.is_cross_build() + # 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 +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 not meson.is_cross_build() + # 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 +endif + +# check that cpu and numa count is set in cross builds +# and error out if it's not set +if meson.is_cross_build() + if not dpdk_conf.has('RTE_MAX_LCORE') + error('Number of cores for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir)) + endif + if not dpdk_conf.has('RTE_MAX_NUMA_NODES') + error('Number of numa nodes for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir)) + endif +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 9bf18ab6b..a78c21b0d 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') 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 Wed Oct 28 14:04:03 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: 82665 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 80925A04DD; Wed, 28 Oct 2020 15:07:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3A30ACBF0; Wed, 28 Oct 2020 15:04:54 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id E5110CB26 for ; Wed, 28 Oct 2020 15:04:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 65E65B6B55; Wed, 28 Oct 2020 15:04:19 +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 Gj53dMvgmucq; Wed, 28 Oct 2020 15:04:18 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id EB7C3B6B4E; Wed, 28 Oct 2020 15:04:11 +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: Wed, 28 Oct 2020 15:04:03 +0100 Message-Id: <1603893845-5736-10-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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. 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 | 24 ++++++++++++++++++++++-- 11 files changed, 46 insertions(+), 2 deletions(-) diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc index 52c5f4476..36100c594 100644 --- a/config/arm/arm64_armada_linux_gcc +++ b/config/arm/arm64_armada_linux_gcc @@ -15,3 +15,5 @@ endian = 'little' [properties] implementer_id = '0x56' +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 573ae7e42..adae86f57 100644 --- a/config/arm/arm64_dpaa_linux_gcc +++ b/config/arm/arm64_dpaa_linux_gcc @@ -15,3 +15,5 @@ endian = 'little' [properties] implementer_id = 'dpaa' +max_numa_nodes = 1 +max_lcores = 16 diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc index 24f3d533e..3cccca901 100644 --- a/config/arm/arm64_emag_linux_gcc +++ b/config/arm/arm64_emag_linux_gcc @@ -14,3 +14,5 @@ endian = 'little' [properties] implementer_id = '0x50' +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 670764437..16ba78fd6 100644 --- a/config/arm/arm64_thunderx_linux_gcc +++ b/config/arm/arm64_thunderx_linux_gcc @@ -14,3 +14,5 @@ endian = 'little' [properties] implementer_id = '0x43' +max_numa_nodes = 1 +max_lcores = 96 diff --git a/config/arm/meson.build b/config/arm/meson.build index 1866ad961..7a4d85e9f 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -38,13 +38,15 @@ flags_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_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_cavium = [ ['RTE_MAX_VFIO_GROUPS', 128], @@ -217,6 +219,24 @@ else dpdk_flags += part_number_config[1] endif + # 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 + dpdk_flags += [ + ['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_flags += [ + ['RTE_MAX_LCORE', cross_max_lcores] + ] + endif + endif + # apply supported machine args machine_args = [] # Clear previous machine args foreach flag: part_number_config[0] From patchwork Wed Oct 28 14:04:04 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: 82667 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 CD542A04DD; Wed, 28 Oct 2020 15:08:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E1E33CC54; Wed, 28 Oct 2020 15:04:57 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id C77A0CB3A for ; Wed, 28 Oct 2020 15:04:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 94416B6B4E; Wed, 28 Oct 2020 15:04: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 mTxNTQMi2WlE; Wed, 28 Oct 2020 15:04:20 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 1148BB6B5F; Wed, 28 Oct 2020 15:04:12 +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: Wed, 28 Oct 2020 15:04:04 +0100 Message-Id: <1603893845-5736-11-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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. Signed-off-by: Juraj Linkeš Acked-by: Bruce Richardson --- config/arm/meson.build | 9 +++++---- drivers/meson.build | 2 +- meson.build | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index 7a4d85e9f..21deb2dd9 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -8,6 +8,11 @@ arm_force_native_march = false native_machine_args = ['-march=native', '-mtune=native'] +# RFC: do we want these drivers to be disabled by default on arm? +# The previous way to disable these drivers never worked +# RTE_NET_AVP and the rest would be overwritten to true if the necessary deps were found +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) @@ -22,10 +27,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], diff --git a/drivers/meson.build b/drivers/meson.build index 4bb7e9218..4c4866866 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -18,7 +18,7 @@ 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() default_cflags = machine_args 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 Wed Oct 28 14:04:05 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: 82668 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 6B3B4A04DD; Wed, 28 Oct 2020 15:08:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5CA5CCC78; Wed, 28 Oct 2020 15:04:59 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by dpdk.org (Postfix) with ESMTP id 0C695CB3E for ; Wed, 28 Oct 2020 15:04:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id ACD02B6B54; Wed, 28 Oct 2020 15:04: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 iSpI4QW29mfS; Wed, 28 Oct 2020 15:04:20 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 0CDB0B6B63; Wed, 28 Oct 2020 15:04:14 +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: Wed, 28 Oct 2020 15:04:05 +0100 Message-Id: <1603893845-5736-12-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> References: <1603464488-25493-1-git-send-email-juraj.linkes@pantheon.tech> <1603893845-5736-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 11/11] build: update Arm builds with makefile flags 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" Not all flags were moved properly from the old Makefile build system. Disable corresponding drivers and libnuma in cross files and remove deprecated config. Signed-off-by: Juraj Linkeš --- config/arm/arm64_armada_linux_gcc | 2 ++ config/arm/arm64_armv8_linux_gcc | 8 ++++++-- 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/arm/meson.build | 5 ++++- drivers/meson.build | 4 ++++ 9 files changed, 21 insertions(+), 3 deletions(-) diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc index 36100c594..e33f1e742 100644 --- a/config/arm/arm64_armada_linux_gcc +++ b/config/arm/arm64_armada_linux_gcc @@ -17,3 +17,5 @@ endian = 'little' implementer_id = '0x56' 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 779333199..c6010e303 100644 --- a/config/arm/arm64_armv8_linux_gcc +++ b/config/arm/arm64_armv8_linux_gcc @@ -28,7 +28,11 @@ implementer_id = 'generic' 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_numa_nodes = n # will set RTE_MAX_NUMA_NODES +# max_lcores = n # will set RTE_MAX_LCORE 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 adae86f57..78883a2ec 100644 --- a/config/arm/arm64_dpaa_linux_gcc +++ b/config/arm/arm64_dpaa_linux_gcc @@ -17,3 +17,4 @@ endian = 'little' implementer_id = 'dpaa' 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/arm/meson.build b/config/arm/meson.build index 21deb2dd9..a023abb17 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -101,7 +101,6 @@ flags_octeontx2_extra = [ ['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] ] @@ -236,6 +235,10 @@ else ['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 # apply supported machine args diff --git a/drivers/meson.build b/drivers/meson.build index 4c4866866..a997387ad 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -21,6 +21,10 @@ subdirs = [ 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']