Patches for DPDK to support Power architecture
v5 cover Patches for DPDK to support Power architecture
The set of patches add IBM Power architecture to the DPDK. It adds the required support to the EAL library. This set of patches doesn't support full DPDK function on Power processors. To compile on PPC64 architecture, GCC version >= 4.8 must be used. According to Bruce and Neil's comments, this v5 patch removed the common configuration files of Powerpc in v4. Also, it fixed the checkpatch issues in v3.
The only unsolved checkpatch issue is :
ERROR: space prohibited before open square bracket '['
This issue refers to the asm code input/output naming. But I think the error is invalid.
Chao Zhu (14):
Add compiling definations for IBM Power architecture Add atomic operations for IBM Power architecture Add byte order operations for IBM Power architecture Add CPU cycle operations for IBM Power architecture Add prefetch operation for IBM Power architecture Add spinlock operation for IBM Power architecture Add vector memcpy for IBM Power architecture Add CPU flag checking for IBM Power architecture Remove iopl operation for IBM Power architecture Add cache size define for IBM Power Architecture Add huge page size define for IBM Power architecture Add eal memory support for IBM Power Architecture test_memzone:fix finding the second smallest segment Fix the compiling of test-pmd on IBM Power Architecture
app/test-pmd/config.c | 39 ++- app/test/test_cpuflags.c | 35 ++ app/test/test_malloc.c | 8 +- app/test/test_memzone.c | 132 ++++++- config/defconfig_ppc_64-power8-linuxapp-gcc | 72 ++++ config/defconfig_x86_64-native-linuxapp-clang | 1 + config/defconfig_x86_64-native-linuxapp-gcc | 1 + config/defconfig_x86_64-native-linuxapp-icc | 1 + lib/librte_eal/common/eal_common_memzone.c | 19 +- .../common/include/arch/ppc_64/rte_atomic.h | 427 ++++++++++++++++++++ .../common/include/arch/ppc_64/rte_byteorder.h | 150 +++++++ .../common/include/arch/ppc_64/rte_cpuflags.h | 187 +++++++++ .../common/include/arch/ppc_64/rte_cycles.h | 88 ++++ .../common/include/arch/ppc_64/rte_memcpy.h | 226 +++++++++++ .../common/include/arch/ppc_64/rte_prefetch.h | 61 +++ .../common/include/arch/ppc_64/rte_spinlock.h | 73 ++++ lib/librte_eal/common/include/rte_memory.h | 9 +- lib/librte_eal/common/include/rte_memzone.h | 8 + lib/librte_eal/linuxapp/eal/eal.c | 17 +- lib/librte_eal/linuxapp/eal/eal_memory.c | 91 +++-- mk/arch/ppc_64/rte.vars.mk | 39 ++ mk/machine/power8/rte.vars.mk | 57 +++ mk/rte.cpuflags.mk | 17 + 23 files changed, 1699 insertions(+), 59 deletions(-) create mode 100644 config/defconfig_ppc_64-power8-linuxapp-gcc create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_byteorder.h create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_cpuflags.h create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_memcpy.h create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_spinlock.h create mode 100644 mk/arch/ppc_64/rte.vars.mk create mode 100644 mk/machine/power8/rte.vars.mk
A message that is not in the archive (sent off-list or not yet received): 1416953837-15894-1-git-send-email-chaozhu-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
PATCH v5 1/14 Add compiling definations for IBM Power architecture
To make DPDK run on IBM Power architecture, configuration files for Power architecuture are added. Also, the compiling related .mk files are added.
--- config/defconfig_ppc_64-power8-linuxapp-gcc | 70 +++++++++++++++++++++++++++ mk/arch/ppc_64/rte.vars.mk | 39 +++++++++++++++ mk/machine/power8/rte.vars.mk | 57 ++++++++++++++++++++++ 3 files changed, 166 insertions(+), 0 deletions(-) create mode 100644 config/defconfig_ppc_64-power8-linuxapp-gcc create mode 100644 mk/arch/ppc_64/rte.vars.mk create mode 100644 mk/machine/power8/rte.vars.mk
config/defconfig_ppc_64-power8-linuxapp-gcc new file +70 -0
@@ -0,0 +1,70 @@ +# BSD LICENSE +# +# Copyright (C) IBM Corporation 2014. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of IBM Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "common_linuxapp" + +CONFIG_RTE_MACHINE="power8" + +CONFIG_RTE_ARCH="ppc_64" +CONFIG_RTE_ARCH_PPC_64=y + +CONFIG_RTE_TOOLCHAIN="gcc" +CONFIG_RTE_TOOLCHAIN_GCC=y + +# The following overrides the default common value. +# Undefine the default value, then define the new one to avoid compiling error. + +CONFIG_RTE_LIBNAME=n +CONFIG_RTE_LIBNAME="powerpc_dpdk" + +# Power8 has 96 cores, so increase CONFIG_RTE_MAX_LCORE from 64 to 128 +# Undefine the default value, then define the new one to avoid compiling error. +CONFIG_RTE_MAX_LCORE=n +CONFIG_RTE_MAX_LCORE=128 + +# Note: Power doesn't have this support +CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=n + +# Note: Initially, all of the PMD drivers compilation are turned off on Power +# Will turn on them only after the successful testing on Power +CONFIG_RTE_LIBRTE_IXGBE_PMD=n +CONFIG_RTE_LIBRTE_I40E_PMD=n +CONFIG_RTE_LIBRTE_VIRTIO_PMD=n +CONFIG_RTE_LIBRTE_VMXNET3_PMD=n +CONFIG_RTE_LIBRTE_PMD_BOND=n + +# This following libraries are not available on Power. So they're turned off. +CONFIG_RTE_LIBRTE_LPM=n +CONFIG_RTE_LIBRTE_ACL=n +CONFIG_RTE_LIBRTE_SCHED=n +CONFIG_RTE_LIBRTE_PORT=n +CONFIG_RTE_LIBRTE_TABLE=n + +CONFIG_RTE_LIBRTE_PIPELINE=n
mk/arch/ppc_64/rte.vars.mk new file +39 -0
@@ -0,0 +1,39 @@ +# BSD LICENSE +# +# Copyright (C) IBM Corporation 2014. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of IBM Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ARCH ?= powerpc +CROSS ?= + +CPU_CFLAGS ?= -m64 +CPU_LDFLAGS ?= +CPU_ASFLAGS ?= -felf64 + +export ARCH CROSS CPU_CFLAGS CPU_LDFLAGS CPU_ASFLAGS
mk/machine/power8/rte.vars.mk new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v5 2/14 Add atomic operations for IBM Power architecture
In reply to a message not in the archiveThis patch adds architecture specific atomic operation file for IBM Power architecture CPU.
--- .../common/include/arch/ppc_64/rte_atomic.h | 427 ++++++++++++++++++++ 1 files changed, 427 insertions(+), 0 deletions(-) create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h
lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h new file +427 -0
@@ -0,0 +1,427 @@ +/* +* BSD LICENSE +* +* Copyright (C) IBM Corporation 2014. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of IBM Corporation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* +* Inspired from FreeBSD src/sys/powerpc/include/atomic.h +* Copyright (c) 2008 Marcel Moolenaar +* Copyright (c) 2001 Benno Rice +* Copyright (c) 2001 David E. O'Brien +* Copyright (c) 1998 Doug Rabson +* All rights reserved. +*/ + +#ifndef _RTE_ATOMIC_PPC_64_H_ +#define _RTE_ATOMIC_PPC_64_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "generic/rte_atomic.h" + +/** +* General memory barrier. +* +* Guarantees that the LOAD and STORE operations generated before the +* barrier occur before the LOAD and STORE operations generated after. +*/ +#define rte_mb () {asm volatile("sync" : : : "memory"); } + +/** +* Write memory barrier. +* +* Guarantees that the STORE operations generated before the barrier +* occur before the STORE operations generated after. +*/ +#define rte_wmb () {asm volatile("sync" : : : "memory"); } + +/** +* Read memory barrier. +* +* Guarantees that the LOAD operations generated before the barrier +* occur before the LOAD operations generated after. +*/ +#define rte_rmb () {asm volatile("sync" : : : "memory"); } + +/*------------------------- 16 bit atomic operations -------------------------*/ +/* To be compatible with Power7, use GCC built-in functions for 16 bit +* operations */ + +#ifndef RTE_FORCE_INTRINSICS +static inline int +rte_atomic16_cmpset (volatile uint16_t *dst,uint16_t exp,uint16_t src) +{ +return __atomic_compare_exchange (dst, &exp, &src,0 , __ATOMIC_ACQUIRE, + __ATOMIC_ACQUIRE) ?1 :0 ; +} + +static inline int rte_atomic16_test_and_set (rte_atomic16_t *v) +{ +return rte_atomic16_cmpset ((volatile uint16_t *)&v->cnt,0 ,1 ); +} + +static inline void +rte_atomic16_inc (rte_atomic16_t *v) +{ +__atomic_add_fetch (&v->cnt,1 , __ATOMIC_ACQUIRE); +} + +static inline void +rte_atomic16_dec (rte_atomic16_t *v) +{ +__atomic_sub_fetch (&v->cnt,1 , __ATOMIC_ACQUIRE); +} + +static inline int rte_atomic16_inc_and_test (rte_atomic16_t *v) +{ +return (__atomic_add_fetch (&v->cnt,1 , __ATOMIC_ACQUIRE) ==0 ); +} + +static inline int rte_atomic16_dec_and_test (rte_atomic16_t *v) +{ +return (__atomic_sub_fetch (&v->cnt,1 , __ATOMIC_ACQUIRE) ==0 ); +} + +/*------------------------- 32 bit atomic operations -------------------------*/ + +static inline int +rte_atomic32_cmpset (volatile uint32_t *dst,uint32_t exp,uint32_t src) +{ +unsigned int ret =0 ; + + asmvolatile ( +"\tlwsync\n" +"1:\tlwarx %[ret], 0, %[dst]\n" +"cmplw %[exp], %[ret]\n" +"bne 2f\n" +"stwcx. %[src], 0, %[dst]\n" +"bne- 1b\n" +"li %[ret], 1\n" +"b 3f\n" +"2:\n" +"stwcx. %[ret], 0, %[dst]\n" +"li %[ret], 0\n" +"3:\n" +"isync\n" + : [ret]"=&r" (ret),"=m" (*dst) + : [dst]"r" (dst), + [exp]"r" (exp), + [src]"r" (src), +"m" (*dst) + :"cc" ,"memory" ); + +return ret; +} + +static inline int rte_atomic32_test_and_set (rte_atomic32_t *v) +{ +return rte_atomic32_cmpset ((volatile uint32_t *)&v->cnt,0 ,1 ); +} + +static inline void +rte_atomic32_inc (rte_atomic32_t *v) +{ +int t; + + asmvolatile ( +"1: lwarx %[t],0,%[cnt]\n" +"addic %[t],%[t],1\n" +"stwcx. %[t],0,%[cnt]\n" +"bne- 1b\n" + : [t]"=&r" (t),"=m" (v->cnt) + : [cnt]"r" (&v->cnt),"m" (v->cnt) + :"cc" ,"xer" ,"memory" ); +} + +static inline void +rte_atomic32_dec (rte_atomic32_t *v) +{ +int t; + + asmvolatile ( +"1: lwarx %[t],0,%[cnt]\n" +"addic %[t],%[t],-1\n" +"stwcx. %[t],0,%[cnt]\n" +"bne- 1b\n" + : [t]"=&r" (t),"=m" (v->cnt) + : [cnt]"r" (&v->cnt),"m" (v->cnt) + :"cc" ,"xer" ,"memory" ); +} + +static inline int rte_atomic32_inc_and_test (rte_atomic32_t *v) +{ +int ret; + + asmvolatile ( +"\n\tlwsync\n" +"1: lwarx %[ret],0,%[cnt]\n" +"addic %[ret],%[ret],1\n" +"stwcx. %[ret],0,%[cnt]\n" +"bne- 1b\n" +"isync\n" + : [ret]"=&r" (ret) + : [cnt]"r" (&v->cnt) + :"cc" ,"xer" ,"memory" ); + +return (ret ==0 ); +} + +static inline int rte_atomic32_dec_and_test (rte_atomic32_t *v) +{ +int ret; + + asmvolatile ( +"\n\tlwsync\n" +"1: lwarx %[ret],0,%[cnt]\n" +"addic %[ret],%[ret],-1\n" +"stwcx. %[ret],0,%[cnt]\n" +"bne- 1b\n" +"isync\n" + : [ret]"=&r" (ret) + : [cnt]"r" (&v->cnt) + :"cc" ,"xer" ,"memory" ); + +return (ret ==0 ); +} +/*------------------------- 64 bit atomic operations -------------------------*/ + +static inline int +rte_atomic64_cmpset (volatile uint64_t *dst,uint64_t exp,uint64_t src) +{ +unsigned int ret =0 ; + + asmvolatile ( +"\tlwsync\n" +"1: ldarx %[ret], 0, %[dst]\n" +"cmpld %[exp], %[ret]\n" +"bne 2f\n" +"stdcx. %[src], 0, %[dst]\n" +"bne- 1b\n" +"li %[ret], 1\n" +"b 3f\n" +"2:\n" +"stdcx. %[ret], 0, %[dst]\n" +"li %[ret], 0\n" +"3:\n" +"isync\n" + : [ret]"=&r" (ret),"=m" (*dst) + : [dst]"r" (dst), + [exp]"r" (exp), + [src]"r" (src), +"m" (*dst) + :"cc" ,"memory" ); +return ret; +} + +static inline void +rte_atomic64_init (rte_atomic64_t *v) +{ + v->cnt =0 ; +} + +static inline int64_t +rte_atomic64_read (rte_atomic64_t *v) +{ +long ret; + + asmvolatile ("ld%U1%X1 %[ret],%[cnt]" + : [ret]"=r" (ret) + : [cnt]"m" (v->cnt)); + +return ret; +} + +static inline void +rte_atomic64_set (rte_atomic64_t *v,int64_t new_value) +{ + asmvolatile ("std%U0%X0 %[new_value],%[cnt]" + : [cnt]"=m" (v->cnt) + : [new_value]"r" (new_value)); +} + +static inline void +rte_atomic64_add (rte_atomic64_t *v,int64_t inc) +{ +long t; + + asmvolatile ( +"1: ldarx %[t],0,%[cnt]\n" +"add %[t],%[inc],%[t]\n" +"stdcx. %[t],0,%[cnt]\n" +"bne- 1b\n" + : [t]"=&r" (t),"=m" (v->cnt) + : [cnt]"r" (&v->cnt), [inc]"r" (inc),"m" (v->cnt) + :"cc" ,"memory" ); +} + +static inline void +rte_atomic64_sub (rte_atomic64_t *v,int64_t dec) +{ +long t; + + asmvolatile ( +"1: ldarx %[t],0,%[cnt]\n" +"subf %[t],%[dec],%[t]\n" +"stdcx. %[t],0,%[cnt]\n" +"bne- 1b\n" + : [t]"=&r" (t),"+m" (v->cnt) + : [cnt]"r" (&v->cnt), [dec]"r" (dec),"m" (v->cnt) + :"cc" ,"memory" ); +} + +static inline void +rte_atomic64_inc (rte_atomic64_t *v) +{ +long t; + + asmvolatile ( +"1: ldarx %[t],0,%[cnt]\n" +"addic %[t],%[t],1\n" +"stdcx. %[t],0,%[cnt]\n" +"bne- 1b\n" + : [t]"=&r" (t),"+m" (v->cnt) + : [cnt]"r" (&v->cnt),"m" (v->cnt) + :"cc" ,"xer" ,"memory" ); +} + +static inline void +rte_atomic64_dec (rte_atomic64_t *v) +{ +long t; + + asmvolatile ( +"1: ldarx %[t],0,%[cnt]\n" +"addic %[t],%[t],-1\n" +"stdcx. %[t],0,%[cnt]\n" +"bne- 1b\n" + : [t]"=&r" (t),"+m" (v->cnt) + : [cnt]"r" (&v->cnt),"m" (v->cnt) + :"cc" ,"xer" ,"memory" ); +} + +static inline int64_t +rte_atomic64_add_return (rte_atomic64_t *v,int64_t inc) +{ +long ret; + + asmvolatile ( +"\n\tlwsync\n" +"1: ldarx %[ret],0,%[cnt]\n" +"add %[ret],%[inc],%[ret]\n" +"stdcx. %[ret],0,%[cnt]\n" +"bne- 1b\n" +"isync\n" + : [ret]"=&r" (ret) + : [inc]"r" (inc), [cnt]"r" (&v->cnt) + :"cc" ,"memory" ); + +return ret; +} + +static inline int64_t +rte_atomic64_sub_return (rte_atomic64_t *v,int64_t dec) +{ +long ret; + + asmvolatile ( +"\n\tlwsync\n" +"1: ldarx %[ret],0,%[cnt]\n" +"subf %[ret],%[dec],%[ret]\n" +"stdcx. %[ret],0,%[cnt]\n" +"bne- 1b\n" +"isync\n" + : [ret]"=&r" (ret) + : [dec]"r" (dec), [cnt]"r" (&v->cnt) + :"cc" ,"memory" ); + +return ret; +} + +static inline int rte_atomic64_inc_and_test (rte_atomic64_t *v) +{ +long ret; + + asmvolatile ( +"\n\tlwsync\n" +"1: ldarx %[ret],0,%[cnt]\n" +"addic %[ret],%[ret],1\n" +"stdcx. %[ret],0,%[cnt]\n" +"bne- 1b\n" +"isync\n" + : [ret]"=&r" (ret) + : [cnt]"r" (&v->cnt) + :"cc" ,"xer" ,"memory" ); + +return (ret ==0 ); +} + +static inline int rte_atomic64_dec_and_test (rte_atomic64_t *v) +{ +long ret; + + asmvolatile ( +"\n\tlwsync\n" +"1: ldarx %[ret],0,%[cnt]\n" +"addic %[ret],%[ret],-1\n" +"stdcx. %[ret],0,%[cnt]\n" +"bne- 1b\n" +"isync\n" + : [ret]"=&r" (ret) + : [cnt]"r" (&v->cnt) + :"cc" ,"xer" ,"memory" ); + +return (ret ==0 ); +} + +static inline int rte_atomic64_test_and_set (rte_atomic64_t *v) +{ +return rte_atomic64_cmpset ((volatile uint64_t *)&v->cnt,0 ,1 ); +} + +/** +* Atomically set a 64-bit counter to 0. +* +* @param v +* A pointer to the atomic counter. +*/ +static inline void rte_atomic64_clear (rte_atomic64_t *v) +{ + v->cnt =0 ; +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_ATOMIC_PPC_64_H_ */ +
Signature · 1 line
1.7.1
PATCH v5 3/14 Add byte order operations for IBM Power architecture
In reply to a message not in the archiveThis patch adds architecture specific byte order operations for IBM Power architecture. Power architecture support both big endian and little endian. This patch also adds a RTE_ARCH_BIG_ENDIAN micro.
--- config/defconfig_ppc_64-power8-linuxapp-gcc | 1 + .../common/include/arch/ppc_64/rte_byteorder.h | 150 ++++++++++++++++++++ 2 files changed, 151 insertions(+), 0 deletions(-) create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_byteorder.h
config/defconfig_ppc_64-power8-linuxapp-gcc +1 -0
@@ -34,6 +34,7 @@ CONFIG_RTE_MACHINE="power8" CONFIG_RTE_ARCH="ppc_64" CONFIG_RTE_ARCH_PPC_64=y +CONFIG_RTE_ARCH_BIG_ENDIAN=y CONFIG_RTE_TOOLCHAIN="gcc" CONFIG_RTE_TOOLCHAIN_GCC=y
lib/librte_eal/common/include/arch/ppc_64/rte_byteorder.h new file +150 -0
150 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v5 4/14 Add CPU cycle operations for IBM Power architecture
In reply to a message not in the archiveIBM Power architecture doesn't have TSC register to get CPU cycles. This patch implements the time base register read instead of TSC register of x86 on IBM Power architecture.
--- .../common/include/arch/ppc_64/rte_cycles.h | 88 ++++++++++++++++++++ 1 files changed, 88 insertions(+), 0 deletions(-) create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h
lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h new file +88 -0
@@ -0,0 +1,88 @@ +/* +* BSD LICENSE +* +* Copyright (C) IBM Corporation 2014. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of IBM Corporation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _RTE_CYCLES_PPC_64_H_ +#define _RTE_CYCLES_PPC_64_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "generic/rte_cycles.h" + +/** +* Read the time base register. +* +* @return +* The time base for this lcore. +*/ +static inline uint64_t +rte_rdtsc (void ) +{ +union { +uint64_t tsc_64; +struct { +uint32_t hi_32; +uint32_t lo_32; + }; + } tsc; +uint32_t tmp; + + asmvolatile ( +"0:\n" +"mftbu %[hi32]\n" +"mftb %[lo32]\n" +"mftbu %[tmp]\n" +"cmpw %[tmp],%[hi32]\n" +"bne 0b\n" + : [hi32]"=r" (tsc.hi_32), [lo32]"=r" (tsc.lo_32), + [tmp]"=r" (tmp) + ); +return tsc.tsc_64; +} + +static inline uint64_t +rte_rdtsc_precise (void ) +{ +rte_mb (); +return rte_rdtsc (); +} + +static inline uint64_t +rte_get_tsc_cycles (void ) {return rte_rdtsc (); } + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_CYCLES_PPC_64_H_ */ +
Signature · 1 line
1.7.1
PATCH v5 5/14 Add prefetch operation for IBM Power architecture
In reply to a message not in the archiveThis patch add architecture specific prefetch operations for IBM Power architecture.
--- .../common/include/arch/ppc_64/rte_prefetch.h | 61 ++++++++++++++++++++ 1 files changed, 61 insertions(+), 0 deletions(-) create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h
lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h new file +61 -0
@@ -0,0 +1,61 @@ +/* +* BSD LICENSE +* +* Copyright (C) IBM Corporation 2014. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of IBM Corporation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _RTE_PREFETCH_PPC_64_H_ +#define _RTE_PREFETCH_PPC_64_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "generic/rte_prefetch.h" + +static inline void rte_prefetch0 (volatile void *p) +{ + asmvolatile ("dcbt 0,%[p],1" : : [p]"r" (p)); +} + +static inline void rte_prefetch1 (volatile void *p) +{ + asmvolatile ("dcbt 0,%[p],1" : : [p]"r" (p)); +} + +static inline void rte_prefetch2 (volatile void *p) +{ + asmvolatile ("dcbt 0,%[p],1" : : [p]"r" (p)); +} + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_PREFETCH_PPC_64_H_ */
Signature · 1 line
1.7.1
PATCH v5 6/14 Add spinlock operation for IBM Power architecture
In reply to a message not in the archiveThis patch adds spinlock operations for IBM Power architecture.
--- .../common/include/arch/ppc_64/rte_spinlock.h | 73 ++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-) create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_spinlock.h
lib/librte_eal/common/include/arch/ppc_64/rte_spinlock.h new file +73 -0
@@ -0,0 +1,73 @@ +/* +* BSD LICENSE +* +* Copyright (C) IBM Corporation 2014. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of IBM Corporation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _RTE_SPINLOCK_PPC_64_H_ +#define _RTE_SPINLOCK_PPC_64_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <rte_common.h> +#include "generic/rte_spinlock.h" + +/* Fixme: Use intrinsics to implement the spinlock on Power architecture */ + +#ifndef RTE_FORCE_INTRINSICS + +static inline void +rte_spinlock_lock (rte_spinlock_t *sl) +{ +while (__sync_lock_test_and_set (&sl->locked,1 )) +while (sl->locked) +rte_pause (); +} + +static inline void +rte_spinlock_unlock (rte_spinlock_t *sl) +{ +__sync_lock_release (&sl->locked); +} + +static inline int +rte_spinlock_trylock (rte_spinlock_t *sl) +{ +return (__sync_lock_test_and_set (&sl->locked,1 ) ==0 ); +} + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_SPINLOCK_PPC_64_H_ */
Signature · 1 line
1.7.1
PATCH v5 7/14 Add vector memcpy for IBM Power architecture
In reply to a message not in the archiveThe SSE based memory copy in DPDK only support x86. This patch adds altivec based memory copy functions for IBM Power architecture. This patch includes altivec.h which requires GCC version>= 4.8.
--- .../common/include/arch/ppc_64/rte_memcpy.h | 226 ++++++++++++++++++++ 1 files changed, 226 insertions(+), 0 deletions(-) create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_memcpy.h
lib/librte_eal/common/include/arch/ppc_64/rte_memcpy.h new file +226 -0
@@ -0,0 +1,226 @@ +/* +* BSD LICENSE +* +* Copyright (C) IBM Corporation 2014. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of IBM Corporation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _RTE_MEMCPY_PPC_64_H_ +#define _RTE_MEMCPY_PPC_64_H_ + +#include <stdint.h> +#include <string.h> +/*To include altivec.h, GCC version must >= 4.8 */ +#include <altivec.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#include "generic/rte_memcpy.h" + +static inline void +rte_mov16 (uint8_t *dst,const uint8_t *src) +{ +vec_vsx_st (vec_vsx_ld (0 , src),0 , dst); +} + +static inline void +rte_mov32 (uint8_t *dst,const uint8_t *src) +{ +vec_vsx_st (vec_vsx_ld (0 , src),0 , dst); +vec_vsx_st (vec_vsx_ld (16 , src),16 , dst); +} + +static inline void +rte_mov48 (uint8_t *dst,const uint8_t *src) +{ +vec_vsx_st (vec_vsx_ld (0 , src),0 , dst); +vec_vsx_st (vec_vsx_ld (16 , src),16 , dst); +vec_vsx_st (vec_vsx_ld (32 , src),32 , dst); +} + +static inline void +rte_mov64 (uint8_t *dst,const uint8_t *src) +{ +vec_vsx_st (vec_vsx_ld (0 , src),0 , dst); +vec_vsx_st (vec_vsx_ld (16 , src),16 , dst); +vec_vsx_st (vec_vsx_ld (32 , src),32 , dst); +vec_vsx_st (vec_vsx_ld (48 , src),48 , dst); +} + +static inline void +rte_mov128 (uint8_t *dst,const uint8_t *src) +{ +vec_vsx_st (vec_vsx_ld (0 , src),0 , dst); +vec_vsx_st (vec_vsx_ld (16 , src),16 , dst); +vec_vsx_st (vec_vsx_ld (32 , src),32 , dst); +vec_vsx_st (vec_vsx_ld (48 , src),48 , dst); +vec_vsx_st (vec_vsx_ld (64 , src),64 , dst); +vec_vsx_st (vec_vsx_ld (80 , src),80 , dst); +vec_vsx_st (vec_vsx_ld (96 , src),96 , dst); +vec_vsx_st (vec_vsx_ld (112 , src),112 , dst); +} + +static inline void +rte_mov256 (uint8_t *dst,const uint8_t *src) +{ +rte_mov128 (dst, src); +rte_mov128 (dst +128 , src +128 ); +} + +#define rte_memcpy (dst, src, n) \ + ((__builtin_constant_p(n)) ? \ + memcpy((dst), (src), (n)) : \ + rte_memcpy_func((dst), (src), (n))) + +static inline void * +rte_memcpy_func (void *dst,const void *src,size_t n) +{ +void *ret = dst; + +/* We can't copy < 16 bytes using XMM registers so do it manually. */ +if (n <16 ) { +if (n &0x01 ) { + *(uint8_t *)dst = *(const uint8_t *)src; + dst = (uint8_t *)dst +1 ; + src = (const uint8_t *)src +1 ; + } +if (n &0x02 ) { + *(uint16_t *)dst = *(const uint16_t *)src; + dst = (uint16_t *)dst +1 ; + src = (const uint16_t *)src +1 ; + } +if (n &0x04 ) { + *(uint32_t *)dst = *(const uint32_t *)src; + dst = (uint32_t *)dst +1 ; + src = (const uint32_t *)src +1 ; + } +if (n &0x08 ) + *(uint64_t *)dst = *(const uint64_t *)src; +return ret; + } + +/* Special fast cases for <= 128 bytes */ +if (n <=32 ) { +rte_mov16 ((uint8_t *)dst, (const uint8_t *)src); +rte_mov16 ((uint8_t *)dst -16 + n, + (const uint8_t *)src -16 + n); +return ret; + } + +if (n <=64 ) { +rte_mov32 ((uint8_t *)dst, (const uint8_t *)src); +rte_mov32 ((uint8_t *)dst -32 + n, + (const uint8_t *)src -32 + n); +return ret; + } + +if (n <=128 ) { +rte_mov64 ((uint8_t *)dst, (const uint8_t *)src); +rte_mov64 ((uint8_t *)dst -64 + n, + (const uint8_t *)src -64 + n); +return ret; + } + +/* +* For large copies > 128 bytes. This combination of 256, 64 and 16 byte +* copies was found to be faster than doing 128 and 32 byte copies as +* well. +*/ +for ( ; n >=256 ; n -=256 ) { +rte_mov256 ((uint8_t *)dst, (const uint8_t *)src); + dst = (uint8_t *)dst +256 ; + src = (const uint8_t *)src +256 ; + } + +/* +* We split the remaining bytes (which will be less than 256) into +* 64byte (2^6) chunks. +* Using incrementing integers in the case labels of a switch statement +* enourages the compiler to use a jump table. To get incrementing +* integers, we shift the 2 relevant bits to the LSB position to first +* get decrementing integers, and then subtract. +*/ +switch (3 - (n >>6 )) { +case 0x00 : +rte_mov64 ((uint8_t *)dst, (const uint8_t *)src); + n -=64 ; + dst = (uint8_t *)dst +64 ; + src = (const uint8_t *)src +64 ;/* fallthrough */ +case 0x01 : +rte_mov64 ((uint8_t *)dst, (const uint8_t *)src); + n -=64 ; + dst = (uint8_t *)dst +64 ; + src = (const uint8_t *)src +64 ;/* fallthrough */ +case 0x02 : +rte_mov64 ((uint8_t *)dst, (const uint8_t *)src); + n -=64 ; + dst = (uint8_t *)dst +64 ; + src = (const uint8_t *)src +64 ;/* fallthrough */ +default : + ; + } + +/* +* We split the remaining bytes (which will be less than 64) into +* 16byte (2^4) chunks, using the same switch structure as above. +*/ +switch (3 - (n >>4 )) { +case 0x00 : +rte_mov16 ((uint8_t *)dst, (const uint8_t *)src); + n -=16 ; + dst = (uint8_t *)dst +16 ; + src = (const uint8_t *)src +16 ;/* fallthrough */ +case 0x01 : +rte_mov16 ((uint8_t *)dst, (const uint8_t *)src); + n -=16 ; + dst = (uint8_t *)dst +16 ; + src = (const uint8_t *)src +16 ;/* fallthrough */ +case 0x02 : +rte_mov16 ((uint8_t *)dst, (const uint8_t *)src); + n -=16 ; + dst = (uint8_t *)dst +16 ; + src = (const uint8_t *)src +16 ;/* fallthrough */ +default : + ; + } + +/* Copy any remaining bytes, without going beyond end of buffers */ +if (n !=0 ) +rte_mov16 ((uint8_t *)dst -16 + n, + (const uint8_t *)src -16 + n); +return ret; +} + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_MEMCPY_PPC_64_H_ */ +
Signature · 1 line
1.7.1
PATCH v5 8/14 Add CPU flag checking for IBM Power architecture
In reply to a message not in the archiveIBM Power processor doesn't have CPU flag hardware registers. This patch uses aux vector software register to get CPU flags and add CPU flag checking support for IBM Power architecture.
--- app/test/test_cpuflags.c | 35 ++++ .../common/include/arch/ppc_64/rte_cpuflags.h | 187 ++++++++++++++++++++ mk/rte.cpuflags.mk | 17 ++ 3 files changed, 239 insertions(+), 0 deletions(-) create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_cpuflags.h
app/test/test_cpuflags.c +35 -0
@@ -80,6 +80,40 @@ test_cpuflags(void)int result;printf ("\nChecking for flags from different registers...\n" ); +#ifdef RTE_ARCH_PPC_64 +printf ("Check for PPC64:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_PPC64 ); + +printf ("Check for PPC32:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_PPC32 ); + +printf ("Check for VSX:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_VSX ); + +printf ("Check for DFP:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_DFP ); + +printf ("Check for FPU:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_FPU ); + +printf ("Check for SMT:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_SMT ); + +printf ("Check for MMU:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_MMU ); + +printf ("Check for ALTIVEC:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_ALTIVEC ); + +printf ("Check for ARCH_2_06:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_ARCH_2_06 ); + +printf ("Check for ARCH_2_07:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_ARCH_2_07 ); + +printf ("Check for ICACHE_SNOOP:\t\t" ); +CHECK_FOR_FLAG (RTE_CPUFLAG_ICACHE_SNOOP ); +#else printf ("Check for SSE:\t\t" );CHECK_FOR_FLAG (RTE_CPUFLAG_SSE );
@@ -117,6 +151,7 @@ test_cpuflags(void)CHECK_FOR_FLAG (RTE_CPUFLAG_INVTSC ); +#endif /* * Check if invalid data is handled properly
lib/librte_eal/common/include/arch/ppc_64/rte_cpuflags.h new file +187 -0
187 lines not on this page · raw message
mk/rte.cpuflags.mk +17 -0
@@ -89,6 +89,23 @@ ifneq ($(filter $(AUTO_CPUFLAGS),__AVX2__),) CPUFLAGS += AVX2 endif +# IBM Power CPU flags +ifneq ($(filter $(AUTO_CPUFLAGS),__PPC64__),) +CPUFLAGS += PPC64 +endif + +ifneq ($(filter $(AUTO_CPUFLAGS),__PPC32__),) +CPUFLAGS += PPC32 +endif + +ifneq ($(filter $(AUTO_CPUFLAGS),__vector),) +CPUFLAGS += ALTIVEC +endif + +ifneq ($(filter $(AUTO_CPUFLAGS),__builtin_vsx_xvnmaddadp),) +CPUFLAGS += VSX +endif + MACHINE_CFLAGS += $(addprefix -DRTE_MACHINE_CPUFLAG_,$(CPUFLAGS)) # To strip whitespace
Signature · 1 line
1.7.1
PATCH v5 9/14 Remove iopl operation for IBM Power architecture
In reply to a message not in the archiveiopl() call is mostly for the i386 architecture. In Power and other architecture, it doesn't exist. This patch modified rte_eal_iopl_init() and make it return -1 for Power and other architecture. Thus rte_config.flags will not contain EAL_FLG_HIGH_IOPL flag for other architecture.
--- lib/librte_eal/linuxapp/eal/eal.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
lib/librte_eal/linuxapp/eal/eal.c +8 -0
@@ -50,7 +50,9 @@#include <errno.h> #include <sys/mman.h> #include <sys/queue.h> +#if defined(RTE_ARCH_X86_64 ) || defined(RTE_ARCH_I686 )#include <sys/io.h> +#endif #include <rte_common.h> #include <rte_debug.h>
@@ -752,13 +754,19 @@ rte_eal_mcfg_complete(void)/* * Request iopl privilege for all RPL, returns 0 on success +* iopl() call is mostly for the i386 architecture. For other architectures, +* return -1 to indicate IO priviledge can't be changed in this way. */ int rte_eal_iopl_init (void ) { +#if defined(RTE_ARCH_X86_64 ) || defined(RTE_ARCH_I686 )if (iopl (3 ) !=0 )return -1 ;return 0 ; +#else +return -1 ; +#endif }/* Launch threads, called at application init(). */
Signature · 1 line
1.7.1
PATCH v5 10/14 Add cache size define for IBM Power Architecture
In reply to a message not in the archiveIBM Power architecture has different cache line size (128 bytes) than x86 (64 bytes). This patch defines CACHE_LINE_SIZE to 128 bytes to override the default value 64 bytes to support IBM Power Architecture.
--- app/test/test_malloc.c | 8 ++++---- mk/arch/ppc_64/rte.vars.mk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
app/test/test_malloc.c +4 -4
@@ -300,9 +300,9 @@ test_big_alloc(void)size_t size =rte_str_to_size (MALLOC_MEMZONE_SIZE )*2 ;int align =0 ;#ifndef RTE_LIBRTE_MALLOC_DEBUG -int overhead =64 +64 ; +int overhead =CACHE_LINE_SIZE +CACHE_LINE_SIZE ;#else -int overhead =64 +64 +64 ; +int overhead =CACHE_LINE_SIZE +CACHE_LINE_SIZE +CACHE_LINE_SIZE ;#endif rte_malloc_get_socket_stats (socket, &pre_stats);
@@ -356,9 +356,9 @@ test_multi_alloc_statistics(void)#ifndef RTE_LIBRTE_MALLOC_DEBUG int trailer_size =0 ;#else -int trailer_size =64 ; +int trailer_size =CACHE_LINE_SIZE ;#endif -int overhead =64 + trailer_size; +int overhead =CACHE_LINE_SIZE + trailer_size;rte_malloc_get_socket_stats (socket, &pre_stats);
mk/arch/ppc_64/rte.vars.mk +1 -1
@@ -32,7 +32,7 @@ ARCH ?= powerpc CROSS ?= -CPU_CFLAGS ?= -m64 +CPU_CFLAGS ?= -m64 -DCACHE_LINE_SIZE=128 CPU_LDFLAGS ?= CPU_ASFLAGS ?= -felf64
Signature · 1 line
1.7.1
PATCH v5 11/14 Add huge page size define for IBM Power architecture
In reply to a message not in the archiveIBM Power architecture has different huge page sizes (16MB, 16GB) than x86.This patch defines RTE_PGSIZE_16M and RTE_PGSIZE_16G in the rte_page_sizes enum variable and adds huge page size support of DPDK for IBM Power architecture.
--- app/test/test_memzone.c | 123 ++++++++++++++++++++++++++- lib/librte_eal/common/eal_common_memzone.c | 19 +++- lib/librte_eal/common/include/rte_memory.h | 9 ++- lib/librte_eal/common/include/rte_memzone.h | 8 ++ lib/librte_eal/linuxapp/eal/eal.c | 9 ++- 5 files changed, 156 insertions(+), 12 deletions(-)
app/test/test_memzone.c +122 -1
@@ -133,6 +133,8 @@ test_memzone_reserve_flags(void)const struct rte_memseg *ms;int hugepage_2MB_avail =0 ;int hugepage_1GB_avail =0 ; +int hugepage_16MB_avail =0 ; +int hugepage_16GB_avail =0 ;const size_t size =100 ;int i =0 ; ms =rte_eal_get_physmem_layout ();
@@ -141,12 +143,20 @@ test_memzone_reserve_flags(void) hugepage_2MB_avail =1 ;if (ms[i].hugepage_sz ==RTE_PGSIZE_1G ) hugepage_1GB_avail =1 ; +if (ms[i].hugepage_sz ==RTE_PGSIZE_16M ) + hugepage_16MB_avail =1 ; +if (ms[i].hugepage_sz ==RTE_PGSIZE_16G ) + hugepage_16GB_avail =1 ; } -/* Display the availability of 2MB and 1GB pages */ +/* Display the availability of 2MB ,1GB, 16MB, 16GB pages */ if (hugepage_2MB_avail)printf ("2MB Huge pages available\n" );if (hugepage_1GB_avail)printf ("1GB Huge pages available\n" ); +if (hugepage_16MB_avail) +printf ("16MB Huge pages available\n" ); +if (hugepage_16GB_avail) +printf ("16GB Huge pages available\n" );/* * If 2MB pages available, check that a small memzone is correctly * reserved from 2MB huge pages when requested by the RTE_MEMZONE_2MB flag.
@@ -255,6 +265,117 @@ test_memzone_reserve_flags(void) } } } +/* +* This option is for IBM Power. If 16MB pages available, check +* that a small memzone is correctly reserved from 16MB huge pages +* when requested by the RTE_MEMZONE_16MB flag. Also check that +* RTE_MEMZONE_SIZE_HINT_ONLY flag only defaults to an available +* page size (i.e 16GB ) when 16MB pages are unavailable. +*/ +if (hugepage_16MB_avail) { + mz =rte_memzone_reserve ("flag_zone_16M" , size,SOCKET_ID_ANY , +RTE_MEMZONE_16MB ); +if (mz ==NULL ) { +printf ("MEMZONE FLAG 16MB\n" ); +return -1 ; + } +if (mz->hugepage_sz !=RTE_PGSIZE_16M ) { +printf ("hugepage_sz not equal 16M\n" ); +return -1 ; + } + + mz =rte_memzone_reserve ("flag_zone_16M_HINT" , size, +SOCKET_ID_ANY ,RTE_MEMZONE_16MB |RTE_MEMZONE_SIZE_HINT_ONLY ); +if (mz ==NULL ) { +printf ("MEMZONE FLAG 2MB\n" ); +return -1 ; + } +if (mz->hugepage_sz !=RTE_PGSIZE_16M ) { +printf ("hugepage_sz not equal 16M\n" ); +return -1 ; + } + +/* Check if 1GB huge pages are unavailable, that function fails +* unless HINT flag is indicated +*/ +if (!hugepage_16GB_avail) { + mz =rte_memzone_reserve ("flag_zone_16G_HINT" , size, +SOCKET_ID_ANY , +RTE_MEMZONE_16GB |RTE_MEMZONE_SIZE_HINT_ONLY ); +if (mz ==NULL ) { +printf ("MEMZONE FLAG 16GB & HINT\n" ); +return -1 ; + } +if (mz->hugepage_sz !=RTE_PGSIZE_16M ) { +printf ("hugepage_sz not equal 16M\n" ); +return -1 ; + } + + mz =rte_memzone_reserve ("flag_zone_16G" , size, +SOCKET_ID_ANY ,RTE_MEMZONE_16GB ); +if (mz !=NULL ) { +printf ("MEMZONE FLAG 16GB\n" ); +return -1 ; + } + } + } +/*As with 16MB tests above for 16GB huge page requests*/ +if (hugepage_16GB_avail) { + mz =rte_memzone_reserve ("flag_zone_16G" , size,SOCKET_ID_ANY , +RTE_MEMZONE_16GB ); +if (mz ==NULL ) { +printf ("MEMZONE FLAG 16GB\n" ); +return -1 ; + } +if (mz->hugepage_sz !=RTE_PGSIZE_16G ) { +printf ("hugepage_sz not equal 16G\n" ); +return -1 ; + } + + mz =rte_memzone_reserve ("flag_zone_16G_HINT" , size, +SOCKET_ID_ANY ,RTE_MEMZONE_16GB |RTE_MEMZONE_SIZE_HINT_ONLY ); +if (mz ==NULL ) { +printf ("MEMZONE FLAG 16GB\n" ); +return -1 ; + } +if (mz->hugepage_sz !=RTE_PGSIZE_16G ) { +printf ("hugepage_sz not equal 16G\n" ); +return -1 ; + } + +/* Check if 1GB huge pages are unavailable, that function fails +* unless HINT flag is indicated +*/ +if (!hugepage_16MB_avail) { + mz =rte_memzone_reserve ("flag_zone_16M_HINT" , size, +SOCKET_ID_ANY , +RTE_MEMZONE_16MB |RTE_MEMZONE_SIZE_HINT_ONLY ); +if (mz ==NULL ) { +printf ("MEMZONE FLAG 16MB & HINT\n" ); +return -1 ; + } +if (mz->hugepage_sz !=RTE_PGSIZE_16G ) { +printf ("hugepage_sz not equal 16G\n" ); +return -1 ; + } + mz =rte_memzone_reserve ("flag_zone_16M" , size, +SOCKET_ID_ANY ,RTE_MEMZONE_16MB ); +if (mz !=NULL ) { +printf ("MEMZONE FLAG 16MB\n" ); +return -1 ; + } + } + +if (hugepage_16MB_avail && hugepage_16GB_avail) { + mz =rte_memzone_reserve ("flag_zone_16M_HINT" , size, +SOCKET_ID_ANY , +RTE_MEMZONE_16MB |RTE_MEMZONE_16GB ); +if (mz !=NULL ) { +printf ("BOTH SIZES SET\n" ); +return -1 ; + } + } + }return 0 ; }
lib/librte_eal/common/eal_common_memzone.c +14 -5
@@ -216,10 +216,16 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,/* check flags for hugepage sizes */ if ((flags &RTE_MEMZONE_2MB ) && - free_memseg[i].hugepage_sz ==RTE_PGSIZE_1G ) + free_memseg[i].hugepage_sz ==RTE_PGSIZE_1G )continue ;if ((flags &RTE_MEMZONE_1GB ) && - free_memseg[i].hugepage_sz ==RTE_PGSIZE_2M ) + free_memseg[i].hugepage_sz ==RTE_PGSIZE_2M ) +continue ; +if ((flags &RTE_MEMZONE_16MB ) && + free_memseg[i].hugepage_sz ==RTE_PGSIZE_16G ) +continue ; +if ((flags &RTE_MEMZONE_16GB ) && + free_memseg[i].hugepage_sz ==RTE_PGSIZE_16M )continue ;/* this segment is the best until now */
@@ -256,7 +262,8 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,* try allocating again without the size parameter otherwise -fail. */ if ((flags &RTE_MEMZONE_SIZE_HINT_ONLY ) && - ((flags &RTE_MEMZONE_1GB ) || (flags &RTE_MEMZONE_2MB ))) + ((flags &RTE_MEMZONE_1GB ) || (flags &RTE_MEMZONE_2MB ) + || (flags &RTE_MEMZONE_16MB ) || (flags &RTE_MEMZONE_16GB )))return memzone_reserve_aligned_thread_unsafe (name, len, socket_id,0 , align, bound);
@@ -313,7 +320,8 @@ rte_memzone_reserve_aligned(const char *name, size_t len,const struct rte_memzone *mz =NULL ;/* both sizes cannot be explicitly called for */ -if ((flags &RTE_MEMZONE_1GB ) && (flags &RTE_MEMZONE_2MB )) { +if (((flags &RTE_MEMZONE_1GB ) && (flags &RTE_MEMZONE_2MB )) + || ((flags &RTE_MEMZONE_16MB ) && (flags &RTE_MEMZONE_16GB ))) { rte_errno =EINVAL ;return NULL ; }
@@ -344,7 +352,8 @@ rte_memzone_reserve_bounded(const char *name, size_t len,const struct rte_memzone *mz =NULL ;/* both sizes cannot be explicitly called for */ -if ((flags &RTE_MEMZONE_1GB ) && (flags &RTE_MEMZONE_2MB )) { +if (((flags &RTE_MEMZONE_1GB ) && (flags &RTE_MEMZONE_2MB )) + || ((flags &RTE_MEMZONE_16MB ) && (flags &RTE_MEMZONE_16GB ))) { rte_errno =EINVAL ;return NULL ; }
lib/librte_eal/common/include/rte_memory.h +6 -3
@@ -53,9 +53,12 @@ extern "C" {#endif enum rte_page_sizes { -RTE_PGSIZE_4K =1 <<12 , -RTE_PGSIZE_2M =RTE_PGSIZE_4K <<9 , -RTE_PGSIZE_1G =RTE_PGSIZE_2M <<9 +RTE_PGSIZE_4K =1ULL <<12 , +RTE_PGSIZE_2M =1ULL <<21 , +RTE_PGSIZE_1G =1ULL <<30 , +RTE_PGSIZE_64K =1ULL <<16 , +RTE_PGSIZE_16M =1ULL <<24 , +RTE_PGSIZE_16G =1ULL <<34 };#define SOCKET_ID_ANY -1/**< Any NUMA socket. */
lib/librte_eal/common/include/rte_memzone.h +8 -0
@@ -60,6 +60,8 @@ extern "C" {#define RTE_MEMZONE_2MB 0x00000001/**< Use 2MB pages. */ #define RTE_MEMZONE_1GB 0x00000002/**< Use 1GB pages. */ +#define RTE_MEMZONE_16MB 0x00000100/**< Use 16MB pages. */ +#define RTE_MEMZONE_16GB 0x00000200/**< Use 16GB pages. */ #define RTE_MEMZONE_SIZE_HINT_ONLY 0x00000004/**< Use available page size */ /**
@@ -111,6 +113,8 @@ struct rte_memzone {* taken from 1GB or 2MB hugepages. * - RTE_MEMZONE_2MB - Reserve from 2MB pages * - RTE_MEMZONE_1GB - Reserve from 1GB pages +* - RTE_MEMZONE_16MB - Reserve from 16MB pages +* - RTE_MEMZONE_16GB - Reserve from 16GB pages * - RTE_MEMZONE_SIZE_HINT_ONLY - Allow alternative page size to be used if * the requested page size is unavailable. * If this flag is not set, the function
@@ -156,6 +160,8 @@ const struct rte_memzone *rte_memzone_reserve(const char *name,* taken from 1GB or 2MB hugepages. * - RTE_MEMZONE_2MB - Reserve from 2MB pages * - RTE_MEMZONE_1GB - Reserve from 1GB pages +* - RTE_MEMZONE_16MB - Reserve from 16MB pages +* - RTE_MEMZONE_16GB - Reserve from 16GB pages * - RTE_MEMZONE_SIZE_HINT_ONLY - Allow alternative page size to be used if * the requested page size is unavailable. * If this flag is not set, the function
@@ -206,6 +212,8 @@ const struct rte_memzone *rte_memzone_reserve_aligned(const char *name,* taken from 1GB or 2MB hugepages. * - RTE_MEMZONE_2MB - Reserve from 2MB pages * - RTE_MEMZONE_1GB - Reserve from 1GB pages +* - RTE_MEMZONE_16MB - Reserve from 16MB pages +* - RTE_MEMZONE_16GB - Reserve from 16GB pages * - RTE_MEMZONE_SIZE_HINT_ONLY - Allow alternative page size to be used if * the requested page size is unavailable. * If this flag is not set, the function
lib/librte_eal/linuxapp/eal/eal.c +6 -3
@@ -455,9 +455,12 @@ eal_parse_base_virtaddr(const char *arg)return -1 ;#endif -/* align the addr on 2M boundary */ - internal_config.base_virtaddr =RTE_PTR_ALIGN_CEIL ((uintptr_t )addr, -RTE_PGSIZE_2M ); +/* align the addr on 16M boundary, 16MB is the minimum huge page +* size on IBM Power architecture. If the addr is aligned to 16MB, +* it can align to 2MB for x86. So this alignment can also be used +* on x86 */ + internal_config.base_virtaddr = +RTE_PTR_ALIGN_CEIL ((uintptr_t )addr,RTE_PGSIZE_16M );return 0 ; }
Signature · 1 line
1.7.1
PATCH v5 12/14 Add eal memory support for IBM Power Architecture
In reply to a message not in the archiveThe mmap of hugepage files on IBM Power starts from high address to low address. This is different from x86. This patch modified the memory segment detection code to get the correct memory segment layout on Power architecture. This patch also added a commond ARCH_PPC_64 defination for 64 bit systems.
--- config/defconfig_ppc_64-power8-linuxapp-gcc | 1 + config/defconfig_x86_64-native-linuxapp-clang | 1 + config/defconfig_x86_64-native-linuxapp-gcc | 1 + config/defconfig_x86_64-native-linuxapp-icc | 1 + lib/librte_eal/linuxapp/eal/eal_memory.c | 91 ++++++++++++++++++------- 5 files changed, 71 insertions(+), 24 deletions(-)
config/defconfig_ppc_64-power8-linuxapp-gcc +1 -0
@@ -35,6 +35,7 @@ CONFIG_RTE_MACHINE="power8" CONFIG_RTE_ARCH="ppc_64" CONFIG_RTE_ARCH_PPC_64=y CONFIG_RTE_ARCH_BIG_ENDIAN=y +CONFIG_RTE_ARCH_64=y CONFIG_RTE_TOOLCHAIN="gcc" CONFIG_RTE_TOOLCHAIN_GCC=y
config/defconfig_x86_64-native-linuxapp-clang +1 -0
@@ -36,6 +36,7 @@ CONFIG_RTE_MACHINE="native" CONFIG_RTE_ARCH="x86_64" CONFIG_RTE_ARCH_X86_64=y +CONFIG_RTE_ARCH_64=y CONFIG_RTE_TOOLCHAIN="clang" CONFIG_RTE_TOOLCHAIN_CLANG=y
config/defconfig_x86_64-native-linuxapp-gcc +1 -0
@@ -36,6 +36,7 @@ CONFIG_RTE_MACHINE="native" CONFIG_RTE_ARCH="x86_64" CONFIG_RTE_ARCH_X86_64=y +CONFIG_RTE_ARCH_64=y CONFIG_RTE_TOOLCHAIN="gcc" CONFIG_RTE_TOOLCHAIN_GCC=y
config/defconfig_x86_64-native-linuxapp-icc +1 -0
@@ -36,6 +36,7 @@ CONFIG_RTE_MACHINE="native" CONFIG_RTE_ARCH="x86_64" CONFIG_RTE_ARCH_X86_64=y +CONFIG_RTE_ARCH_64=y CONFIG_RTE_TOOLCHAIN="icc" CONFIG_RTE_TOOLCHAIN_ICC=y
lib/librte_eal/linuxapp/eal/eal_memory.c +67 -24
168 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v5 13/14 test_memzone:fix finding the second smallest segment
In reply to a message not in the archiveCurent implementation in test_memzone.c has bugs in finding the second smallest memory segment. It's the last smallest memory segment, but it's not the second smallest memory segment. This bug may cause test failure in some cases. This patch fixes this bug.
--- app/test/test_memzone.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-)
app/test/test_memzone.c +4 -5
@@ -797,10 +797,9 @@ test_memzone_reserve_memory_in_smallest_segment(void)/* set new smallest */ min_ms = ms; - } -else if (prev_min_ms ==NULL ) { + }else if ((prev_min_ms ==NULL ) + || (prev_min_ms->len > ms->len)) prev_min_ms = ms; - } }if (min_ms ==NULL || prev_min_ms ==NULL ) {
@@ -877,8 +876,8 @@ test_memzone_reserve_memory_with_smallest_offset(void)/* set new smallest */ min_ms = ms; - } -else if (prev_min_ms ==NULL ) { + }else if ((prev_min_ms ==NULL ) + || (prev_min_ms->len > ms->len)) { prev_min_ms = ms; } }
Signature · 1 line
1.7.1
PATCH v5 14/14 Fix the compiling of test-pmd on IBM Power Architecture
In reply to a message not in the archiveThis patch fixes compiling problems on IBM Power architecture and turn on the test-pmd compiling option in configuration file. Actually, this is an big endian compiling fix.
--- app/test-pmd/config.c | 39 +++++++++++++++++++++++++-------------- 1 files changed, 25 insertions(+), 14 deletions(-)
app/test-pmd/config.c +25 -14
@@ -612,8 +612,13 @@ ring_dma_zone_lookup(const char *ring_name, uint8_t port_id, uint16_t q_id)union igb_ring_dword {uint64_t dword;struct { +#ifdef RTE_ARCH_BIG_ENDIAN +uint32_t lo; +uint32_t hi; +#else uint32_t hi;uint32_t lo; +#endif } words; };
@@ -656,23 +661,29 @@ ring_rx_descriptor_display(const struct rte_memzone *ring_mz,/* 32 bytes RX descriptor, i40e only */ struct igb_ring_desc_32_bytes *ring = (struct igb_ring_desc_32_bytes *)ring_mz->addr; + ring[desc_id].lo_dword.dword = +rte_le_to_cpu_64 (ring[desc_id].lo_dword.dword); +ring_rxd_display_dword (ring[desc_id].lo_dword); + ring[desc_id].hi_dword.dword = +rte_le_to_cpu_64 (ring[desc_id].hi_dword.dword); +ring_rxd_display_dword (ring[desc_id].hi_dword); + ring[desc_id].resv1.dword = +rte_le_to_cpu_64 (ring[desc_id].resv1.dword); +ring_rxd_display_dword (ring[desc_id].resv1); + ring[desc_id].resv2.dword = +rte_le_to_cpu_64 (ring[desc_id].resv2.dword); +ring_rxd_display_dword (ring[desc_id].resv2); -ring_rxd_display_dword (rte_le_to_cpu_64 ( - ring[desc_id].lo_dword)); -ring_rxd_display_dword (rte_le_to_cpu_64 ( - ring[desc_id].hi_dword)); -ring_rxd_display_dword (rte_le_to_cpu_64 ( - ring[desc_id].resv1)); -ring_rxd_display_dword (rte_le_to_cpu_64 ( - ring[desc_id].resv2));return ; }#endif /* 16 bytes RX descriptor */ -ring_rxd_display_dword (rte_le_to_cpu_64 ( - ring[desc_id].lo_dword)); -ring_rxd_display_dword (rte_le_to_cpu_64 ( - ring[desc_id].hi_dword)); + ring[desc_id].lo_dword.dword = +rte_le_to_cpu_64 (ring[desc_id].lo_dword.dword); +ring_rxd_display_dword (ring[desc_id].lo_dword); + ring[desc_id].hi_dword.dword = +rte_le_to_cpu_64 (ring[desc_id].hi_dword.dword); +ring_rxd_display_dword (ring[desc_id].hi_dword); } static void
@@ -682,8 +693,8 @@ ring_tx_descriptor_display(const struct rte_memzone *ring_mz, uint16_t desc_id)struct igb_ring_desc_16_bytes txd; ring = (struct igb_ring_desc_16_bytes *)ring_mz->addr; - txd.lo_dword =rte_le_to_cpu_64 (ring[desc_id].lo_dword); - txd.hi_dword =rte_le_to_cpu_64 (ring[desc_id].hi_dword); + txd.lo_dword.dword =rte_le_to_cpu_64 (ring[desc_id].lo_dword.dword); + txd.hi_dword.dword =rte_le_to_cpu_64 (ring[desc_id].hi_dword.dword); printf(" 0x%08X - 0x%08X / 0x%08X - 0x%08X\n", (unsigned)txd.lo_dword.words.lo, (unsigned)txd.lo_dword.words.hi,
Signature · 1 line
1.7.1
David Marchand
Acked-byQuoted 7 lines · Chao Zhu
The set of patches add IBM Power architecture to the DPDK. It adds the required support to the EAL library. This set of patches doesn't support full DPDK function on Power processors. To compile on PPC64 architecture, GCC version >= 4.8 must be used. According to Bruce and Neil's comments, this v5 patch removed the common configuration files of Powerpc in v4. Also, it fixed the checkpatch issues in v3.
Quoted 7 lines
The only unsolved checkpatch issue is :
ERROR: space prohibited before open square bracket '['This issue refers to the asm code input/output naming. But I think the error is invalid.
I must admit that the architecture abstraction in dpdk is not fully done, but it is more a "core" problem than a problem of this port itself. I am pretty sure that there is still a lot of places in dpdk that rely on the fact that they were written for x86 architecture.
Neil's concerns on cpuflags (
http://dpdk.org/ml/archives/dev/2014-November/008769.html) are valid but I think we could go with an incremental approach.
Since Chao is commited to add power support to dpdk, we can have this fixed in subsequent patches with this patchset in 1.8.
So, this patchset looks good enough to me.
Signature · 1 line
David Marchand
A message that is not in the archive (sent off-list or not yet received): CALwxeUt+67TLtnWmf1QW85fT6D=7kcQ0S35MA-ai+=zvWUX47g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Thomas Monjalon
Applied2014-11-26 10:32, David Marchand:
Quoted 29 lines
Quoted 7 lines · Chao Zhu
The set of patches add IBM Power architecture to the DPDK. It adds the required support to the EAL library. This set of patches doesn't support full DPDK function on Power processors. To compile on PPC64 architecture, GCC version >= 4.8 must be used. According to Bruce and Neil's comments, this v5 patch removed the common configuration files of Powerpc in v4. Also, it fixed the checkpatch issues in v3.
Quoted 7 lines
The only unsolved checkpatch issue is :
ERROR: space prohibited before open square bracket '['This issue refers to the asm code input/output naming. But I think the error is invalid.
I must admit that the architecture abstraction in dpdk is not fully done, but it is more a "core" problem than a problem of this port itself. I am pretty sure that there is still a lot of places in dpdk that rely on the fact that they were written for x86 architecture.
Neil's concerns on cpuflags (
http://dpdk.org/ml/archives/dev/2014-November/008769.html) are valid but I think we could go with an incremental approach.
Since Chao is commited to add power support to dpdk, we can have this fixed in subsequent patches with this patchset in 1.8.
Quoted 2 lines
So, this patchset looks good enough to me.
Acked-by David Marchand <[email protected]>
Applied.
Nice to see a new architecture.
We'll have to make things more generic and do more tests but this is a good first step.
Thanks
Signature · 1 line
Thomas