ARMv8 additions to ARMv7 support
v2 cover ARMv8 additions to ARMv7 support
This is an updated patchset for ARMv8 that now sits on top of the v5 patch of the ARMv7 code by RehiveTech. It adds code into the same arm include directory, reducing code duplication.
Tested on an XGene 64-bit arm server board, with PCI slots. Passes traffic between two physical ports on an Intel 82599 dual-port 10Gig NIC. Should work with many other NICS, but these are as yet untested.
Compiles igb_uio, kni and all the physical device PMDs.
An entry has been added to the Release notes.
We hope that this will encourage the ARM community to contribute PMDs for their SoCs to DPDK.
For now, we've added some Intel engineers to the MAINTAINERS file. We would like to encourage the ARM community to take over maintenance of this area in future, and to further improve it.
Notes on arm64 kernel configuration:
Using Ubuntu 14.04 LTS with a 4.3.0-rc6 kernel (with modified PCI drivers), and uio_pci_generic.
ARM64 kernels do not seem to have functional resource mapping of PCI memory (PCI_MMAP), so the pci driver needs to be patched to enable this. The symptom of this is when /sys/bus/pci/devices/0000:0X:00.Y directory is missing the resource0...N files for mmapping the device memory. Earlier kernels (3.13.x) had these files present, but mmap'ping resulted in a "Bus Error" when the NIC memory was accessed.
However, during limited testing with a modified 4.3.0-rc6 kernel, we were able to mmap the NIC memory, and pass traffic between the two ports on a 82599 NIC connected via fibre cable.
We have no plans to upstream a kernel patch for this and hope that someone more familiar with the arm architecture can create a proper patch and enable this functionality.
David Hunt (6):
eal/arm: add 64-bit armv8 version of rte_memcpy.h eal/arm: add 64-bit armv8 version of rte_prefetch.h eal/arm: add 64-bit armv8 version of rte_cycles.h eal/arm: fix 64-bit armv8 compilation of rte_cpuflags.h
mk: add support for armv8 on top of armv7
test: add checks for cpu flags on armv8
MAINTAINERS | 3 +- app/test/test_cpuflags.c | 13 +- config/defconfig_arm64-armv8a-linuxapp-gcc | 56 ++++ doc/guides/rel_notes/release_2_2.rst | 7 +- .../common/include/arch/arm/rte_cpuflags.h | 6 +- .../common/include/arch/arm/rte_cycles.h | 4 + .../common/include/arch/arm/rte_cycles_64.h | 77 ++++++ .../common/include/arch/arm/rte_memcpy.h | 4 + .../common/include/arch/arm/rte_memcpy_64.h | 308 +++++++++++++++++++++ .../common/include/arch/arm/rte_prefetch.h | 4 + .../common/include/arch/arm/rte_prefetch_64.h | 61 ++++ mk/arch/arm64/rte.vars.mk | 58 ++++ mk/machine/armv8a/rte.vars.mk | 57 ++++ 13 files changed, 651 insertions(+), 7 deletions(-) create mode 100644 config/defconfig_arm64-armv8a-linuxapp-gcc create mode 100644 lib/librte_eal/common/include/arch/arm/rte_cycles_64.h create mode 100644 lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h create mode 100644 lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h create mode 100644 mk/arch/arm64/rte.vars.mk create mode 100644 mk/machine/armv8a/rte.vars.mk
Signature · 1 line
1.9.1
PATCH v2 1/6 eal/arm: add 64-bit armv8 version of rte_memcpy.h
--- .../common/include/arch/arm/rte_memcpy.h | 4 + .../common/include/arch/arm/rte_memcpy_64.h | 308 +++++++++++++++++++++ 2 files changed, 312 insertions(+) create mode 100644 lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h
lib/librte_eal/common/include/arch/arm/rte_memcpy.h +4 -0
@@ -33,6 +33,10 @@#ifndef _RTE_MEMCPY_ARM_H_#define _RTE_MEMCPY_ARM_H_ +#ifdef RTE_ARCH_64 +#include <rte_memcpy_64.h> +#else #include <rte_memcpy_32.h> +#endif #endif /* _RTE_MEMCPY_ARM_H_ */
lib/librte_eal/common/include/arch/arm/rte_memcpy_64.h new file +308 -0
308 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 2/6 eal/arm: add 64-bit armv8 version of rte_prefetch.h
In reply to David Hunt--- .../common/include/arch/arm/rte_prefetch.h | 4 ++ .../common/include/arch/arm/rte_prefetch_64.h | 61 ++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h
lib/librte_eal/common/include/arch/arm/rte_prefetch.h +4 -0
@@ -33,6 +33,10 @@#ifndef _RTE_PREFETCH_ARM_H_#define _RTE_PREFETCH_ARM_H_ +#ifdef RTE_ARCH_64 +#include <rte_prefetch_64.h> +#else #include <rte_prefetch_32.h> +#endif #endif /* _RTE_PREFETCH_ARM_H_ */
lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h new file +61 -0
61 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 3/6 eal/arm: add 64-bit armv8 version of rte_cycles.h
In reply to David Hunt--- .../common/include/arch/arm/rte_cycles.h | 4 ++ .../common/include/arch/arm/rte_cycles_64.h | 77 ++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
lib/librte_eal/common/include/arch/arm/rte_cycles.h +4 -0
@@ -33,6 +33,10 @@#ifndef _RTE_CYCLES_ARM_H_#define _RTE_CYCLES_ARM_H_ +#ifdef RTE_ARCH_64 +#include <rte_cycles_64.h> +#else #include <rte_cycles_32.h> +#endif #endif /* _RTE_CYCLES_ARM_H_ */
lib/librte_eal/common/include/arch/arm/rte_cycles_64.h new file +77 -0
77 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v2 3/6] eal/arm: add 64-bit armv8 version of rte_cycles.h
lib/librte_eal/common/include/arch/arm/rte_cycles_64.h line 57
Quoted 10 lines · On Fri, 30 Oct 2015 11:51:23 +0000 David Hunt <[email protected]> wrote:
lib/librte_eal/common/include/arch/arm/rte_cycles_64.h new file +10
-0+static inline uint64_t +rte_rdtsc (void ) +{ +uint64_t tsc; + + asmvolatile ("mrs %0, CNTVCT_EL0" :"=r" (tsc)); + +#ifdef RTE_TIMER_MULTIPLIER +return tsc *RTE_TIMER_MULTIPLIER ; +#else
I think, this should be CONFIG_RTE_TIMER_MULTIPLIER.
Jan
Quoted 5 lines
lib/librte_eal/common/include/arch/arm/rte_cycles_64.h new file +5
-0+return tsc; +#endif + +} +
Signature · 4 lines
Jan Viktorin E-mail: [email protected] System Architect Web: www.RehiveTech.com RehiveTech Brno, Czech Republic
Re: [PATCH v2 3/6] eal/arm: add 64-bit armv8 version of rte_cycles.h
Quoted 16 lines · Jan Viktorin
lib/librte_eal/common/include/arch/arm/rte_cycles_64.h line 57
Quoted 10 lines · On Fri, 30 Oct 2015 11:51:23 +0000 David Hunt <[email protected]> wrote:
lib/librte_eal/common/include/arch/arm/rte_cycles_64.h new file +10
-0+static inline uint64_t +rte_rdtsc (void ) +{ +uint64_t tsc; + + asmvolatile ("mrs %0, CNTVCT_EL0" :"=r" (tsc)); + +#ifdef RTE_TIMER_MULTIPLIER +return tsc *RTE_TIMER_MULTIPLIER ; +#else I think, this should be
CONFIG_RTE_TIMER_MULTIPLIER.
Quoted 1 line
Jan
Jan,
Thanks for the super-fast review :)
I've taken a look at this and RTE_TIMER_MULTIPLIER is present in
the generated include/rte_config.h, so it compiles and run fine. I've also confirmed this by removing the #ifdef, forcing the use of RTE_TIMER_MULTIPLIER as a test. Dave.
PATCH v2 4/6 eal/arm: fix 64-bit armv8 compilation of rte_cpuflags.h
In reply to David Hunt--- lib/librte_eal/common/include/arch/arm/rte_cpuflags.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
lib/librte_eal/common/include/arch/arm/rte_cpuflags.h +5 -1
@@ -141,12 +141,16 @@ rte_cpu_get_features(__attribute__((unused)) uint32_t leaf, __attribute__((unused)) uint32_t subleaf, cpuid_registers_t out) { int auxv_fd; +#ifdef RTE_ARCH_64 +Elf64_auxv_t auxv; +#else Elf32_auxv_t auxv; +#endif auxv_fd =open ("/proc/self/auxv" ,O_RDONLY );assert (auxv_fd);while (read (auxv_fd, &auxv, -sizeof (Elf32_auxv_t)) ==sizeof (Elf32_auxv_t)) { +sizeof (auxv)) ==sizeof (auxv)) {if (auxv.a_type ==AT_HWCAP ) out[REG_HWCAP ] = auxv.a_un.a_val;else if (auxv.a_type ==AT_HWCAP2 )
Signature · 1 line
1.9.1
Re: [PATCH v2 4/6] eal/arm: fix 64-bit armv8 compilation of rte_cpuflags.h
Much better then the previous...
Quoted 27 lines · On Fri, 30 Oct 2015 11:51:24 +0000 David Hunt <[email protected]> wrote:
Signed-off-by David Hunt <[email protected]>--- lib/librte_eal/common/include/arch/arm/rte_cpuflags.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)lib/librte_eal/common/include/arch/arm/rte_cpuflags.h +5
-1@@ -141,12 +141,16 @@ rte_cpu_get_features(__attribute__((unused)) uint32_t leaf, __attribute__((unused)) uint32_t subleaf, cpuid_registers_t out) { int auxv_fd; +#ifdef RTE_ARCH_64 +Elf64_auxv_t auxv; +#else Elf32_auxv_t auxv; +#endif auxv_fd =open ("/proc/self/auxv" ,O_RDONLY );assert (auxv_fd);while (read (auxv_fd, &auxv, -sizeof (Elf32_auxv_t)) ==sizeof (Elf32_auxv_t)) { +sizeof (auxv)) ==sizeof (auxv)) {if (auxv.a_type ==AT_HWCAP ) out[REG_HWCAP ] = auxv.a_un.a_val;else if (auxv.a_type ==AT_HWCAP2 )
Signature · 4 lines
Jan Viktorin E-mail: [email protected] System Architect Web: www.RehiveTech.com RehiveTech Brno, Czech Republic
PATCH v2 5/6 mk: add support for armv8 on top of armv7
In reply to David Hunt--- MAINTAINERS | 3 +- config/defconfig_arm64-armv8a-linuxapp-gcc | 56 +++++++++++++++++++++++++++++ doc/guides/rel_notes/release_2_2.rst | 7 ++-- mk/arch/arm64/rte.vars.mk | 58 ++++++++++++++++++++++++++++++ mk/machine/armv8a/rte.vars.mk | 57 +++++++++++++++++++++++++++++ 5 files changed, 177 insertions(+), 4 deletions(-) create mode 100644 config/defconfig_arm64-armv8a-linuxapp-gcc create mode 100644 mk/arch/arm64/rte.vars.mk create mode 100644 mk/machine/armv8a/rte.vars.mk
MAINTAINERS +2 -1
@@ -124,8 +124,9 @@ IBM POWER M: Chao Zhu <[email protected]> F: lib/librte_eal/common/include/arch/ppc_64/ -ARM v7 +ARM M: Jan Viktorin <[email protected]> +M: David Hunt <[email protected]> F: lib/librte_eal/common/include/arch/arm/ Intel x86
config/defconfig_arm64-armv8a-linuxapp-gcc new file +56 -0
56 lines not on this page · raw message
doc/guides/rel_notes/release_2_2.rst +4 -3
@@ -31,10 +31,11 @@ New Features * **Added vhost-user multiple queue support.** -* **Introduce ARMv7 architecture** +* **Introduce ARMv7 and ARMv8 architectures** - It is now possible to build DPDK for the ARMv7 platform and test with - virtual PMD drivers. + * It is now possible to build DPDK for the ARMv7 and ARMv8 platforms. + * ARMv7 can be tested with virtual PMD drivers. + * ARMv8 can be tested with virtual and physical PMD drivers. Resolved Issues
mk/arch/arm64/rte.vars.mk new file +58 -0
58 lines not on this page · raw message
mk/machine/armv8a/rte.vars.mk new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
1.9.1
Re: [PATCH v2 5/6] mk: add support for armv8 on top of armv7
I'd put here (in the commit message) the note that the armv8 includes are in the arm directory.
Otherwise:
Quoted 12 lines · On Fri, 30 Oct 2015 11:51:25 +0000 David Hunt <[email protected]> wrote:
Signed-off-by David Hunt <[email protected]>--- MAINTAINERS | 3 +- config/defconfig_arm64-armv8a-linuxapp-gcc | 56 +++++++++++++++++++++++++++++ doc/guides/rel_notes/release_2_2.rst | 7 ++-- mk/arch/arm64/rte.vars.mk | 58 ++++++++++++++++++++++++++++++ mk/machine/armv8a/rte.vars.mk | 57 +++++++++++++++++++++++++++++ 5 files changed, 177 insertions(+), 4 deletions(-) create mode 100644 config/defconfig_arm64-armv8a-linuxapp-gcc create mode 100644 mk/arch/arm64/rte.vars.mk create mode 100644 mk/machine/armv8a/rte.vars.mk
[...]
Quoted 12 lines
mk/arch/arm64/rte.vars.mk new file +12
-0+# + +ARCH ?= arm64 +# common arch dir in eal headers +ARCH_DIR := arm +CROSS ?= + +CPU_CFLAGS ?= -DRTE_CACHE_LINE_SIZE=64 +CPU_LDFLAGS ?= +CPU_ASFLAGS ?= -felf + +export ARCH CROSS CPU_CFLAGS CPU_LDFLAGS CPU_ASFLAGS
[...]
Signature · 4 lines
Jan Viktorin E-mail: [email protected] System Architect Web: www.RehiveTech.com RehiveTech Brno, Czech Republic
PATCH v2 6/6 test: add checks for cpu flags on armv8
In reply to David Hunt--- app/test/test_cpuflags.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
app/test/test_cpuflags.c +11 -2
@@ -1,4 +1,4 @@ -/*- +/* * BSD LICENSE * * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
@@ -115,9 +115,18 @@ test_cpuflags(void)CHECK_FOR_FLAG (RTE_CPUFLAG_ICACHE_SNOOP );#endif -#if defined(RTE_ARCH_ARM ) +#if defined(RTE_ARCH_ARM ) || defined(RTE_ARCH_ARM64 ) +printf ("Checking for Floating Point:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_FPA ); +printf ("Check for NEON:\t\t" );CHECK_FOR_FLAG (RTE_CPUFLAG_NEON ); + +printf ("Checking for ARM32 mode:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_AARCH32 ); + +printf ("Checking for ARM64 mode:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_AARCH64 );#endif #if defined(RTE_ARCH_X86_64 ) || defined(RTE_ARCH_I686 )
Signature · 1 line
1.9.1