From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0048.outbound.protection.outlook.com [104.47.42.48]) by dpdk.org (Postfix) with ESMTP id 7C6051B2BE for ; Fri, 19 Jan 2018 19:25:22 +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=JRuUSPat1yDwDRP5DH2t7PnSaGJmnEV7gxYxIIvH7zA=; b=CF/Fq2d6YxjIfyNnqo0z9btfXIJKSwOLsFuEHjM4zs8DO1nSMVxuB+k88WA0is82wsfmhvzSQ3ENt6BvsqeQTP20Bn05Ikka01sRHDCV1uLiiXspHtfTdm02gJWxVD/O0z7ANjolDBaUtY2AJwyjqaE3LH3OyNL3XgypuwGAM5c= 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; Fri, 19 Jan 2018 18:25:18 +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: Fri, 19 Jan 2018 23:53:48 +0530 Message-Id: <20180119182349.21935-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: SG2PR06CA0105.apcprd06.prod.outlook.com (10.170.138.31) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d6cbf5a1-2a67-43cc-ae88-08d55f69ff6b 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:bj3umsBh1iwpXy1tJXYx9EdfPQPmOAPtWWcwCytJpXGON1VdneF58OZIpDyzqGVfhu6emxykUhyYba4jiVj2XpAnnN+sx4eN8rGrDJSpYyYj8w1tjdhrkwZoihbHCmWDe0AVlgfFr0+mlc1yqrCTzbRnt+VOWLrEE+fnLpltGiAiO6s8kUMAS3nf/5bK0yzEzrhkVw+/MTvfc/lCogxuV3K5p9UwytoLD7VMlXtVb1rVC7She48vBAttD9HeYlvy; 25:BKsEC83tLluYU6ZIEi4tPiFh4OCZVUWRqr+ZnAQFxW9+TOkuaMhkfDMVdTTUmhAO0l5R2kkX8MUrELd0e8f7eGO25q8wY74o1RbSVdCrF3bGB3BUogZVTy8Ywr3FIGaqsJIh1ocOKjbJ5HkHsl6MRjSHEBMFq1JhthPVlu2gHjBZLoy2vQOI++a1zqu41vHzEujzikWfkLQqkRETy8OTyF+fshiWuHzpHagHoDo6sC8WDIms3fZOYhjrhppGA7+IMbS2UWIm6Jl81EO9RpXEnqR5fDlh0d71NQGRUTZerDRYvostykKj6GzFQ9HVjjAzsyaXrd3G7Z6FsgHq3aDChQ==; 31:oZnMeKfB5LUi3kopMQdyNqAfoYRn0OvC2owccUnbVtAVHntjdQHRYxjvCL2OPfo96EOB/D3oGWvHggPB8BjbQYHm+YgbHaxzkeFlxomnc8aq33aRRkYnxhKZWz3AJk6p2kPVOyCRMg646y50+PgZNptXWMCABYKD9Ha+8kg06dmpJ50x+iH0iPSQHStjZbjiDL6XJVUtWo3fD6KmTJXwyApir6Nwu6XMdsuDQlgMuDk= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:hOaaHcVAXvniV/zFPg4W3+yCUB4H7sX2uPqdsTFZxKETQ52BeTHsvE3DrOuOaX4THOcODu99rYKDjOmBxicHlZHqQW95NQZRl0wvo/fsHrU9M5C9xJdhzb0xkr9K4uUoQBQScjuADBWQEM7WJW6YUtO6hyPpgDmXUh0wpW2XmZ4p0OyNvWA5zQSmYILL29QJbRlY0vJ5MSZucata+YRtQl24+VNZ/++NAcAYL9eTeUd7HKHvSzkYFFDiOGIofnWaopWohZvFH6d6Ecv/J2w/47j8TPuT4kAqLoK5ehCM1JuEM871Gv+ndwCkze0mUZSQRUH7pKDBgVqPr7hffXg46WwNPjt/3SweghjvO107pJIQ+GjKOP0YSm8SuXSL66x84XHTbCVn4S2I7eV9QqcB0Q9EGhgA8PeGyLQEeosNAJtwdrvfgqC8uuILyrODKgsVymRRHm3/0Rw8fZA3pfrVyuC4i6VfizjwK9j+S5ZnE0icjoCEDwzhLjcW5pyMxEdT61Y0JMV3m3Nn7TE7ZAlFq0o1SOU2BTbLIc4VeLo7sCt9hc3y5d3TK+LXSH5HYbWU+V5oiIIQqqkjOBnJIMm7aFxxL13T3KC0ty1htHrTFHY=; 4:QckWShIkW1H/AQQmu9v+yAFgOpu+dEtASGyZbG+NJLwIJFIP+JCYjySW+ryYENmV2Kp9cjOGyvzU38deqWTC+PhDHDWOvx6fJVv8b9t/SgNiyusf5lS5lJVyd1qT6bR06CqW1DtmFjdjysWIm5aogZnvRJLVxFmy5IhDwpgLWmvXkmjTVAPhPyMrxh5dICInTR6jvxqfsYwSmbJf0QeIeIkI4I0227oF8l5Q6x4pjfCbSb0iKi4LdGMLkWdAdOnFfyelxmXZa4uIo2gRLtgfJk6EU6f8nfFWlIrz4a8ixpwRjDKI6J4KuSHA3AApgPT9 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3231023)(2400081)(944501161)(3002001)(93006095)(6041268)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0557CBAD84 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(39380400002)(39850400004)(396003)(376002)(346002)(366004)(199004)(189003)(5009440100003)(2906002)(107886003)(68736007)(50466002)(50226002)(81166006)(8936002)(4326008)(48376002)(66066001)(25786009)(26005)(72206003)(8676002)(81156014)(42882006)(2950100002)(6666003)(51416003)(6486002)(52116002)(53936002)(6512007)(386003)(16526018)(47776003)(478600001)(316002)(6506007)(305945005)(5660300001)(6116002)(3846002)(1076002)(7736002)(76176011)(97736004)(36756003)(106356001)(105586002)(8656006)(16586007)(59450400001)(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:FHmIAbrsUuP2uMb1xfTVipJIJ6c4DKwvFNInU+cKH?= =?us-ascii?Q?+0twuw5QuF0mbp1WDEXQkbqyqLrVMhE0BvBLOV7vLBeV86iDeaP/KwLR0oi+?= =?us-ascii?Q?+F9ZM0Szs1yyzyRMlk6nWA0vgng1YBnfoVuD9e2FdVCOZYRedFmb19FbQWtP?= =?us-ascii?Q?uIb8hgwjynU4JUyr+z4D5UYWrk7CanMj3sM2bzJLsno2wqXINujjY+kzW0QC?= =?us-ascii?Q?Lfp0rQkV1V4UAyYBYPdGqvSHqa8mmsDGmYFAPGSdUUkCGmB/GBSAVFRVVt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gyz6zoJQr563MJIZ1Z0aheQBTGYb9fcW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2018 18:25:18.0026 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6cbf5a1-2a67-43cc-ae88-08d55f69ff6b 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 v4 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: Fri, 19 Jan 2018 18:25:23 -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 --- 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.15.1