From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id D0F5A1B324 for ; Fri, 19 Jan 2018 18:30:54 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jan 2018 09:30:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,382,1511856000"; d="scan'208";a="12478633" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.77]) by fmsmga002.fm.intel.com with SMTP; 19 Jan 2018 09:30:50 -0800 Received: by (sSMTP sendmail emulation); Fri, 19 Jan 2018 17:30:49 +0000 Date: Fri, 19 Jan 2018 17:30:49 +0000 From: Bruce Richardson To: Pavan Nikhilesh Cc: jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com, herbert.guan@arm.com, hemant.agrawal@nxp.com, dev@dpdk.org Message-ID: <20180119173049.GA17416@bricha3-MOBL3.ger.corp.intel.com> References: <20171219105338.198727-1-bruce.richardson@intel.com> <20180119135251.10171-1-pbhagavatula@caviumnetworks.com> <20180119135251.10171-2-pbhagavatula@caviumnetworks.com> <20180119161741.GA16980@bricha3-MOBL3.ger.corp.intel.com> <20180119171330.l53eoeysdxshyrvx@Pavan-LT> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180119171330.l53eoeysdxshyrvx@Pavan-LT> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.1 (2017-09-22) Subject: Re: [dpdk-dev] [PATCH v3 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 17:30:55 -0000 On Fri, Jan 19, 2018 at 10:43:31PM +0530, Pavan Nikhilesh wrote: > On Fri, Jan 19, 2018 at 04:17:41PM +0000, Bruce Richardson wrote: > > On Fri, Jan 19, 2018 at 07:22:51PM +0530, Pavan Nikhilesh wrote: > > > 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 | 76 ++++++++++++++++++++++++++++++++++++++++----- > > > 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, 102 insertions(+), 23 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..404866d2f > > > --- /dev/null > > > +++ b/config/arm/armv8_machine.py > > > @@ -0,0 +1,18 @@ > > > +#!/usr/bin/python > > > +# SPDX-License-Identifier: BSD-3-Clause > > > +# Copyright(c) 2017 Cavium, Inc > > > + > > > +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 f05de4c2c..62af5e68a 100644 > > > --- a/config/arm/meson.build > > > +++ b/config/arm/meson.build > > > @@ -5,28 +5,88 @@ > > > # 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_quoted() is probably what you want here. > > Ah, will fix it in v4 > > > > > > +dpdk_conf.set('RTE_TOOLCHAIN_GCC', 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) > > > - > > Is there a reason why these lines have been moved? > > I have moved them above so that they can be overridden by the arch specific > scripts called by subdir(arch_subdir). > Example RTE_MAX_VFIO_GROUPS needs to be 128 in thunderx. > > Missed that, yes, moving them is fine so.