DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
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 <pbhagavatula@caviumnetworks.com>
Subject: [dpdk-dev]  [PATCH v4 1/2] build: add support for ARM builds
Date: Fri, 19 Jan 2018 23:53:48 +0530	[thread overview]
Message-ID: <20180119182349.21935-1-pbhagavatula@caviumnetworks.com> (raw)
In-Reply-To: <20171219105338.198727-1-bruce.richardson@intel.com>

From: Bruce Richardson <bruce.richardson@intel.com>

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 <bruce.richardson@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---

 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

  parent reply	other threads:[~2018-01-19 18:25 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19 10:53 [dpdk-dev] [RFC PATCH] RFC build: prototype " Bruce Richardson
2017-12-19 13:27 ` Luca Boccassi
2017-12-19 14:17   ` Bruce Richardson
2018-01-19 13:05 ` [dpdk-dev] [PATCH v2 1/2] build: add " Pavan Nikhilesh
2018-01-19 13:05   ` [dpdk-dev] [PATCH v2 2/2] build: add support for detecting march on ARM Pavan Nikhilesh
2018-01-19 13:52 ` [dpdk-dev] [PATCH v3 1/2] build: add support for ARM builds Pavan Nikhilesh
2018-01-19 13:52   ` [dpdk-dev] [PATCH v3 2/2] build: add support for detecting march on ARM Pavan Nikhilesh
2018-01-19 16:17     ` Bruce Richardson
2018-01-19 17:13       ` Pavan Nikhilesh
2018-01-19 17:30         ` Bruce Richardson
2018-01-19 16:24   ` [dpdk-dev] [PATCH v3 1/2] build: add support for ARM builds Bruce Richardson
2018-01-19 16:49     ` Hemant Agrawal
2018-01-19 17:33       ` Bruce Richardson
2018-01-19 18:23 ` Pavan Nikhilesh [this message]
2018-01-19 18:23   ` [dpdk-dev] [PATCH v4 2/2] build: add support for detecting march on ARM Pavan Nikhilesh
2018-01-22  5:52     ` Herbert Guan
2018-01-22  7:16       ` Pavan Nikhilesh
2018-01-22 11:46 ` [dpdk-dev] [PATCH v5 1/2] build: add support for ARM builds Pavan Nikhilesh
2018-01-22 11:46   ` [dpdk-dev] [PATCH v5 2/2] build: add support for detecting march on ARM Pavan Nikhilesh
2018-01-22 12:30     ` Bruce Richardson
2018-01-22 12:37       ` Pavan Nikhilesh
2018-01-22 14:09         ` Bruce Richardson
2018-01-22 14:44           ` Pavan Nikhilesh
2018-01-22 15:26 ` [dpdk-dev] [PATCH v6 1/4] build: add support for ARM builds Pavan Nikhilesh
2018-01-22 15:26   ` [dpdk-dev] [PATCH v6 2/4] build: add support for detecting march on ARM Pavan Nikhilesh
2018-01-22 15:26   ` [dpdk-dev] [PATCH v6 3/4] build: add support for vendor specific ARM cross builds Pavan Nikhilesh
2018-01-22 15:26   ` [dpdk-dev] [PATCH v6 4/4] doc: add instructions to cross compile using meson Pavan Nikhilesh
2018-01-22 16:10   ` [dpdk-dev] [PATCH v6 1/4] build: add support for ARM builds Bruce Richardson
2018-01-22 16:20   ` Jerin Jacob
2018-01-22 16:26     ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180119182349.21935-1-pbhagavatula@caviumnetworks.com \
    --to=pbhagavatula@caviumnetworks.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=herbert.guan@arm.com \
    --cc=jerin.jacob@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).