From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0051.outbound.protection.outlook.com [104.47.34.51]) by dpdk.org (Postfix) with ESMTP id C5128324D for ; Mon, 22 Jan 2018 12:47:50 +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=IK05xmkYbC6pqgcSombSmKb6N0O0lih+1nO1ogH6drY=; b=bu76DZl5qW4Oyvwx7Snp2mrIQ5SoJ+Rh6Gr/8icxC1ggf0qytsdO5Vob6my6McE9Z2hHS1L7Qnj/y5CxtzL/Gw7M5z+fJ9N+neyfUNFoYWUG6HjXhBUm9iqNPn1OjE63EVunnDfMVkPGpav83xRUtcKdQElQSQFujYgMP9SiTkE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Mon, 22 Jan 2018 11:47:46 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, herbert.guan@arm.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Mon, 22 Jan 2018 17:16:48 +0530 Message-Id: <20180122114649.5907-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171219105338.198727-1-bruce.richardson@intel.com> References: <20171219105338.198727-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SG2PR0302CA0011.apcprd03.prod.outlook.com (10.170.129.21) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 634e4038-ee16-4b21-2fc5-08d5618df5f7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:d88F9+p0BDaDga0ib9IqI7Wd4ZQ7nszu9yf3VNvLmv8miG3vKKfuhUDdcdIigKt0GdbW+MUYPGonhbUGUSHX6FA1o64IC478lQHS3jtI+vE2clihAIbDg8R4spxZfb1KsJAi7lQaUu26f6FnScINZ+KOmQeLyj/8plBGwysEdB4KzTw0cqOwPH+bJGB/YBsUdhI7pNWCub7kaKPPpEmrdoRJ1Ekj3cH7uONFsuWTceaWIitIC4YErL0KqZYguZpy; 25:D4S3BUvIjbtr5zc0uCv7WtpO8YLj9m30AE46nerEjXe+xhU/xxm2v/cq3A3QlDh7xZS9tHa7vDKS6CbgZEPjX4+UzdrF3eRTaIhdVmyke+TX1CGxZqm+QQAgcrJi3ZDP1Iu2XsogH7lGtCeAm8xmGzl1+XjiJ0lacR+PMo83RyCBqgtLbyRnzJ0pAxMHCHxrMeVwj0siRxstkJzvh2MeVBqs6Ui67/amErKeEaq+ZIIJHHEBOetSUGtLvZNyvJtHXCseNlT2GP72wjj7VffdfiH1QZO5ywP6cYbafpeXBz1Rnc+2VdiNgoEMQiMR9rUhgmgczFgDGPPVJ8qe9Wp19w==; 31:7fGV/0XD74MnHtTPsFBh1LlPVzyBGVGcoj20Ln52imMM3WEl4dx/eaqjdcsDf6u9tTc7ceTBlNcSjj0x6g9M80UkTyshc4p1wgUURzhmULzvua34mGFCdOoa3iwET7+hymfCJ/d5cKapiNZVNnL+nx1C6DQr2AhtVkMI6LZq3x5Kf49Z0y5YwAywizC9xif7Sqlu4Vq1FTZEW8S13rjP0OOSSRgFPRC3cQZYtVOhJRs= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:U/6Y/z1bvIOWmCsTkQV2+HfBFiTsIw6AQ95eIpMkYimDnnnP5rk9DJCxq/Fxq7ID1nS47TNSodzkdgxJQyjRHZ0tDOajISqbP8H7aDdA543KBWf+D6ZIMQ/BUabt9TU4wbkOF6N+A7k0Zeo77WEMg1c8LR/IYkOYBV8lRQR3HbN6R1soa3X8uMxMsMNOPdc6wXAkGkVQfcg6CL4sL/8ILMsaeM2PRcJej6+z8PGHbJQWKrDCZrZIKz9s9rNeKU8lp1yMdfFel3vuswN+nBRCmiAnTITNJyQL7SMUUrWzKpCYRAO6eYuRWjVxV8HG3qoceRjyA4lAL4K2Y+DrGS02LrLU/eki3u2CNv5I1DH5s4MDkAT7tiP2qvhiFZih2s9XqD1a+HWrCwliWSdloAs92gbh1e8tbHwJSQiHi2t6cEuUQUTA9ghs29rDmSZqoLFEfyDxj41YTvFUncb0UCEuQ8mrKF+Dw0X8VbctJpuHMIGgrT0/V08qwdNX4c6oSIuzecU/cMnCNuuokFFwKxBgxeqViSD5u64WNXSwP6uA6zvEOhLwpPIJX0/Ohu/sXJT0uEYHKdMqG69EcS/WB/OxD+CgeI7HjZgjCcfSLcUOohE=; 4:Mp6Hxe0imNm5bMLTUuYlRtE1Wb8Dsxf3diUFiYiKHn4YUcgLS2HiDB5jUL/2nixkIXRftJPY+VAH4qzGGspaefjk/A5YN3OOWkfioA/wk7/VsY7PtGvIdz0P6lB3uNUGfnPrcnaAJbDfDAwbcedUjh/7otmjnaQSoTDvL/DcAdFhSUe7oA8oHa2/tZSoEf9bmmYhd61ViKGjpwDWHNP/1gRMEkX6t0RzutqNmqOCMMwz6x5e5wyn+UJf/DEFup8pF0J7rKuuqfIcq9K2TnIN6lgo9Dh9FejVO57e9fq0fxNWY0Po98eMSUAB3VUu8Gli X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(3231023)(2400081)(944501161)(6041288)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0560A2214D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(376002)(39850400004)(366004)(39380400002)(396003)(199004)(189003)(106356001)(47776003)(66066001)(7736002)(6116002)(8676002)(81156014)(3846002)(26005)(6486002)(2906002)(8936002)(5009440100003)(50226002)(1076002)(25786009)(305945005)(81166006)(68736007)(53936002)(36756003)(107886003)(6512007)(4326008)(2950100002)(8656006)(42882006)(48376002)(72206003)(52116002)(16526018)(97736004)(76176011)(51416003)(50466002)(59450400001)(386003)(6506007)(316002)(105586002)(478600001)(16586007)(5660300001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; CY4PR07MB3464; 23:0iPb4BLXUWU2/Gb2ymkTTnVlGu0xB40JgPfyfVMHv?= =?us-ascii?Q?3vQgoAdM6YBQ/c3NByiuUlSFO8etJtwTWI6Xx0wS24CxqZ9WFynn9jzejVlX?= =?us-ascii?Q?s+lDyv0a1AkRvrKyG3bHTRmIxztXC2Srz2Ing1rAeg4m3twYLEKdYEFl6T4z?= =?us-ascii?Q?5MhoPoP7RdeTmujTo3ZRx3c/MdYWCMJSCnrUqDQ1WVMrKpApxT3wYVBK20h7?= =?us-ascii?Q?sGv0DQbKlazbV67pJB73NdLM3taTHXYd1OR1I/ZHwl+EfkOCMozk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+4Eh7OlPT3Td7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2018 11:47:46.3787 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 634e4038-ee16-4b21-2fc5-08d5618df5f7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: [dpdk-dev] [PATCH v5 1/2] build: add support for ARM builds 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, 22 Jan 2018 11:47:51 -0000 From: Bruce Richardson Add files to enable compiling for ARM cross builds. This can be tested by doing a cross-compile for armv8-a type using the linaro gcc toolchain. meson arm-build --cross-file aarch64_cross.txt ninja -C arm-build where aarch64_cross.txt contained the following [binaries] c = 'aarch64-linux-gnu-gcc' cpp = 'aarch64-linux-gnu-cpp' ar = 'aarch64-linux-gnu-ar' [host_machine] system = 'linux' cpu_family = 'aarch64' cpu = 'armv8-a' endian = 'little' Signed-off-by: Bruce Richardson Signed-off-by: Pavan Nikhilesh --- v5 Changes: - Use generic_armv8 config when script returns unknows machine args v4 Changes: - use set_quoted to set config instead of explicitly using quotes. v3 Changes: - Fix missing SPDX license tags v2 Changes: - Merged RFC patch. - Added framework to easily other vendor specific flags - renamed machine_arg to machine_args config/arm/meson.build | 36 ++++++++++++++++++++++ config/meson.build | 4 ++- lib/librte_eal/common/arch/arm/meson.build | 5 +++ lib/librte_eal/common/include/arch/arm/meson.build | 29 +++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 config/arm/meson.build create mode 100644 lib/librte_eal/common/arch/arm/meson.build create mode 100644 lib/librte_eal/common/include/arch/arm/meson.build diff --git a/config/arm/meson.build b/config/arm/meson.build new file mode 100644 index 000000000..f05de4c2c --- /dev/null +++ b/config/arm/meson.build @@ -0,0 +1,36 @@ +# 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) + +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 + dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64) + dpdk_conf.set('RTE_ARCH_ARM', 1) + dpdk_conf.set('RTE_ARCH_ARMv7', 1) +endif + +if cc.get_define('__ARM_NEON', args: march_opt) != '' + 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) != '' + 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) != '' + dpdk_conf.set('RTE_MACHINE_CPUFLAG_AES', 1) + dpdk_conf.set('RTE_MACHINE_CPUFLAG_PMULL', 1) + dpdk_conf.set('RTE_MACHINE_CPUFLAG_SHA1', 1) + dpdk_conf.set('RTE_MACHINE_CPUFLAG_SHA2', 1) + compile_time_cpuflags += ['RTE_CPUFLAG_AES', 'RTE_CPUFLAG_PMULL', + 'RTE_CPUFLAG_SHA1', 'RTE_CPUFLAG_SHA2'] +endif diff --git a/config/meson.build b/config/meson.build index 95223042f..fa55c53a5 100644 --- a/config/meson.build +++ b/config/meson.build @@ -56,8 +56,10 @@ endforeach compile_time_cpuflags = [] if host_machine.cpu_family().startswith('x86') arch_subdir = 'x86' - subdir(arch_subdir) +elif host_machine.cpu_family().startswith('arm') or host_machine.cpu_family().startswith('aarch') + arch_subdir = 'arm' endif +subdir(arch_subdir) dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags)) # set the install path for the drivers diff --git a/lib/librte_eal/common/arch/arm/meson.build b/lib/librte_eal/common/arch/arm/meson.build new file mode 100644 index 000000000..c6bd92272 --- /dev/null +++ b/lib/librte_eal/common/arch/arm/meson.build @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2017 Intel Corporation. + +eal_common_arch_sources = files('rte_cpuflags.c', + 'rte_cycles.c') diff --git a/lib/librte_eal/common/include/arch/arm/meson.build b/lib/librte_eal/common/include/arch/arm/meson.build new file mode 100644 index 000000000..77893fa35 --- /dev/null +++ b/lib/librte_eal/common/include/arch/arm/meson.build @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2017 Intel Corporation. + +install_headers( + 'rte_atomic_32.h', + 'rte_atomic_64.h', + 'rte_atomic.h', + 'rte_byteorder.h', + 'rte_cpuflags_32.h', + 'rte_cpuflags_64.h', + 'rte_cpuflags.h', + 'rte_cycles_32.h', + 'rte_cycles_64.h', + 'rte_cycles.h', + 'rte_io_64.h', + 'rte_io.h', + 'rte_memcpy_32.h', + 'rte_memcpy_64.h', + 'rte_memcpy.h', + 'rte_pause_32.h', + 'rte_pause_64.h', + 'rte_pause.h', + 'rte_prefetch_32.h', + 'rte_prefetch_64.h', + 'rte_prefetch.h', + 'rte_rwlock.h', + 'rte_spinlock.h', + 'rte_vect.h', + subdir: get_option('include_subdir_arch')) -- 2.16.0