From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0041.outbound.protection.outlook.com [104.47.33.41]) by dpdk.org (Postfix) with ESMTP id EF5E71B1A3 for ; Mon, 8 Jan 2018 12:12:52 +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=4s6zvT902CfFTpMDUwS52vChma7FxeblCBqkC5n1Mzo=; b=mMDA/4A4n6Bymrw4JEhK4f//ZjuTStgxXzakjOazpDGElgc0ZMak9QvWJWEHXjPftvOwEgDYErni5I0emw71fPho/pn9MJjqnSNjai0yjHT4hMYsJUZDBgcq9ofrBXSRUZaoKfJOBnxQz0SQENxDqLn1TtB4a+kDuVBqyrt5Mkc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT (111.93.218.67) by CY4PR07MB3462.namprd07.prod.outlook.com (10.171.252.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Mon, 8 Jan 2018 11:12:48 +0000 Date: Mon, 8 Jan 2018 16:42:36 +0530 From: Pavan Nikhilesh To: Jerin Jacob , bruce.richardson@intel.com, bluca@debian.org, harry.van.haaren@intel.com, herbert.guan@arm.com Cc: dev@dpdk.org Message-ID: <20180108111235.xzrirvnwmp6jzfma@Pavan-LT> References: <20171230163754.20356-1-pbhagavatula@caviumnetworks.com> <20180108081305.GA14975@jerin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180108081305.GA14975@jerin> User-Agent: NeoMutt/20170609 (1.8.3) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: HK2PR04CA0086.apcprd04.prod.outlook.com (10.170.154.158) To CY4PR07MB3462.namprd07.prod.outlook.com (10.171.252.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 394c39c3-8a7a-4680-6405-08d55688c1af X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR07MB3462; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 3:aaGNMn+b8tkXjurioz/sWEmi44u5+u/utLAbfCxpZeV5uMxpvYj0cH12gRl3y6qI1xZtQwaNIp0FAnwACK+LYLVxO9+xSxGB/Nre181/QBZvJ930ZDNGgB+/tVHcY2bXpXPX+NzjC+g77aCeQTQdIdS6Ix3EDpTTL92mq9/HD3HC24QfYIN7ymdkWNeHSb3XPqgkBif5su4X7WcDL4ZZVVhqlZD8deUFYAOMRrbbfJ+LTO5QEeyI55cSjYfYvycQ; 25:/xxDlIdM96cKpMpRueXvBXCiayL4tyxQX+4AXz3QC63yblt229Tl+ncFloLURPKY8WZ9DKNbnjKd69GWrYI3yz/N4rqC2cwt9j1KpRy+Lja6Q831F6wNhSM7sfe90mNWMeGant/anD0xpFvs8ekqKXmCarGAcXGxy33RF7fdhP/xRPL3fUdx/PofeGuQZ8xfj5unlKosr4FVXZVuFZ6ZsWUeGmNvvW8kQbTJ/8sCzCqMZYaAaym0xWRuS6bJm2c6hm39439644OXsducCXupdTSgxUkdp90PCQ/DzPBFJOZjbEU2o9z0sjLOPRmRM1Sc9X3eYuQzpixhrMod5PDgUg==; 31:kp6kDuFgzAXisJ+wPVLF18KEJz/4vaoeOK6BHKsMhrYdiirtuvJ3p9cdSOpP3kpITwL6zl7+GSRkNHFkt7dCIQ6Wc9Dnhi94uF/yl7PBnkwXRZAFuQsJ+Q3mGo3TR1mY/EkQPpIMFbnPpzOC6IQFJuAOE6W4q/fn5UcvJVPkpvxrfXlq30nayQQ+1yamupLAgQ1yOW4BkkL0eXymkwFoI2kweZCv8MJwQnq9KTF/YaQ= X-MS-TrafficTypeDiagnostic: CY4PR07MB3462: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 20:FgXpJtEkFv0VuwmQBLiqGGma7CzW5Np1X5W4CyeM5qtJ3wYBOi/Pmwp0lsrujb8J9+XxTgkE684PP/FBczZ+oknEGaWY2V4dbLwaglAMh6O0BQ41PDwVeYkaKBLu9Z/Z9vYBqL/7z1Bz9ZAtxMCNxBzgRPy+CYtQZ+fyr93cHnSbAfW6q0rFQpl8iiSmgJoz5relBT1V1EQjff6l1iG0I6BXL4lNBs2osl+Z/+mUlTI8qIFRUP/pZcSLPFW9Db0+gRPR9w+biUxXw2xoVJS2slkxHk+YospVv2OpX3mhcDGuq1qshmxI7j7d5dHKs1eLdVbBuSQZo4v/d9Gs3YRVNRhu6O23X9ErkWzIfnpUByX8wGTDSSsrAkfH/XaQY6ObUlfPbAfYWrW3Rj9tdj3LcDNcPLxfYiyetslbtJspFJgsShqh+fB1NkNeH28swVWDkhz5LavK2OJYcwhCvdjv8mc423OMUtkoHCI9vYCZoM+vnsrYXG5tpM2eUqW1aBlKpow0OncQvppiNVvVIDs25IBgtjm8r6lyvXOT4+XnR0h0sTG2U0WII7tJPTP+F9WePSqtJsFIR1h5TVY25TLKjSQ1qf/PXUzdwkk2+Dw/w+M= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(258649278758335)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(10201501046)(3002001)(3231023)(944501075)(6041268)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:CY4PR07MB3462; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3462; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 4:MouzmhNRbNw6SRNBDVrai5at5ni0Dmv5/7hg3bxIp3xlvJkj/7F7FQATfswmCGCtELFf/amoAGN9YCf0M7swCSvTGxV8st/fOuzHwc08IUSkLHhRUD5DNK28GOYT0wNYqkWmeGl5/lVm2lq6w8zq50O4Ct8iDus55K9XobkJ7zA0h3oEAlGrQj4TNrJFovGcnqkAvbgNCULKbVekjD9yC5l17guAZf04ZXf8T2lnho9Nrdh0iZj+sIcDreVJ+hJmXgvb3+nChIa5L2SACPJr1ip3SC34tLB3q4DsIBoGdmwjPmNnMg+SXiDO5CCfkl47akllUhcH7uJ2NcKUl7bWixx8jL+k0cpySKiagsyNP0s= X-Forefront-PRVS: 054642504A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(366004)(346002)(396003)(376002)(39850400004)(189003)(199004)(174864002)(50944005)(24454002)(13464003)(55016002)(6306002)(229853002)(3846002)(9686003)(6116002)(23726003)(1076002)(106356001)(105586002)(16526018)(316002)(50466002)(16586007)(58126008)(25786009)(4326008)(6246003)(53936002)(66066001)(47776003)(53376002)(83506002)(5009440100003)(478600001)(72206003)(966005)(81166006)(59450400001)(33896004)(386003)(52116002)(6496006)(76176011)(2906002)(7736002)(5660300001)(2950100002)(33716001)(8936002)(8676002)(42882006)(68736007)(305945005)(6666003)(81156014)(114624004)(97736004)(107986001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3462; H:Pavan-LT; 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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3462; 23:T7vZYbD0ntqfMSsz1YwrTLy53mUhMhf2Z3qTfIXxW?= =?us-ascii?Q?lRbbV+gornSUFld1gHSkhLiNVZn/jmp7uxveDivzVIZ8dlc57Kb9Gj02HwSf?= =?us-ascii?Q?x9Ah2xGtOzWcGGSBFGvC0g75m5nI7qjYYFtU2Cv4JJxxUXuWKTScZ83NOIRU?= =?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; 24:fpIpcBzGivlTHPHkIfLoeaiJFagd6ZO+5r9Pjb5P1LfXz3Rku3tgdYA23ckRcz+2dNxD66NbbllGuXJkegDRHBZO9W4qy/2GHG9odzqmo4Q=; 7:XPJVfIgQhPQzE9P4RuJh4fvla0+YpPO6ojvaZR3Q6RuobGC0Rb/zll23XxW/ztHqJtFSIrqSedAg0siuXQGT+6njh7zvM4up3gjYdgJLiRemw7v1lCiM6FdrCv+MOwLtTy/OUVuEmA4xF5IpgXhkOmd+Tk79S+xrMG7Vxr454wFVn2qDi2/woFUbHMys8ZgI1zZK195yslA2aRkUAaS3tQ00Dam5rgSokET58Lj2anOhfZ23At7fleceVpPnbpqq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2018 11:12:48.5331 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 394c39c3-8a7a-4680-6405-08d55688c1af X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3462 Subject: Re: [dpdk-dev] [PATCH] 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: Mon, 08 Jan 2018 11:12:53 -0000 On Mon, Jan 08, 2018 at 01:43:07PM +0530, Jerin Jacob wrote: > -----Original Message----- > > Date: Sat, 30 Dec 2017 22:07:54 +0530 > > From: Pavan Nikhilesh > > To: bruce.richardson@intel.com, bluca@debian.org, > > harry.van.haaren@intel.com, jerin.jacob@caviumnetworks.com > > Cc: dev@dpdk.org, Pavan Nikhilesh > > Subject: [dpdk-dev] [PATCH] build: add support for detecting march on ARM > > X-Mailer: git-send-email 2.14.1 > > > > 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 > > --- > > +cmd = run_command(detect_vendor.path()) > > +if cmd.returncode() != 0 > > + message('Unable to read midr_el1') > > Instead of this "unable to read midr_el1", We could fallback to > "message('Implementer : Generic arm64')" message > > Some thoughts, > 1) From the Linux documentation[1] this sysfs entries are available > from the kernels > June 2016 > > [1] > What: /sys/devices/system/cpu/cpuX/regs/ > /sys/devices/system/cpu/cpuX/regs/identification/ > /sys/devices/system/cpu/cpuX/regs/identification/midr_el1 > /sys/devices/system/cpu/cpuX/regs/identification/revidr_el1 > Date: June 2016 > Contact: Linux ARM Kernel Mailing list > Description: AArch64 CPU registers 'identification' directory exposes the CPU ID registers or > identifying model and revision of the CPU. > > 2) This scheme is not available in Freebsd. > 3) I guess, we anyway need a meta file to store this information for cross compilation case. > > If so, > 1) Can we introduce something similar to T= for cross compilation case and > use the same scheme to override for native compilation flags if required. > 2) If above scheme is not chosen and > a) if /sys/devices/system/cpu/cpuX/regs/identification/midr_el1 avilable then derive > machine_arg based on that > b) if /sys/devices/system/cpu/cpuX/regs/identification/midr_el1 not available then fallback to generic arm64 compilation. > > Thoughts? > [1&2] Agreed, when midr_el1 file is unavailable should continue with generic arm32/64. This would cover freebsd too and if we need we can use the meta stored in cross compilation case for native compilation. It would be good if we start agreeing in directory structure where cross-compile meta files are stored so that we can start adding and experiment with them. The meta files would have info as mentioned in http://dpdk.org/dev/patchwork/patch/32410/ Thanks, Pavan. > > > +else > > + cmd_output = cmd.stdout().strip().split(' ') > > + message('midr_el1 output: \n' + 'Implementor ' + cmd_output[0] + > > + ' Variant ' + cmd_output[1] + ' Architecture ' + > > + cmd_output[2] + ' Primary Part number ' + cmd_output[3] > > + + ' Revision ' + cmd_output[4]) > > + if cmd_output[0] == '0x43' > > + message('Implementor : Cavium') > > + dpdk_conf.set('RTE_MACHINE', 'thunderx') > > + machine_arg = [] > > + machine_arg += '-march=' + 'armv8-a+crc+crypto' > > + machine_arg += '-mcpu=' + 'thunderx' > > 1) Instead of changing the code for each Vendors and the multiple > variants, Can we put some framework to just define this information some > where? > 2) Please add the another mcpu variables for the Cavium produces like > 81xx and 83xx etc > > > > + endif > > +endif > > diff --git a/config/meson.build b/config/meson.build > > index 86e978fb1..fe8104676 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_arg = [] > > +machine_arg += '-march=' + machine > > > > # use pthreads > > add_project_link_arguments('-pthread', language: 'c') > > diff --git a/drivers/meson.build b/drivers/meson.build > > index 9b5039847..f5009aa2e 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_arg > > 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..88df650cf 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_arg > > 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..3c98efa70 100644 > > --- a/lib/meson.build > > +++ b/lib/meson.build > > @@ -31,7 +31,7 @@ foreach l:libraries > > sources = [] > > headers = [] > > includes = [] > > - cflags = [machine_arg] > > + cflags = machine_arg > > 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..493bcc313 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_arg > > ) > > -- > > 2.15.1 > >