From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0089.outbound.protection.outlook.com [104.47.37.89]) by dpdk.org (Postfix) with ESMTP id E945D1B1DD for ; Fri, 19 Jan 2018 14:06:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=j4nAx+Pk+YHi0eYcRipMOiIdtowtXdcxr2wcBAnyHJM=; b=M38kmjs+5y7KT1+U0eEH3mn3sG9Y0UFQr405wWTkAdXUkWn9uGu+IfY6vhkbXpvG0u+yfiPJM8D5Y9sDv0q+m97RZhwrZsr5+cS/+PJbStwB0hCYQdQD9iDvjZQ33vpaXVd7lx7GoBBLPMDSemne/veCfsKS8Zbm7f8J2cgy0Bk= Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3463.namprd07.prod.outlook.com (10.171.252.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Fri, 19 Jan 2018 13:06:32 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, harry.van.haaren@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Fri, 19 Jan 2018 18:35:58 +0530 Message-Id: <20180119130558.6719-2-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180119130558.6719-1-pbhagavatula@caviumnetworks.com> References: <20171219105338.198727-1-bruce.richardson@intel.com> <20180119130558.6719-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: YTOPR0101CA0059.CANPRD01.PROD.OUTLOOK.COM (52.132.42.36) To CY4PR07MB3463.namprd07.prod.outlook.com (10.171.252.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cde9742b-aab7-40fd-c91a-08d55f3d7733 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR07MB3463; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 3:yYDNCUKjl5S8dYOjXJOG0/whgmhlYUpCqAe+QkSVsXNnBtRa8v+IoFeeEajib/72sUC/pibk0KzXFjIHEbqFalan3tHc2BD9uH6Zs93mv2idNIXXK+tOnpB2pnJSNCDe3AycEtPTgQxfpIYj3hKHeqgF87o6Trh0wDYvSMBHtKnpK4iqllmTKZ5F+/QqjLzgMtAzOq0WkoniM3xWhcqdpWVA7NDFeBvYNvFM9s+M3mzJvzfK3uKbfzMrM9MQbYYe; 25:Mkm/hOhtrSqrkyEgBXHvWlZUvmfJK1Aeau8EDU4oNzPaef9tMy1SWQOHxzmuK5nUerwyVBIBBFFuT9WmUWs18eDBPVxWrFoMeiHoroD6wusUsSL6Q+c0VWQvM1mGRxaIOumsDKgVkWuBmShUkzPra8HCi3RDA0Y4WtIBBnyKI6eql9BC9EhGIqSVXd1X3yPaItF0KYhKTfOmIiitpPV9pcw1oszFR66LyTbpI14iZqRRDkvDp/QBKxHc8BLfoWQFMp4AjnH1a0wcRaCQz+2TpJ3PhswSWEqABsc/BRhOYEmUP5lId2ry32NTWM0B7gxztUZoG08pszcF/xwFN7J71Q==; 31:qqoOL2qOSWpcgcYO+e1tJ1gGot3mh4iPUmbnmvjh+m/es5DU6Y/Fq0T6slRCQTd4aDblaiaYAj3oYynXBVzPVzc0OBwEy4s36FQgUY4L3XUYceXBQl6ApNl+D0IE7x0NSWii8oUZe6ceOf5AG/dl8W6/UPu0I+bReMWWxbR3ErxiV9taHoIyadQyxmnyvh2z1LxzdKLGxj3/GujPVSgtgRKrHjzHyWgaJIXDmT5+NWQ= X-MS-TrafficTypeDiagnostic: CY4PR07MB3463: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3463; 20:x6dP7c0nZYHe6NBVNLN1hJZ+DvOT3b8cGx8EYBsLJNlL6GUD6VIukM067vRjhbXAUWQzYIuQ6bwWVj3qDRWkbsKkt1tPrtE0obJLTTEkFFWbO+IYbUtnNskJI8ChVvVjAGFh2Y68dggholkO8XJV+NwRO7sM1qeCCye4V20bG4RD4mfpqh3hg9H+J9PRbTCABiyyEMe6TBNRp/Jh2H/2aRQYoDzXB3GiYSH1IDsPQD1AHQLM+Xph8dipS7a1e0963gdng1B5lyvMCn3622wDMbtxS1rYtz+rsaFyzFDqAM5NRbzZrXg2/ScDY7hGv7Kh4ylJylduqDKDwLLtU0+3ub0qxVNXikOvhwTuM5PFayGpxfWu0c2ZICtZkPf8SQ3Hkg+o3On9d/m8VkE16ZK+CNPkFEmrBCtyycTNDhe1cy8a2wzqBLtUcYouAbrmErNffWPaSrTlm63b6dk3za9fKkImEUVv2LrpKaLhRVy5UxrL++TUIsxhkJOLeA0pPS+1ec1bBnk73MRrhmO0sgzj95dYIh3Sg5vB2iBH6qn24tTvUpPWxLxdaiyK6WD2yu6zFUQXhk0Ps7lcED42Kq5UnzpV2nJdZNmBeIB6fCTObTM=; 4:+uX1olAkiEav42FKffP92O1HKUBBObEBSiCANTjRv/MOUPYqM2stUxGAwUXL1V2cH5YDrgNdg4/MNALXnizBZVqD79VdcGGZZqC3eWUyphWm7qKd2mC6Td5VRQDR8qJEmB78/qRe2ybjzREF7/d88X2CNPHItZ/hZ1RJfn+hggJU2z3nZ2F8SkgxxcpR7/eEUTmNksszhoKdYXDJI8ES3SV7MkYswV+M0CBx4KV2oN13pLiUruXqduEkeq8BWAeSYevKB8vTEwOpScg+/9ad7A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040495)(2401047)(8121501046)(5005006)(3231023)(2400077)(944501161)(3002001)(10201501046)(93006095)(6041282)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:CY4PR07MB3463; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3463; X-Forefront-PRVS: 0557CBAD84 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(39380400002)(396003)(376002)(366004)(189003)(199004)(53416004)(4326008)(16586007)(81156014)(8676002)(6512007)(8936002)(6486002)(36756003)(53936002)(316002)(105586002)(50226002)(68736007)(81166006)(16526018)(25786009)(575784001)(7736002)(97736004)(107886003)(69596002)(106356001)(48376002)(76176011)(50466002)(305945005)(6346003)(6116002)(3846002)(1076002)(6506007)(5009440100003)(386003)(2906002)(66066001)(47776003)(72206003)(5660300001)(59450400001)(51416003)(26005)(2950100002)(42882006)(478600001)(6666003)(52116002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3463; H:Pavan-LT.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3463; 23:dc4ibHixr8u8P58fAHiOvRW5Xlsm3pUyJGdx5oW8A?= =?us-ascii?Q?8IyBuuKRqItlPWPSq32Bvou77CAYviMLKzIZEpvb2ihkvMUwo0QVM95HbKQp?= =?us-ascii?Q?22o7zzaAax2lOrG1hNL3WefTBl1R8NEikdhHC6p3B0mFOctMPIcuTTqqFcol?= =?us-ascii?Q?NOmVmkiH9hn71aOOvyKID+yjkHIrvwQXU82ZiTsL32oyLQez2pISgrOVbi37?= =?us-ascii?Q?pRxoHoktawXu8DkKrIdFM3gAspYvt+M74EDsyVqrdB188zX0VHf40JsdmmzH?= =?us-ascii?Q?pf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DEBHHwxF2LaYYDzjZabUyodfOGlWt2zepgYl+bzTzS0lgRTVLgxqWmU+WaF7ACkgX7FafuIzeeaQ6a SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2018 13:06:32.1256 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cde9742b-aab7-40fd-c91a-08d55f3d7733 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3463 Subject: [dpdk-dev] [PATCH v2 2/2] build: add support for detecting march on ARM 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: , X-List-Received-Date: Fri, 19 Jan 2018 13:06:37 -0000 Added support for detecting march and mcpu by reading midr_el1 register. The implementer, primary part number values read can be used to figure out the underlying arm cpu. Signed-off-by: Pavan Nikhilesh --- app/test-pmd/meson.build | 2 +- config/arm/armv8_machine.py | 18 ++++++++ config/arm/meson.build | 109 +++++++++++++++++++++++++++++--------------- config/meson.build | 19 ++++---- drivers/meson.build | 2 +- examples/meson.build | 2 +- lib/meson.build | 2 +- meson.build | 2 +- test/test/meson.build | 2 +- 9 files changed, 105 insertions(+), 53 deletions(-) create mode 100755 config/arm/armv8_machine.py diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build index e819677a5..2a3f0ba1f 100644 --- a/app/test-pmd/meson.build +++ b/app/test-pmd/meson.build @@ -45,7 +45,7 @@ endif executable('dpdk-testpmd', sources, - c_args: machine_arg, + c_args: machine_args, link_whole: link_libs, dependencies: dep_objs, install_rpath: join_paths(get_option('prefix'), driver_install_path), diff --git a/config/arm/armv8_machine.py b/config/arm/armv8_machine.py new file mode 100755 index 000000000..3c6e7b6a7 --- /dev/null +++ b/config/arm/armv8_machine.py @@ -0,0 +1,18 @@ +#!/usr/bin/python +import pprint +pp = pprint + +ident = [] +fname = '/sys/devices/system/cpu/cpu0/regs/identification/midr_el1' +with open(fname) as f: + content = f.read() + +midr_el1 = (int(content.rstrip('\n'), 16)) + +ident.append(hex((midr_el1 >> 24) & 0xFF)) # Implementer +ident.append(hex((midr_el1 >> 20) & 0xF)) # Variant +ident.append(hex((midr_el1 >> 16) & 0XF)) # Architecture +ident.append(hex((midr_el1 >> 4) & 0xFFF)) # Primary Part number +ident.append(hex(midr_el1 & 0xF)) # Revision + +print(' '.join(ident)) diff --git a/config/arm/meson.build b/config/arm/meson.build index 0c2e57657..62af5e68a 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -1,59 +1,92 @@ -# BSD LICENSE -# -# Copyright(c) 2017 Intel Corporation. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2017 Intel Corporation. +# Copyright(c) 2017 Cavium, Inc # for checking defines we need to use the correct compiler flags march_opt = '-march=@0@'.format(machine) +machine_args_cavium = [ + ['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']], + ['0xa1', ['-mcpu=thunderxt88']], + ['0xa2', ['-mcpu=thunderxt81']], + ['0xa3', ['-mcpu=thunderxt83']]] + +flags_cavium = [ + ['RTE_MACHINE', '"thunderx"'], + ['RTE_CACHE_LINE_SIZE', 128], + ['RTE_MAX_NUMA_NODES', 2], + ['RTE_MAX_LCORE', 96], + ['RTE_MAX_VFIO_GROUPS', 128], + ['RTE_RING_USE_C11_MEM_MODEL', false]] + +impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium] + +dpdk_conf.set('RTE_TOOLCHAIN', '"gcc"') +dpdk_conf.set('RTE_TOOLCHAIN_GCC', 1) dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) -if cc.sizeof('void *') == 8 - dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128) - dpdk_conf.set('RTE_ARCH_ARM64', 1) - dpdk_conf.set('RTE_ARCH_64', 1) -else + +if cc.sizeof('void *') != 8 dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64) dpdk_conf.set('RTE_ARCH_ARM', 1) dpdk_conf.set('RTE_ARCH_ARMv7', 1) +else + dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128) + dpdk_conf.set('RTE_ARCH_ARM64', 1) + dpdk_conf.set('RTE_ARCH_64', 1) + + if not meson.is_cross_build() + # The script returns ['Implementor', '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 + message('Using default armv8 config') + else + machine_args = [] # Clear previous machine args + cmd_output = cmd.stdout().strip().split(' ') + machine = get_variable('impl_' + cmd_output[0]) + message('Implementor : ' + machine[0]) + + foreach flag: machine[1] + dpdk_conf.set(flag[0], flag[1]) + endforeach + + # Primary part number based mcpu flags are supported + # for gcc versions > 7 + if cc.version().version_compare('<7.0') + foreach marg: machine[2] + if marg[0] == 'default' + foreach f: marg[1] + machine_args += f + endforeach + endif + endforeach + else + foreach marg: machine[2] + if marg[0] == cmd_output[3] + foreach f: marg[1] + machine_args += f + endforeach + endif + endforeach + endif + endif + endif endif +message(machine_args) -if cc.get_define('__ARM_NEON', args: march_opt) != '' +if cc.get_define('__ARM_NEON', args: machine_args) != '' dpdk_conf.set('RTE_MACHINE_CPUFLAG_NEON', 1) compile_time_cpuflags += ['RTE_CPUFLAG_NEON'] endif -if cc.get_define('__ARM_FEATURE_CRC32', args: march_opt) != '' +if cc.get_define('__ARM_FEATURE_CRC32', args: machine_args) != '' dpdk_conf.set('RTE_MACHINE_CPUFLAG_CRC32', 1) compile_time_cpuflags += ['RTE_CPUFLAG_CRC32'] endif -if cc.get_define('__ARM_FEATURE_CRYPTO', args: march_opt) != '' +if cc.get_define('__ARM_FEATURE_CRYPTO', args: machine_args) != '' dpdk_conf.set('RTE_MACHINE_CPUFLAG_AES', 1) dpdk_conf.set('RTE_MACHINE_CPUFLAG_PMULL', 1) dpdk_conf.set('RTE_MACHINE_CPUFLAG_SHA1', 1) diff --git a/config/meson.build b/config/meson.build index fa55c53a5..f8c67578d 100644 --- a/config/meson.build +++ b/config/meson.build @@ -8,7 +8,8 @@ else machine = get_option('machine') endif dpdk_conf.set('RTE_MACHINE', machine) -machine_arg = '-march=' + machine +machine_args = [] +machine_args += '-march=' + machine # use pthreads add_project_link_arguments('-pthread', language: 'c') @@ -53,6 +54,14 @@ foreach arg: warning_flags endif 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_LIBEAL_USE_HPET', get_option('use_hpet')) +dpdk_conf.set('RTE_EAL_ALLOW_INV_SOCKET_ID', get_option('allow_invalid_socket_id')) +# values which have defaults which may be overridden +dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) + compile_time_cpuflags = [] if host_machine.cpu_family().startswith('x86') arch_subdir = 'x86' @@ -65,12 +74,4 @@ dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags)) # set the install path for the drivers dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path) -# 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_LIBEAL_USE_HPET', get_option('use_hpet')) -dpdk_conf.set('RTE_EAL_ALLOW_INV_SOCKET_ID', get_option('allow_invalid_socket_id')) -# values which have defaults which may be overridden -dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) - install_headers('rte_config.h', subdir: get_option('include_subdir_arch')) diff --git a/drivers/meson.build b/drivers/meson.build index 9b5039847..1d6430bfe 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -22,7 +22,7 @@ foreach class:driver_classes version = 1 sources = [] objs = [] - cflags = [machine_arg] + cflags = machine_args includes = [include_directories(drv_path)] # set up internal deps. Drivers can append/override as necessary deps = std_deps diff --git a/examples/meson.build b/examples/meson.build index 0abed7169..b3f997242 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -9,7 +9,7 @@ endif foreach example: get_option('examples').split(',') name = example sources = [] - cflags = [machine_arg] + cflags = machine_args ext_deps = [] includes = [include_directories(example)] deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline'] diff --git a/lib/meson.build b/lib/meson.build index 0c94d74b9..b9ea6f61b 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -31,7 +31,7 @@ foreach l:libraries sources = [] headers = [] includes = [] - cflags = [machine_arg] + cflags = machine_args objs = [] # other object files to link against, used e.g. for # instruction-set optimized versions of code diff --git a/meson.build b/meson.build index 3dce8579e..326fbc7d1 100644 --- a/meson.build +++ b/meson.build @@ -66,5 +66,5 @@ pkg.generate(name: meson.project_name(), ['-Wl,-Bdynamic'] + dpdk_extra_ldflags, description: 'The Data Plane Development Kit (DPDK)', subdirs: [get_option('include_subdir_arch'), '.'], - extra_cflags: ['-include "rte_config.h"', machine_arg] + extra_cflags: ['-include "rte_config.h"'] + machine_args ) diff --git a/test/test/meson.build b/test/test/meson.build index 1863c603c..873efbc07 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -204,7 +204,7 @@ if get_option('tests') test_sources, link_whole: link_libs, dependencies: test_dep_objs, - c_args: machine_arg, + c_args: machine_args, install_rpath: driver_install_path, install: false) -- 2.14.1