From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0053.outbound.protection.outlook.com [65.55.169.53]) by dpdk.org (Postfix) with ESMTP id 213BF9655 for ; Wed, 3 Feb 2016 16:36:48 +0100 (CET) Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (122.167.162.141) by BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) with Microsoft SMTP Server (TLS) id 15.1.396.15; Wed, 3 Feb 2016 15:36:43 +0000 Date: Wed, 3 Feb 2016 21:06:23 +0530 From: Jerin Jacob To: Thomas Monjalon Message-ID: <20160203153622.GA11424@localhost.localdomain> References: <1454453993-3903-1-git-send-email-thomas.monjalon@6wind.com> <20160203133810.GA7359@localhost.localdomain> <2567498.ifnkeR5xCN@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2567498.ifnkeR5xCN@xps13> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [122.167.162.141] X-ClientProxiedBy: MAXPR01CA0054.INDPRD01.PROD.OUTLOOK.COM (25.164.146.154) To BY1PR0701MB1722.namprd07.prod.outlook.com (25.162.111.141) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 2:TymgHBR5BDUqtneUFIage2I95DQpCR9+d2At04lGhqal+NIp2XSuNccKbOj+EvuWkMvIb11ckInT7a+Nkp24ga4djH+Ag9MzRieyCBkrwuOuZ0jCIeCzabYh7fqGqfzbmaAUB3uo6RanLsNZ/gPBbg==; 3:LqTx8YUpsJM1GiEahsqE81pPV50xMnOaCjBS5NqdH9yVrJAOCfZ7sKq7U+SbFTXmmQPexgokiOizuCaT3p4XlPChr6Rwon3dlaW1HSubml+UXQ2Dj8XMJjjlohwuL3tp; 25:OyuGy2W2x87qqP64opTIbXrNe25yV8Fdax+np9QJpDwCo2uGbMivAen50GDLNhpC+9fARXX4AFnkjgNweLzlV/JIZvoZzKI+6JbxyIwKNojh85qsyONJENTd3uuKrxeInMKGct/mTqWPqn8o3gCBaPWeIMgIpU34DHyZb0S7SKZtYaWPQCZ3iQYRrh+PPKz/1yqCquD+hTh6wMjdQqrrN3G2K97wBqgeWWWviYFvYRO85meRjjzhM1fp+98xE4gd X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1722; X-MS-Office365-Filtering-Correlation-Id: 3e07b313-d5d8-42e5-544c-08d32cafd2a7 X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 20:Z/klA4OH24GLYN8PRZawyoSdPVwfuOdXhfQMMlDU1WffXd8tuW2EkqtiP7Y4AdYj/VrU+Qdv3YvAfl7mlVEbx0Q003tdliwrDB2ovP8lF22OEKEVrXfFPpw5+T/iHMPRG/2IGJIdj29ohKQXKECIF87SFe/8v9l14Zj6jtreLCsUp/b4z+/dci0CCWFXKdhjhdmByIf0LszPbb1KvlqeqYCO5WrWKA0A4a73pzePDoqdJ5mn3ru73EBcBVunrG2niJjByQEbxq65MV6/kC/r0NeSQLED4mNB6HcHAFDm+2ZKtZBTQEnqxbqHuvh9T3sa1/D8mbyU8zNjXCMuzHIUluyxV2ofKy5w0quEi8pgdWl63eNL59fmMBEhwUqKjSBLYB5i1giYZGLxWCRoamvQhz8c5QHYscCO5PLM+wQ9nOj/p7CPac6OQ+s4sSK2uX278HOvlbjCucI8fZBISHmmh7dGW/WRVp5WKMxxE6W/NdNP6V1SnHCskGhZVxZoBFatE8ZzBgVaDRy3biRKAUWQh5IbCwbSA9yHGpg1owUfQO+H0VwPrYO8yjyGCYrZIg9zcxSnNJf8lcK+UgF2Zyid4DmgUZGnHSzGX6hITAsKTxU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BY1PR0701MB1722; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1722; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 4:WHAH/xAvuAeYlJwO31o1qV7SCuLQQch18nNWZH6KCe24RhATDAx5AtiURNVuKvv6tbTUvV33qd+27Ygqhz+XXlfNC5SK98FcV6QuWa2NUY0GgPlPdqtGsBXlA+yqbZ8Ct0GAxur9BpemMJN8grBtWDX90G8ysj0XI5kHyd1WoooBY+FBUkDsY5X9W+00HoOLsp2yCTYTvz+WhOWeREjp8E68yLo9b47pfMVj9ie4P69WYLitIXZye7kuAxb4zGSScep1jI6ywTL5TzHJo2wTgVgdYWYiQ6pdZS//JbH8NGoKfYUSrAhGSHBSl3954+nAJd0Siqte3VyLg/AZd0/YvGbcht5iKvSbLNCHTuSbS91u3g0c/bufgCFDuYWrHcWT X-Forefront-PRVS: 08417837C5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(377424004)(24454002)(61506002)(47776003)(50466002)(92566002)(66066001)(6116002)(19580395003)(5008740100001)(83506001)(110136002)(3846002)(50986999)(5001960100002)(76176999)(46406003)(23726003)(586003)(189998001)(4001350100001)(54356999)(33656002)(122386002)(86362001)(1076002)(4326007)(87976001)(15975445007)(40100003)(575784001)(97756001)(2950100001)(1096002)(5004730100002)(42186005)(2906002)(77096005)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1722; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1722; 23:Yfy1WhckGKEsL6m00grQ4Wy3N1dLHFA11HfCMv4?= =?us-ascii?Q?GXob6oIKFC47DvllU7nVr3ODsYozobb8XgASkiNKv+y0O1C+F1t5g5KSJ13Y?= =?us-ascii?Q?J8zDPFMkqcslYBu3yt2VKD6/NIiSA2laMvntDk6s464tzQJGvvnhtNdejE2E?= =?us-ascii?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EssPtW5oYK3IF6+X2RRmH7uwJh1S?= =?us-ascii?Q?Odq8spUdiEwHjhjLQ8t/XO34yxMSPK7t8JqrWtf+KW2kc3IioQQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 5:vjRTgy4yK1IsoML3CtAtxkNXMIJXuK4JDoJdLphXrlmdQwdlZqWzBthCaFpELP78Hpqv/Fq7U2naaIpqKs8DhRaTXagC+/6EhtdMj1eMeDpck+axHY3gR87fuk0FeFU3wGgoNj4fWHJdzRl/Ee0Cgg==; 24:cnf3cOF7BnrJOyh+g7GZ6rKsyNvvl4ngyurkbRgX/XAapodyTfdVK6sC3AM60K4JVWevX0sdvrHX/fGMLwrMmQ5IE5OGeqfQ8XjcNroQrVk= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2016 15:36:43.0388 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1722 Cc: dev@dpdk.org, viktorin@rehivetech.com Subject: Re: [dpdk-dev] [PATCH v1 0/5] clean-up cpuflags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2016 15:36:49 -0000 On Wed, Feb 03, 2016 at 03:01:26PM +0100, Thomas Monjalon wrote: > 2016-02-03 19:08, Jerin Jacob: > > On Tue, Feb 02, 2016 at 11:59:48PM +0100, Thomas Monjalon wrote: > > compilation errors on arm64 too. > > Yes I forgot REG_PLATFORM. > > > arm64 toolchains are publicly available @ > > http://releases.linaro.org/14.11/components/toolchain/binaries/aarch64-linux-gnu/ > > Yes I know, thank you. > I will test and make a v2. > > Do you have any comment on the changes? looks good, nice cleanup. IMO, Something like below can be done to remove the #ifdef clutter in rte_cpu_get_features for ARM introduced in this rework [master] pass2 [dpdk-master] $ git diff diff --git a/lib/librte_eal/common/arch/arm/rte_cpuflags.c b/lib/librte_eal/common/arch/arm/rte_cpuflags.c index fba0a61..861ac57 100644 --- a/lib/librte_eal/common/arch/arm/rte_cpuflags.c +++ b/lib/librte_eal/common/arch/arm/rte_cpuflags.c @@ -71,6 +71,9 @@ struct feature_entry { [RTE_CPUFLAG_##name] = {reg, bit, #name}, #ifdef RTE_ARCH_64 +#define PLATFORM_STR "aarch64" +typedef Elf64_auxv_t _Elfx_auxv_t + const struct feature_entry rte_cpu_feature_table[] = { FEAT_DEF(FP, REG_HWCAP, 0) FEAT_DEF(NEON, REG_HWCAP, 1) @@ -83,6 +86,9 @@ const struct feature_entry rte_cpu_feature_table[] = { FEAT_DEF(AARCH64, REG_PLATFORM, 1) }; #else +#define PLATFORM_STR "v7l" +typedef Elf32_auxv_t _Elfx_auxv_t + const struct feature_entry rte_cpu_feature_table[] = { FEAT_DEF(SWP, REG_HWCAP, 0) FEAT_DEF(HALF, REG_HWCAP, 1) @@ -115,6 +121,7 @@ const struct feature_entry rte_cpu_feature_table[] = { }; #endif + /* * Read AUXV software register and get cpu features for ARM */ @@ -122,11 +129,8 @@ static void rte_cpu_get_features(hwcap_registers_t out) { int auxv_fd; -#ifdef RTE_ARCH_64 - Elf64_auxv_t auxv; -#else - Elf32_auxv_t auxv; -#endif + + _Elfx_auxv_t auxv; auxv_fd = open("/proc/self/auxv", O_RDONLY); assert(auxv_fd); @@ -136,11 +140,7 @@ rte_cpu_get_features(hwcap_registers_t out) } else if (auxv.a_type == AT_HWCAP2) { out[REG_HWCAP2] = auxv.a_un.a_val; } else if (auxv.a_type == AT_PLATFORM) { -#ifdef RTE_ARCH_64 - if (!strcmp((const char *)auxv.a_un.a_val, "aarch64")) -#else - if (!strcmp((const char *)auxv.a_un.a_val, "v7l")) -#endif + if (!strcmp((const char *)auxv.a_un.a_val, PLATFORM_STR)) out[REG_PLATFORM] = 0x0001; } } Jerin