From patchwork Wed Nov 14 19:40:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Ehrhardt X-Patchwork-Id: 48094 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5E0F81B205; Wed, 14 Nov 2018 20:40:14 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id D24241B1EE for ; Wed, 14 Nov 2018 20:40:13 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1gN11J-00062t-Ga; Wed, 14 Nov 2018 19:40:13 +0000 From: Christian Ehrhardt To: Luca Boccassi , dev , Bruce Richardson Cc: Christian Ehrhardt Date: Wed, 14 Nov 2018 20:40:11 +0100 Message-Id: <20181114194012.18255-1-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181114143315.2695-1-christian.ehrhardt@canonical.com> References: <20181114143315.2695-1-christian.ehrhardt@canonical.com> Subject: [dpdk-dev] [PATCH v4 1/2] build: avoid non supported -march on ppc (meson) 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" So far only if machine was "native" it did use the re-direction to not set -march on ppc64 (where -march is not supported). We have to use mcpu/mtune in any case on ppc for whatever someone using the build system defines as machine. Fixes: 54d609a13876 ("build: add ppc64 meson build") Acked-by: Luca Boccassi Signed-off-by: Christian Ehrhardt --- config/meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/meson.build b/config/meson.build index 0b710b795..1af305f46 100644 --- a/config/meson.build +++ b/config/meson.build @@ -9,8 +9,9 @@ else endif dpdk_conf.set('RTE_MACHINE', machine) machine_args = [] -# ppc64 does not support -march=native -if host_machine.cpu_family().startswith('ppc') and machine == 'native' + +# ppc64 does not support -march= at all, use -mcpu and -mtune for that +if host_machine.cpu_family().startswith('ppc') machine_args += '-mcpu=' + machine machine_args += '-mtune=' + machine else From patchwork Wed Nov 14 19:40:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Ehrhardt X-Patchwork-Id: 48095 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1DEEA1B217; Wed, 14 Nov 2018 20:40:17 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 4F02F1B216 for ; Wed, 14 Nov 2018 20:40:15 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1gN11L-00062t-5H; Wed, 14 Nov 2018 19:40:15 +0000 From: Christian Ehrhardt To: Luca Boccassi , dev , Bruce Richardson Cc: Christian Ehrhardt Date: Wed, 14 Nov 2018 20:40:12 +0100 Message-Id: <20181114194012.18255-2-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181114194012.18255-1-christian.ehrhardt@canonical.com> References: <20181114143315.2695-1-christian.ehrhardt@canonical.com> <20181114194012.18255-1-christian.ehrhardt@canonical.com> Subject: [dpdk-dev] [PATCH v4 2/2] build: establish an invariant machine type 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 the machine definition 'default' which is special compared to 'native' (most optimized for current system) or any explicit type (external entity has to decide on the type). It defaults to the per arch agreed common minimal baseline needed for DPDK to reasonable work. That might not be the most optimized, but the most portable version while still being able to support the CPU features required for DPDK. Going forward this can be bumped up by the DPDK project, but it can never be an invariant like 'native'. Distributions and other needing portable code are expected to define the machine as 'default'. Acked-by: Bruce Richardson Acked-by: Luca Boccassi Signed-off-by: Christian Ehrhardt --- config/meson.build | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/config/meson.build b/config/meson.build index 1af305f46..db32499b3 100644 --- a/config/meson.build +++ b/config/meson.build @@ -7,6 +7,27 @@ if meson.is_cross_build() else machine = get_option('machine') endif + +# machine type 'default' is special, it defaults to the per arch agreed common +# minimal baseline needed for DPDK. +# 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 host_machine.cpu_family().startswith('x86') + # matches the old pre-meson build systems default + machine = 'corei7' + elif host_machine.cpu_family().startswith('arm') + machine = 'armv7-a' + elif host_machine.cpu_family().startswith('aarch') + # arm64 manages defaults in config/arm/meson.build + machine = 'default' + elif host_machine.cpu_family().startswith('ppc') + machine = 'power8' + endif +endif + dpdk_conf.set('RTE_MACHINE', machine) machine_args = []