From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Nikhilesh Subject: Re: [PATCH v4 2/2] build: add support for detecting march on ARM Date: Mon, 22 Jan 2018 12:46:52 +0530 Message-ID: <20180122071651.42q4moppnroivdbm@Pavan-LT> References: <20171219105338.198727-1-bruce.richardson@intel.com> <20180119182349.21935-1-pbhagavatula@caviumnetworks.com> <20180119182349.21935-2-pbhagavatula@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "dev@dpdk.org" , nd To: Herbert Guan , "jerin.jacob@caviumnetworks.com" , "bruce.richardson@intel.com" , harry.van.haaren@intel.com, "hemant.agrawal@nxp.com" Return-path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0085.outbound.protection.outlook.com [104.47.32.85]) by dpdk.org (Postfix) with ESMTP id 9FC477260 for ; Mon, 22 Jan 2018 08:17:17 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Herbert, Thanks for the review, will add a default entry for generic arm. On Mon, Jan 22, 2018 at 05:52:36AM +0000, Herbert Guan wrote: > Hi, Pavan > > Please see my notes inline. > > Best regards, > Herbert > > > -----Original Message----- > > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > > Sent: Saturday, January 20, 2018 2:24 > > To: jerin.jacob@caviumnetworks.com; bruce.richardson@intel.com; > > harry.van.haaren@intel.com; Herbert Guan ; > > hemant.agrawal@nxp.com > > Cc: dev@dpdk.org; Pavan Nikhilesh > > Subject: [dpdk-dev] [PATCH v4 2/2] build: add support for detecting march > > on ARM > > > > 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 > > --- > > +impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium] > > There're only Cavimu args/flags defined, so other arm/arm64 platforms will fail at detecting. Can you add one entry for default? > > > + > > +dpdk_conf.set_quoted('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]) > > Script will fail for non-cavium Arm platforms. We need to check if cmd_output[0] is a known value in a list, otherwise should go to default entry. > > > + message('Implementor : ' + machine[0]) > > +