From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0059.outbound.protection.outlook.com [104.47.41.59]) by dpdk.org (Postfix) with ESMTP id 3AE1F1B33A for ; Fri, 19 Jan 2018 14:53:42 +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=Kuz0Vuq9gxuS3Ye0Bmw7Bk4HAqTAkfoukKvP1XYNkog=; b=AsuOgYtSAePxUsuKRZ+TUp+umHVeVH/7ms2bswGLgTPNWwZ8iWyrAaS76RyOXt+DICcbnXt4Reo9/7vuqqAOcGBnL32Kzj4l+C+ZvlhszCaStwjhLl2ClJbaAx1EejURW6Fv+0ATjS5/3B3uVHXX1yaTKNP68K0BHUtk3GTeCC0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by MWHPR07MB3472.namprd07.prod.outlook.com (10.164.192.23) 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 13:53:38 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, herbert.guan@arm.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Fri, 19 Jan 2018 19:22:50 +0530 Message-Id: <20180119135251.10171-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: CY4PR19CA0044.namprd19.prod.outlook.com (10.172.173.158) To MWHPR07MB3472.namprd07.prod.outlook.com (10.164.192.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f860bfa3-ed14-4e7f-9f12-08d55f440bed X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:MWHPR07MB3472; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3472; 3:XtlRs5LrcixX84keXKYIygEpfX9cg5eIxCHhN6/r3xXNxXpwCQYAgPnge3S69HcFZJkrkT0PwBvzG8KuDLn7haxlofKmYOM66x1e44Hv6XKSNOiK+wrLmWimbHcPlQ+8O1JKBKrvTCNEmhxxSXdXLQYugrH1DPqoWVow946GiQdkNXjOkPAvh41P/U7qxy8nzi39Oc5iOt3iWnSCpbNtX6UczUF9xKOBqpzXfEuV51EzW8Or1OBqagQliIyk/F3Q; 25:/W09WiwO/L2ZyQeg9N3/qOd7Cj1+CHfpJZBiaz8IZIY8w39m7exp4+v/sIqYLdVNf9+q8e8WOh7IK6jIQcViMOVHC2rNPGyd8XzyasvolsKXWAZHe+KtaHFkBMTfkMSDrVzQT2b6NK1sncBuWlRfK7idiuviTPEyKEWZs9vUpEvy73IQ4yDDk9Y/ct3vXTshptVqDyrbPR/6SgaIUrLSHaALCZGyvViDLCx6BeI4qbUhX1C756ICNuWDSe03UGjXgKyCRXc+ZuTcFEdxHt1PG+xnKC1cm7czX/gS0SjxFVgj5hM1CdGvz9lXuduTT1I24tBvePQsKMEexA0s6kGumw==; 31:RtuHCH6kErpPmzgyg6NYjjxW8BJlkSmy/AnMd3hY6rFNaldiD7tXp188ttonHqaWDlWmD2s5gG3r9DfuvXlZFgYt72wd79XqCDsKy3jZCgU9luog5Rsonh00yzxjI2WXi76ecnTuBkD1DjAZgngBYxP0EAlr5AnMVyCkrjcM15gxN/vX9g0XzRpZpy2B1p2lrfmkIl6Il+4T4HFKIgZfcJlqZiqNaCg4qbTyjqjLju0= X-MS-TrafficTypeDiagnostic: MWHPR07MB3472: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3472; 20:wkB15HGBQ9Dv2ZooOZMufGfxHj32Dsz3Z62vauCh7uVG3M1ujYXY3qtDqNLRr6dKhhNSnZ0yixi2a5pEPWLu+XKb29sX/aim+cD5D9QG6AZpIYMWCZX3FCR19nlOl2lfimY8bdJWZRy/D60rHx79b/NyiU2oDds+Yfpolfam0qhLlCyzdStdTrmjpgnoSqnhhZOJrxr7T0KcStaEWDTgYMZY4tZWL/X7X6Z9MXUA2yXNvCCyC3r/iYp2ybe7UBW/pL4MheXGy3OhA4jt84tzOSDMS/2zdO7JvFCtYQLlSyPUba0uaoU4vaZgRGKrqCosedhwOvzgCdNP+tq3GlfzhodkLBA++wiXw43HB+nJrLG0mn8coVLm3PknKgL+zW4gZD9aYQypKpCHEbZnfqTMrLF7rvS10cN8DeU9XwlFhIKlfUZmDBeNTBnHmYLD2x2q18JrSFMwPqxc0T1/xjMXab3OuVLyZxviv8eI5tiTd138uADcyyyMcV9OsCC2FiGpjWc8RxJoIYXdhfX70js6PjPCia1GQ8iaw8dCegqfKEOLWhZBR9IOi2ANUb7yxIflOqvG+zHNBqhNL2tk3LkJeKyC5/A55Gxauahjis6rvjQ=; 4:DQOieUNHfh9Ttl+TJgDq1UODqtJjEsLe66WKsNJfzTDJs0L8In7QWOP84pHAIjPeRf0PkclsjWSNMtSMuDnZeZ8yILvUDvBFnuHuj7cRdWNZ7da6wRIyaMvPvYFcpl/2lMDfjF1XVI7b3+KZs4mt2qNgjPVyVnILRceMy8gcPk0guJkOCG6cs2l1qhVnB4gY9tw4vvXsdeyAeTE4H3WG0clD+gMCEATvy7q8f2y8pY24DXgCyam0oj+/q8una6luUTbNgfeRPMjQ1Ns0RAkyc9hdyhXNcfx5QIrOhF3fRv9j8tzvUY75VAVKcy0CqwKa 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)(3002001)(93006095)(10201501046)(3231023)(2400078)(944501161)(6041268)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:MWHPR07MB3472; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3472; X-Forefront-PRVS: 0557CBAD84 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(376002)(346002)(39380400002)(39860400002)(189003)(199004)(4326008)(6512007)(7736002)(48376002)(50466002)(52116002)(51416003)(59450400001)(69596002)(386003)(6506007)(36756003)(97736004)(1076002)(2906002)(47776003)(26005)(66066001)(3846002)(6116002)(5660300001)(8936002)(68736007)(81166006)(105586002)(53416004)(25786009)(305945005)(316002)(16586007)(53936002)(107886003)(5009440100003)(478600001)(76176011)(72206003)(8676002)(6666003)(50226002)(42882006)(6486002)(16526018)(2950100002)(106356001)(81156014)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3472; H:Pavan-LT.caveonetworks.com; 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; MWHPR07MB3472; 23:87u9/aj8FPilYU1m+ikINih9jtuAE078df+0XOwAf?= =?us-ascii?Q?BxLfMyYdTz/0JZ53ZOfm/q1kUmPxON94vY4BBCDn1ixuWnyHHsKsdJa+G2xj?= =?us-ascii?Q?wpcOnwCLZXPx+iL560ILI7swHQX+ssPAUYgjJCOuPVKNOy0nvWlnZSXxdwLp?= =?us-ascii?Q?ulKjaManKu9rHUfb2kLSL+tCSdtjirMJfuW7c9icEudf/vcLJ5isYDP122M1?= =?us-ascii?Q?Jr9810QJFYY/Pkhcw9mruWmcM6lKCGQmyP0FGywevDkbRkEnIJo9HLyOxqI7?= =?us-ascii?Q?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amDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2018 13:53:38.4861 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f860bfa3-ed14-4e7f-9f12-08d55f440bed X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3472 Subject: [dpdk-dev] [PATCH v3 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 13:53:42 -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 --- 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