enable lpm, acl and other missing libraries in ppc64le
v4 cover enable lpm, acl and other missing libraries in ppc64le
This patchset enables LPM, ACL and other few missing libs in ppc64le and also address few patches in related examples (ip_pipeline and l3fwd).
Test report:
LPM and ACL unit tests passed.
RTE>>acl_autotest
ACL: allocation of 25166728 bytes on socket 33 for ACL_acl_ctx failed
ACL: rte_acl_add_rules(acl_ctx): rule #1 is invalid
ACL: rte_acl_ipv4vlan_add_rules: rule #1 is invalid
ACL: rte_acl_ipv4vlan_add_rules: rule #1 is invalid
ACL: rte_acl_ipv4vlan_add_rules: rule #1 is invalid
ACL: rte_acl_ipv4vlan_add_rules: rule #1 is invalid
ACL: rte_acl_add_rules(acl_ctx): rule #1 is invalid
acl context <acl_ctx>@0x3effe07ffb80
socket_id=-1
alg=5
max_rules=196608
rule_size=128
num_rules=0
num_categories=0
num_tries=0
acl context <acl_ctx>@0x3effe07ffb80
socket_id=-1
alg=5
max_rules=196608
rule_size=128
num_rules=0
num_categories=0
num_tries=0
running test_convert_rules(acl_ipv4vlan_tuple)
running test_convert_rules(acl_ipv4vlan_tuple, RTE_ACL_FIELD_TYPE_BITMASK type for IPv4) running test_convert_rules(acl_ipv4vlan_tuple, RTE_ACL_FIELD_TYPE_RANGE type for IPv4) running test_convert_rules(acl_ipv4vlan_tuple: swap VLAN and PORTs order) running test_convert_rules(acl_ipv4vlan_tuple: swap SRC and DST IPv4 order) Test OK
RTE>>lpm_autotest
Test OK
v4 changes:
- fix transition4 in acl_run_altivec.h for gcc strict-aliasing error. Thanks to Chao Zhu for bringing up.
v3 changes:
- rebase over master to fix conflict in examples/l3fwd/l3fwd_em.c
v2 changes:
- enabling libs in config included as part of lib changes itself.
gowrishankar (6):
lpm: add altivec intrinsics for dpdk lpm on ppc_64
acl: add altivec intrinsics for dpdk acl on ppc_64
ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
table: cache align rte_bucket_4_8
sched: enable sched library for ppc64le
l3fwd: add altivec support for em_hash_key
app/test-acl/main.c | 4 + app/test/test_xmmt_ops.h | 16 + config/defconfig_ppc_64-power8-linuxapp-gcc | 7 - examples/ip_pipeline/cpu_core_map.c | 12 +- examples/ip_pipeline/init.c | 4 + examples/l3fwd/l3fwd_em.c | 10 +- lib/librte_acl/Makefile | 2 + lib/librte_acl/acl.h | 4 + lib/librte_acl/acl_run.h | 2 + lib/librte_acl/acl_run_altivec.c | 47 +++ lib/librte_acl/acl_run_altivec.h | 329 +++++++++++++++++++++ lib/librte_acl/rte_acl.c | 13 + lib/librte_acl/rte_acl.h | 1 + .../common/include/arch/ppc_64/rte_vect.h | 60 ++++ lib/librte_lpm/Makefile | 2 + lib/librte_lpm/rte_lpm.h | 2 + lib/librte_lpm/rte_lpm_altivec.h | 154 ++++++++++ lib/librte_table/rte_table_hash_key8.c | 2 +- 18 files changed, 651 insertions(+), 20 deletions(-) create mode 100644 lib/librte_acl/acl_run_altivec.c create mode 100644 lib/librte_acl/acl_run_altivec.h create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_vect.h create mode 100644 lib/librte_lpm/rte_lpm_altivec.h
Signature · 1 line
1.9.1
PATCH v4 1/6 lpm: add altivec intrinsics for dpdk lpm on ppc_64
From: gowrishankar <[email protected]>
This patch adds ppc64le port for LPM library in DPDK.
--- app/test/test_xmmt_ops.h | 16 +++ config/defconfig_ppc_64-power8-linuxapp-gcc | 1 - .../common/include/arch/ppc_64/rte_vect.h | 60 ++++++++ lib/librte_lpm/Makefile | 2 + lib/librte_lpm/rte_lpm.h | 2 + lib/librte_lpm/rte_lpm_altivec.h | 154 +++++++++++++++++++++ 6 files changed, 234 insertions(+), 1 deletion(-) create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_vect.h create mode 100644 lib/librte_lpm/rte_lpm_altivec.h
app/test/test_xmmt_ops.h +16 -0
@@ -62,6 +62,22 @@ vect_set_epi32(int i3, int i2, int i1, int i0)/* sets the 4 signed 32-bit integer values and returns the xmm_t variable */ #define vect_set_epi32 (i3, i2, i1, i0) _mm_set_epi32(i3, i2, i1, i0) +#elif defined(RTE_ARCH_PPC_64 ) + +/* vect_* abstraction implementation using ALTIVEC */ + +/* loads the xmm_t value from address p(does not need to be 16-byte aligned)*/ +#define vect_loadu_sil128 (p) vec_ld(0, p) + +/* sets the 4 signed 32-bit integer values and returns the xmm_t variable */ +static inline xmm_t __attribute__((always_inline)) +vect_set_epi32 (int i3,int i2,int i1,int i0) +{ +xmm_t data = (xmm_t ){i0, i1, i2, i3}; + +return data; +} +#endif #endif /* _TEST_XMMT_OPS_H_ */
config/defconfig_ppc_64-power8-linuxapp-gcc +0 -1
@@ -57,7 +57,6 @@ CONFIG_RTE_LIBRTE_ENIC_PMD=n CONFIG_RTE_LIBRTE_FM10K_PMD=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
lib/librte_eal/common/include/arch/ppc_64/rte_vect.h new file +60 -0
60 lines not on this page · raw message
lib/librte_lpm/Makefile +2 -0
@@ -51,6 +51,8 @@ ifneq ($(filter y,$(CONFIG_RTE_ARCH_ARM) $(CONFIG_RTE_ARCH_ARM64)),) SYMLINK-$(CONFIG_RTE_LIBRTE_LPM)-include += rte_lpm_neon.h else ifeq ($(CONFIG_RTE_ARCH_X86),y) SYMLINK-$(CONFIG_RTE_LIBRTE_LPM)-include += rte_lpm_sse.h +else ifeq ($(CONFIG_RTE_ARCH_PPC_64),y) +SYMLINK-$(CONFIG_RTE_LIBRTE_LPM)-include += rte_lpm_altivec.h endif # this lib needs eal
lib/librte_lpm/rte_lpm.h +2 -0
@@ -480,6 +480,8 @@ rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],#if defined(RTE_ARCH_ARM ) || defined(RTE_ARCH_ARM64 )#include "rte_lpm_neon.h" +#elif defined(RTE_ARCH_PPC_64 ) +#include "rte_lpm_altivec.h" #else #include "rte_lpm_sse.h" #endif
lib/librte_lpm/rte_lpm_altivec.h new file +154 -0
154 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v4 2/6 acl: add altivec intrinsics for dpdk acl on ppc_64
In reply to Gowrishankar MuthukrishnanFrom: gowrishankar <[email protected]>
This patch adds port for ACL library in ppc64le.
--- app/test-acl/main.c | 4 + config/defconfig_ppc_64-power8-linuxapp-gcc | 1 - lib/librte_acl/Makefile | 2 + lib/librte_acl/acl.h | 4 + lib/librte_acl/acl_run.h | 2 + lib/librte_acl/acl_run_altivec.c | 47 ++++ lib/librte_acl/acl_run_altivec.h | 329 ++++++++++++++++++++++++++++ lib/librte_acl/rte_acl.c | 13 ++ lib/librte_acl/rte_acl.h | 1 + 9 files changed, 402 insertions(+), 1 deletion(-) create mode 100644 lib/librte_acl/acl_run_altivec.c create mode 100644 lib/librte_acl/acl_run_altivec.h
app/test-acl/main.c +4 -0
@@ -105,6 +105,10 @@ static const struct acl_alg acl_alg[] = { .name = "neon", .alg = RTE_ACL_CLASSIFY_NEON, }, + { + .name = "altivec", + .alg = RTE_ACL_CLASSIFY_ALTIVEC, + }, }; static struct {
config/defconfig_ppc_64-power8-linuxapp-gcc +0 -1
@@ -57,7 +57,6 @@ CONFIG_RTE_LIBRTE_ENIC_PMD=n CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. So they're turned off. -CONFIG_RTE_LIBRTE_ACL=n CONFIG_RTE_LIBRTE_SCHED=n CONFIG_RTE_LIBRTE_PORT=n CONFIG_RTE_LIBRTE_TABLE=n
lib/librte_acl/Makefile +2 -0
@@ -52,6 +52,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_scalar.c ifneq ($(filter y,$(CONFIG_RTE_ARCH_ARM) $(CONFIG_RTE_ARCH_ARM64)),) SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_neon.c CFLAGS_acl_run_neon.o += -flax-vector-conversions -Wno-maybe-uninitialized +else ifeq ($(CONFIG_RTE_ARCH_PPC_64),y) +SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_altivec.c else SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_sse.c #check if flag for SSE4.1 is already on, if not set it up manually
lib/librte_acl/acl.h +4 -0
@@ -234,6 +234,10 @@ int rte_acl_classify_neon(const struct rte_acl_ctx *ctx, const uint8_t **data, uint32_t *results, uint32_t num, uint32_t categories); +int +rte_acl_classify_altivec (const struct rte_acl_ctx *ctx,const uint8_t **data, +uint32_t *results,uint32_t num,uint32_t categories); + #ifdef __cplusplus }#endif /* __cplusplus */
lib/librte_acl/acl_run.h +2 -0
@@ -39,7 +39,9 @@#define MAX_SEARCHES_AVX16 16#define MAX_SEARCHES_SSE8 8 +#define MAX_SEARCHES_ALTIVEC8 8#define MAX_SEARCHES_SSE4 4 +#define MAX_SEARCHES_ALTIVEC4 4#define MAX_SEARCHES_SCALAR 2#define GET_NEXT_4BYTES (prm, idx) \
lib/librte_acl/acl_run_altivec.c new file +47 -0
47 lines not on this page · raw message
lib/librte_acl/acl_run_altivec.h new file +329 -0
329 lines not on this page · raw message
lib/librte_acl/rte_acl.c +13 -0
@@ -75,12 +75,23 @@ rte_acl_classify_neon(__rte_unused const struct rte_acl_ctx *ctx,return -ENOTSUP ; } +int __attribute__ ((weak)) +rte_acl_classify_altivec(__rte_unused const struct rte_acl_ctx *ctx, + __rte_unused const uint8_t **data, + __rte_unused uint32_t *results, + __rte_unused uint32_t num, + __rte_unused uint32_t categories) +{ +return -ENOTSUP ; +} +static const rte_acl_classify_t classify_fns[] = { [RTE_ACL_CLASSIFY_DEFAULT ] = rte_acl_classify_scalar, [RTE_ACL_CLASSIFY_SCALAR ] = rte_acl_classify_scalar, [RTE_ACL_CLASSIFY_SSE ] = rte_acl_classify_sse, [RTE_ACL_CLASSIFY_AVX2 ] = rte_acl_classify_avx2, [RTE_ACL_CLASSIFY_NEON ] = rte_acl_classify_neon, + [RTE_ACL_CLASSIFY_ALTIVEC ] = rte_acl_classify_altivec, };/* by default, use always available scalar code path. */
@@ -119,6 +130,8 @@ rte_acl_init(void)#elif defined(RTE_ARCH_ARM )if (rte_cpu_get_flag_enabled (RTE_CPUFLAG_NEON )) alg =RTE_ACL_CLASSIFY_NEON ; +#elif defined(RTE_ARCH_PPC_64 ) + alg =RTE_ACL_CLASSIFY_ALTIVEC ;#else #ifdef CC_AVX2_SUPPORT if (rte_cpu_get_flag_enabled (RTE_CPUFLAG_AVX2 ))
lib/librte_acl/rte_acl.h +1 -0
@@ -271,6 +271,7 @@ enum rte_acl_classify_alg {RTE_ACL_CLASSIFY_SSE =2 ,/**< requires SSE4.1 support. */ RTE_ACL_CLASSIFY_AVX2 =3 ,/**< requires AVX2 support. */ RTE_ACL_CLASSIFY_NEON =4 ,/**< requires NEON support. */ +RTE_ACL_CLASSIFY_ALTIVEC =5 ,/**< requires ALTIVEC support. */ RTE_ACL_CLASSIFY_NUM /* should always be the last one. */ };
Signature · 1 line
1.9.1
PATCH v4 3/6 ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
In reply to Gowrishankar MuthukrishnanFrom: gowrishankar <[email protected]>
offline lcore would still refer to original core id and this has to be considered while creating cpu core mask.
--- config/defconfig_ppc_64-power8-linuxapp-gcc | 3 --- examples/ip_pipeline/cpu_core_map.c | 12 +----------- examples/ip_pipeline/init.c | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-)
config/defconfig_ppc_64-power8-linuxapp-gcc +0 -3
@@ -58,6 +58,3 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. So they're turned off. CONFIG_RTE_LIBRTE_SCHED=n -CONFIG_RTE_LIBRTE_PORT=n -CONFIG_RTE_LIBRTE_TABLE=n -CONFIG_RTE_LIBRTE_PIPELINE=n
examples/ip_pipeline/cpu_core_map.c +1 -11
@@ -351,9 +351,6 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)int lcore_socket_id =cpu_core_map_get_socket_id_linux (lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -if (((uint32_t ) lcore_socket_id) == socket_id) n_detected++; }
@@ -368,18 +365,11 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)cpu_core_map_get_socket_id_linux ( lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -int lcore_core_id =cpu_core_map_get_core_id_linux ( lcore_id); -if (lcore_core_id <0 ) -return -1 ; - -if (((uint32_t ) lcore_socket_id == socket_id) && - ((uint32_t ) lcore_core_id == core_id)) { +if ((uint32_t ) lcore_socket_id == socket_id) { uint32_t pos = cpu_core_map_pos(map, socket_id, core_id_contig,
examples/ip_pipeline/init.c +4 -0
@@ -61,7 +61,11 @@ static void app_init_core_map(struct app_params *app) {APP_LOG (app,HIGH ,"Initializing CPU core map ..." ); +#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 ); +#else app->core_map =cpu_core_map_init (4 ,32 ,4 ,0 ); +#endif if (app->core_map ==NULL )rte_panic ("Cannot create CPU core map\n" );
Signature · 1 line
1.9.1
Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Gowrishankar,
Can you give more description about this patch?
Thank you!
-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月6日 20:33
To: [email protected]
Cc: Chao Zhu <[email protected]>; Bruce Richardson <[email protected]>; Konstantin Ananyev <[email protected]>; Thomas Monjalon <[email protected]>; Cristian Dumitrescu <[email protected]>; Pradeep <[email protected]>; gowrishankar <[email protected]>
Subject: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
From: gowrishankar <[email protected]>
offline lcore would still refer to original core id and this has to be considered while creating cpu core mask.
--- config/defconfig_ppc_64-power8-linuxapp-gcc | 3 --- examples/ip_pipeline/cpu_core_map.c | 12 +----------- examples/ip_pipeline/init.c | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-)
(quoted diff) +0 -0
b/config/defconfig_ppc_64-power8-linuxapp-gcc
index dede34f..a084672 100644
config/defconfig_ppc_64-power8-linuxapp-gcc +0 -0
@@ -58,6 +58,3 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. So they're turned
off.
CONFIG_RTE_LIBRTE_SCHED=n
-CONFIG_RTE_LIBRTE_PORT=n
-CONFIG_RTE_LIBRTE_TABLE=n
-CONFIG_RTE_LIBRTE_PIPELINE=n
(quoted diff) +0 -0
b/examples/ip_pipeline/cpu_core_map.c
index cb088b1..482e68e 100644
examples/ip_pipeline/cpu_core_map.c +0 -6
@@ -351,9 +351,6 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)int lcore_socket_id =cpu_core_map_get_socket_id_linux (lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -if (((uint32_t ) lcore_socket_id) == socket_id) n_detected++; }
@@ -368,18 +365,11 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)cpu_core_map_get_socket_id_linux ( lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -
Why to remove the lcore_socket_id check?
int lcore_core_id =
cpu_core_map_get_core_id_linux(
lcore_id);
- if (lcore_core_id < 0)
- return -1;
-
- if (((uint32_t) lcore_socket_id ==socket_id) &&
- ((uint32_t) lcore_core_id ==core_id)) {
+ if ((uint32_t) lcore_socket_id == socket_id)
{
uint32_t pos = cpu_core_map_pos(map,
socket_id, core_id_contig,
examples/ip_pipeline/init.c index renamed from examples/ip_pipeline/init.c +0 -0
cd167f6..60c931f 100644
examples/ip_pipeline/init.c +2 -0
@@ -61,7 +61,11 @@ static void app_init_core_map(struct app_params *app) {APP_LOG (app,HIGH ,"Initializing CPU core map ..." ); +#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else
This value seems quite strange. Can you give more detail?
app->core_map = cpu_core_map_init(4, 32, 4, 0);
+#endif
if (app->core_map == NULL)
rte_panic("Cannot create CPU core map\n");
--
1.9.1
Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Hi Chao,
Sure. Please find below one.
This patch fixes ip_pipeline panic in app_init_core_map while preparing cpu core map in powerpc with SMT off. cpu_core_map_compute_linux currently prepares core mapping based on file existence in sysfs ie.
/sys/devices/system/cpu/cpu<LCORE_NUM>/topology/physical_package_id
/sys/devices/system/cpu/cpu<LCORE_NUM>/topology/core_id
These files do not exist for lcores which are offline for any reason (as in powerpc, while SMT is off). In this situation, this function should further continue preparing map for other online lcores instead of returning with -1 for a first unavailable lcore.
Also, in SMT=off scenario for powerpc, lcore ids can not be always indexed from 0 upto 'number of cores present' (/sys/devices/system/cpu/present). For eg, for an online lcore 32, core_id returned in sysfs is 112 where online lcores are 10 (as in one configuration), hence sysfs lcore id can not be checked with indexing lcore number before positioning lcore map array.
Thanks,
Gowrishankar
Quoted 104 lines · Chao Zhu
Gowrishankar,
Can you give more description about this patch?
Thank you!-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月6日 20:33
To: [email protected]
Cc: Chao Zhu <[email protected]>; Bruce Richardson <[email protected]>; Konstantin Ananyev <[email protected]>; Thomas Monjalon <[email protected]>; Cristian Dumitrescu <[email protected]>; Pradeep <[email protected]>; gowrishankar <[email protected]>
Subject: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64From: gowrishankar <[email protected]>
offline lcore would still refer to original core id and this has to be considered while creating cpu core mask.
Signed-off-by Gowrishankar <[email protected]>--- config/defconfig_ppc_64-power8-linuxapp-gcc | 3 --- examples/ip_pipeline/cpu_core_map.c | 12 +----------- examples/ip_pipeline/init.c | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-)config/defconfig_ppc_64-power8-linuxapp-gcc +0
-0@@ -58,6 +58,3 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. So they're turnedoff.
CONFIG_RTE_LIBRTE_SCHED=nconfig/defconfig_ppc_64-power8-linuxapp-gcc +0
-3-CONFIG_RTE_LIBRTE_PORT=n -CONFIG_RTE_LIBRTE_TABLE=n -CONFIG_RTE_LIBRTE_PIPELINE=nexamples/ip_pipeline/cpu_core_map.c +0
-6@@ -351,9 +351,6 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)int lcore_socket_id =cpu_core_map_get_socket_id_linux (lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -if (((uint32_t ) lcore_socket_id) == socket_id) n_detected++; }@@ -368,18 +365,11 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)cpu_core_map_get_socket_id_linux ( lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -Why to remove the
lcore_socket_idcheck?int
lcore_core_id=
cpu_core_map_get_core_id_linux(
lcore_id);examples/ip_pipeline/cpu_core_map.c +0
-4-if (lcore_core_id <0 ) -return -1 ; - - if (((uint32_t) lcore_socket_id ==
socket_id) &&examples/ip_pipeline/cpu_core_map.c +0
-1- ((uint32_t) lcore_core_id ==
core_id)) {examples/ip_pipeline/cpu_core_map.c +1
-0+if ((uint32_t ) lcore_socket_id == socket_id){
uint32_tpos = cpu_core_map_pos(map,
socket_id,core_id_contig,examples/ip_pipeline/init.c index renamed from examples/ip_pipeline/init.c +0
-0cd167f6..60c931f 100644
examples/ip_pipeline/init.c +2
-0@@ -61,7 +61,11 @@ static void app_init_core_map(struct app_params *app) {APP_LOG (app,HIGH ,"Initializing CPU core map ..." ); +#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
app->core_map=cpu_core_map_init(4, 32, 4, 0);
+#endifif (
app->core_map== NULL)
rte_panic("Cannot create CPU core map\n");
--
1.9.1
Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Gowrishankar,
Thanks for the detail.
If my understanding is correct, Power8 has different chips. Some of the OpenPOWER chips have 8 cores per socket. And the max threads per core is 8. Should we support this in cpu_core_map_init()?
Here's a dump from the OpenPOWER system.
======================================
# lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 64 On-line CPU(s) list: 0,8,16,24,32,40,48,56 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63 Thread(s) per core: 1 Core(s) per socket: 8 Socket(s): 1 NUMA node(s): 1 Model: unknown L1d cache: 64K L1i cache: 32K L2 cache: 512K L3 cache: 8192K NUMA node0 CPU(s): 0,8,16,24,32,40,48,56 =========================================
Quoted 7 lines
examples/ip_pipeline/init.c +2
-0+#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
app->core_map=cpu_core_map_init(4, 32, 4, 0);
+#endif
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月9日 19:14
To: Chao Zhu <[email protected]>; [email protected]
Cc: 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Hi Chao,
Sure. Please find below one.
This patch fixes ip_pipeline panic in app_init_core_map while preparing cpu core map in powerpc with SMT off. cpu_core_map_compute_linux currently prepares core mapping based on file existence in sysfs ie.
/sys/devices/system/cpu/cpu<LCORE_NUM>/topology/physical_package_id
/sys/devices/system/cpu/cpu<LCORE_NUM>/topology/core_id
These files do not exist for lcores which are offline for any reason (as in powerpc, while SMT is off). In this situation, this function should further continue preparing map for other online lcores instead of returning with -1 for a first unavailable lcore.
Also, in SMT=off scenario for powerpc, lcore ids can not be always indexed from
0 upto 'number of cores present' (/sys/devices/system/cpu/present). For eg, for an online lcore 32, core_id returned in sysfs is 112 where online lcores are 10 (as in one configuration), hence sysfs lcore id can not be checked with indexing lcore number before positioning lcore map array.
Thanks,
Gowrishankar
Quoted 106 lines · Chao Zhu
Gowrishankar,
Can you give more description about this patch?
Thank you!-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月6日 20:33
To: [email protected]
Cc: Chao Zhu <[email protected]>; Bruce Richardson <[email protected]>; Konstantin Ananyev <[email protected]>; Thomas Monjalon <[email protected]>; Cristian Dumitrescu <[email protected]>; Pradeep <[email protected]>; gowrishankar <[email protected]>
Subject: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64From: gowrishankar <[email protected]>
offline lcore would still refer to original core id and this has to be considered while creating cpu core mask.
Signed-off-by Gowrishankar <[email protected]>--- config/defconfig_ppc_64-power8-linuxapp-gcc | 3 --- examples/ip_pipeline/cpu_core_map.c | 12 +----------- examples/ip_pipeline/init.c | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-)config/defconfig_ppc_64-power8-linuxapp-gcc +0
-0@@ -58,6 +58,3 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. So they'returned off.
CONFIG_RTE_LIBRTE_SCHED=nconfig/defconfig_ppc_64-power8-linuxapp-gcc +0
-3-CONFIG_RTE_LIBRTE_PORT=n -CONFIG_RTE_LIBRTE_TABLE=n -CONFIG_RTE_LIBRTE_PIPELINE=nexamples/ip_pipeline/cpu_core_map.c +0
-6@@ -351,9 +351,6 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)int lcore_socket_id =cpu_core_map_get_socket_id_linux (lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -if (((uint32_t ) lcore_socket_id) == socket_id) n_detected++; }@@ -368,18 +365,11 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)cpu_core_map_get_socket_id_linux ( lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -Why to remove the
lcore_socket_idcheck?int
lcore_core_id=
cpu_core_map_get_core_id_linux(
lcore_id);examples/ip_pipeline/cpu_core_map.c +0
-4-if (lcore_core_id <0 ) -return -1 ; - - if (((uint32_t) lcore_socket_id ==
socket_id) &&examples/ip_pipeline/cpu_core_map.c +0
-1- ((uint32_t) lcore_core_id ==
core_id)) {examples/ip_pipeline/cpu_core_map.c +1
-0+if ((uint32_t ) lcore_socket_id == socket_id){
uint32_tpos = cpu_core_map_pos(map,
socket_id,core_id_contig,examples/ip_pipeline/init.c +2
-0@@ -61,7 +61,11 @@ static void app_init_core_map(struct app_params *app) {APP_LOG (app,HIGH ,"Initializing CPU core map ..." ); +#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
app->core_map=cpu_core_map_init(4, 32, 4, 0);
+#endifif (
app->core_map== NULL)
rte_panic("Cannot create CPU core map\n");
--
1.9.1
Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Quoted 26 lines · Chao Zhu
Gowrishankar,
Thanks for the detail.
If my understanding is correct, Power8 has different chips. Some of the OpenPOWER chips have 8 cores per socket. And the max threads per core is 8. Should we support this incpu_core_map_init()?Here's a dump from the OpenPOWER system.
======================================# lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 64 On-line CPU(s) list: 0,8,16,24,32,40,48,56 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63 Thread(s) per core: 1 Core(s) per socket: 8 Socket(s): 1 NUMA node(s): 1 Model: unknown L1d cache: 64K L1i cache: 32K L2 cache: 512K L3 cache: 8192K NUMA node0 CPU(s): 0,8,16,24,32,40,48,56 =========================================
Quoted 4 lines
Quoted 4 lines
examples/ip_pipeline/init.c +2
-0+#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
Based on config of tested server (as below output),
CPU(s): 80 On-line CPU(s) list: 0,8,16,24,32,40,48,56,64,72 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79 Thread(s) per core: 1 <<< Core(s) per socket: 5 <<< Socket(s): 2 <<< NUMA node(s): 2
cpu_core_map_init parameters (2,5,1,0) were prepared. Instead, we can cap max sockets/core/ht counts to possible maximum supported today.
Regards,
Gowrishankar
Quoted 138 lines
Quoted 3 lines
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月9日 19:14
To: Chao Zhu <[email protected]>; [email protected]
Cc: 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Hi Chao,
Sure. Please find below one.This patch fixes
ip_pipelinepanic inapp_init_core_mapwhile preparing cpu core map in powerpc with SMT off.cpu_core_map_compute_linuxcurrently prepares core mapping based on file existence in sysfs ie./sys/devices/system/cpu/cpu<LCORE_NUM>/topology/physical_package_id
/sys/devices/system/cpu/cpu<LCORE_NUM>/topology/core_idThese files do not exist for lcores which are offline for any reason (as in powerpc, while SMT is off). In this situation, this function should further continue preparing map for other online lcores instead of returning with -1 for a first unavailable lcore.
Also, in SMT=off scenario for powerpc, lcore ids can not be always indexed from
0 upto 'number of cores present' (/sys/devices/system/cpu/present). For eg, for an online lcore 32,core_idreturned in sysfs is 112 where online lcores are 10 (as in one configuration), hence sysfs lcore id can not be checked with indexing lcore number before positioning lcore map array.Thanks,
GowrishankarQuoted 106 lines · Chao Zhu
Gowrishankar,
Can you give more description about this patch?
Thank you!-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月6日 20:33
To: [email protected]
Cc: Chao Zhu <[email protected]>; Bruce Richardson <[email protected]>; Konstantin Ananyev <[email protected]>; Thomas Monjalon <[email protected]>; Cristian Dumitrescu <[email protected]>; Pradeep <[email protected]>; gowrishankar <[email protected]>
Subject: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64From: gowrishankar <[email protected]>
offline lcore would still refer to original core id and this has to be considered while creating cpu core mask.
Signed-off-by Gowrishankar <[email protected]>--- config/defconfig_ppc_64-power8-linuxapp-gcc | 3 --- examples/ip_pipeline/cpu_core_map.c | 12 +----------- examples/ip_pipeline/init.c | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-)config/defconfig_ppc_64-power8-linuxapp-gcc +0
-0@@ -58,6 +58,3 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. So they'returned off.
CONFIG_RTE_LIBRTE_SCHED=nconfig/defconfig_ppc_64-power8-linuxapp-gcc +0
-3-CONFIG_RTE_LIBRTE_PORT=n -CONFIG_RTE_LIBRTE_TABLE=n -CONFIG_RTE_LIBRTE_PIPELINE=nexamples/ip_pipeline/cpu_core_map.c +0
-6@@ -351,9 +351,6 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)int lcore_socket_id =cpu_core_map_get_socket_id_linux (lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -if (((uint32_t ) lcore_socket_id) == socket_id) n_detected++; }@@ -368,18 +365,11 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)cpu_core_map_get_socket_id_linux ( lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -Why to remove the
lcore_socket_idcheck?int lcore_core_id = cpu_core_map_get_core_id_linux( lcore_id);examples/ip_pipeline/cpu_core_map.c +0
-4-if (lcore_core_id <0 ) -return -1 ; - - if (((uint32_t) lcore_socket_id ==
socket_id) &&examples/ip_pipeline/cpu_core_map.c +0
-1- ((uint32_t) lcore_core_id ==
core_id)) {examples/ip_pipeline/cpu_core_map.c +1
-0+if ((uint32_t ) lcore_socket_id == socket_id){
uint32_tpos = cpu_core_map_pos(map,
socket_id,core_id_contig,examples/ip_pipeline/init.c +2
-0@@ -61,7 +61,11 @@ static void app_init_core_map(struct app_params *app) {APP_LOG (app,HIGH ,"Initializing CPU core map ..." ); +#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
if (app->core_map == NULL) rte_panic("Cannot create CPU core map\n");--
1.9.1
Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Gowrishankar,
I suggest to set the following value:
n_max_cores_per_socket = 8n_max_ht_per_core = 8
This will cover most of the Power8 servers.
Any comments?
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月11日 20:02
To: Chao Zhu <[email protected]>
Cc: [email protected]; 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Quoted 26 lines · Chao Zhu
Gowrishankar,
Thanks for the detail.
If my understanding is correct, Power8 has different chips. Some of the OpenPOWER chips have 8 cores per socket. And the max threads per core is 8. Should we support this incpu_core_map_init()?Here's a dump from the OpenPOWER system.
======================================# lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 64 On-line CPU(s) list: 0,8,16,24,32,40,48,56 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63 Thread(s) per core: 1 Core(s) per socket: 8 Socket(s): 1 NUMA node(s): 1 Model: unknown L1d cache: 64K L1i cache: 32K L2 cache: 512K L3 cache: 8192K NUMA node0 CPU(s): 0,8,16,24,32,40,48,56 =========================================
Quoted 4 lines
Quoted 4 lines
examples/ip_pipeline/init.c +2
-0+#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
Based on config of tested server (as below output),
CPU(s): 80 On-line CPU(s) list: 0,8,16,24,32,40,48,56,64,72 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79 Thread(s) per core: 1 <<< Core(s) per socket: 5 <<< Socket(s): 2 <<< NUMA node(s): 2
cpu_core_map_init parameters (2,5,1,0) were prepared. Instead, we can cap max sockets/core/ht counts to possible maximum supported today.
Regards,
Gowrishankar
Quoted 146 lines
Quoted 3 lines
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月9日 19:14
To: Chao Zhu <[email protected]>; [email protected]
Cc: 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Hi Chao,
Sure. Please find below one.This patch fixes
ip_pipelinepanic inapp_init_core_mapwhile preparing cpu core map in powerpc with SMT off.cpu_core_map_compute_linuxcurrently prepares core mapping based on file existence in sysfs ie./sys/devices/system/cpu/cpu<LCORE_NUM>/topology/physical_package_id
/sys/devices/system/cpu/cpu<LCORE_NUM>/topology/core_idThese files do not exist for lcores which are offline for any reason (as in powerpc, while SMT is off). In this situation, this function should further continue preparing map for other online lcores instead of returning with -1 for a first unavailable lcore.
Also, in SMT=off scenario for powerpc, lcore ids can not be always
indexed from
0 upto 'number of cores present' (/sys/devices/system/cpu/present).
For eg, for an online lcore 32,core_idreturned in sysfs is 112 where
online lcores are
10 (as in one configuration), hence sysfs lcore id can not be checked with indexing lcore number before positioning lcore map array.Thanks,
GowrishankarQuoted 106 lines · Chao Zhu
Gowrishankar,
Can you give more description about this patch?
Thank you!-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月6日 20:33
To: [email protected]
Cc: Chao Zhu <[email protected]>; Bruce Richardson <[email protected]>; Konstantin Ananyev <[email protected]>; Thomas Monjalon <[email protected]>; Cristian Dumitrescu <[email protected]>; Pradeep <[email protected]>; gowrishankar <[email protected]>
Subject: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64From: gowrishankar <[email protected]>
offline lcore would still refer to original core id and this has to be considered while creating cpu core mask.
Signed-off-by Gowrishankar <[email protected]>--- config/defconfig_ppc_64-power8-linuxapp-gcc | 3 --- examples/ip_pipeline/cpu_core_map.c | 12 +----------- examples/ip_pipeline/init.c | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-)config/defconfig_ppc_64-power8-linuxapp-gcc +0
-0@@ -58,6 +58,3 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. So they'returned off.
CONFIG_RTE_LIBRTE_SCHED=nconfig/defconfig_ppc_64-power8-linuxapp-gcc +0
-3-CONFIG_RTE_LIBRTE_PORT=n -CONFIG_RTE_LIBRTE_TABLE=n -CONFIG_RTE_LIBRTE_PIPELINE=nexamples/ip_pipeline/cpu_core_map.c +0
-6@@ -351,9 +351,6 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)int lcore_socket_id =cpu_core_map_get_socket_id_linux (lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -if (((uint32_t ) lcore_socket_id) == socket_id) n_detected++; }@@ -368,18 +365,11 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)cpu_core_map_get_socket_id_linux ( lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -Why to remove the
lcore_socket_idcheck?int lcore_core_id = cpu_core_map_get_core_id_linux( lcore_id);examples/ip_pipeline/cpu_core_map.c +0
-4-if (lcore_core_id <0 ) -return -1 ; - - if (((uint32_t) lcore_socket_id ==
socket_id) &&examples/ip_pipeline/cpu_core_map.c +0
-1- ((uint32_t) lcore_core_id ==
core_id)) {examples/ip_pipeline/cpu_core_map.c +1
-0+if ((uint32_t ) lcore_socket_id == socket_id){
uint32_tpos = cpu_core_map_pos(map,
socket_id,core_id_contig,(quoted diff) +0
-0
b/examples/ip_pipeline/init.cindex cd167f6..60c931f 100644examples/ip_pipeline/init.c +2
-0@@ -61,7 +61,11 @@ static void app_init_core_map(struct app_params *app) {APP_LOG (app,HIGH ,"Initializing CPU core map ..." ); +#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
if (app->core_map == NULL) rte_panic("Cannot create CPU core map\n");--
1.9.1
Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Quoted 9 lines · Chao Zhu
Gowrishankar,
I suggest to set the following value:
n_max_cores_per_socket= 8n_max_ht_per_core= 8This will cover most of the Power8 servers.
Any comments?
Sure Chao. I will include this change in v5. If there are no other comments, I can spin out v5, with changes in this patch.
Regards,
Gowrishankar
Quoted 199 lines
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月11日 20:02
To: Chao Zhu <[email protected]>
Cc: [email protected]; 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Quoted 26 lines · Chao Zhu
Gowrishankar,
Thanks for the detail.
If my understanding is correct, Power8 has different chips. Some of the OpenPOWER chips have 8 cores per socket. And the max threads per core is 8. Should we support this incpu_core_map_init()?Here's a dump from the OpenPOWER system.
======================================# lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 64 On-line CPU(s) list: 0,8,16,24,32,40,48,56 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63 Thread(s) per core: 1 Core(s) per socket: 8 Socket(s): 1 NUMA node(s): 1 Model: unknown L1d cache: 64K L1i cache: 32K L2 cache: 512K L3 cache: 8192K NUMA node0 CPU(s): 0,8,16,24,32,40,48,56 =========================================Quoted 4 lines
Quoted 4 lines
examples/ip_pipeline/init.c +2
-0+#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
Based on config of tested server (as below output),
CPU(s): 80 On-line CPU(s) list: 0,8,16,24,32,40,48,56,64,72 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79 Thread(s) per core: 1 <<< Core(s) per socket: 5 <<< Socket(s): 2 <<< NUMA node(s): 2
cpu_core_map_initparameters (2,5,1,0) were prepared. Instead, we can cap max sockets/core/ht counts to possible maximum supported today.Regards,
GowrishankarQuoted 143 lines
Quoted 2 lines
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月9日 19:14
To: Chao Zhu <[email protected]>; [email protected]
Cc: 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Hi Chao,
Sure. Please find below one.This patch fixes
ip_pipelinepanic inapp_init_core_mapwhile preparing cpu core map in powerpc with SMT off.cpu_core_map_compute_linuxcurrently prepares core mapping based on file existence in sysfs ie./sys/devices/system/cpu/cpu<LCORE_NUM>/topology/physical_package_id
/sys/devices/system/cpu/cpu<LCORE_NUM>/topology/core_idThese files do not exist for lcores which are offline for any reason (as in powerpc, while SMT is off). In this situation, this function should further continue preparing map for other online lcores instead of returning with -1 for a first unavailable lcore.
Also, in SMT=off scenario for powerpc, lcore ids can not be always
indexed from
0 upto 'number of cores present' (/sys/devices/system/cpu/present).
For eg, for an online lcore 32,core_idreturned in sysfs is 112 where
online lcores are
10 (as in one configuration), hence sysfs lcore id can not be checked with indexing lcore number before positioning lcore map array.Thanks,
GowrishankarQuoted 106 lines · Chao Zhu
Gowrishankar,
Can you give more description about this patch?
Thank you!-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月6日 20:33
To: [email protected]
Cc: Chao Zhu <[email protected]>; Bruce Richardson <[email protected]>; Konstantin Ananyev <[email protected]>; Thomas Monjalon <[email protected]>; Cristian Dumitrescu <[email protected]>; Pradeep <[email protected]>; gowrishankar <[email protected]>
Subject: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64From: gowrishankar <[email protected]>
offline lcore would still refer to original core id and this has to be considered while creating cpu core mask.
Signed-off-by Gowrishankar <[email protected]>--- config/defconfig_ppc_64-power8-linuxapp-gcc | 3 --- examples/ip_pipeline/cpu_core_map.c | 12 +----------- examples/ip_pipeline/init.c | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-)config/defconfig_ppc_64-power8-linuxapp-gcc +0
-0@@ -58,6 +58,3 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. So they'returned off.
CONFIG_RTE_LIBRTE_SCHED=nconfig/defconfig_ppc_64-power8-linuxapp-gcc +0
-3-CONFIG_RTE_LIBRTE_PORT=n -CONFIG_RTE_LIBRTE_TABLE=n -CONFIG_RTE_LIBRTE_PIPELINE=nexamples/ip_pipeline/cpu_core_map.c +0
-6@@ -351,9 +351,6 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)int lcore_socket_id =cpu_core_map_get_socket_id_linux (lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -if (((uint32_t ) lcore_socket_id) == socket_id) n_detected++; }@@ -368,18 +365,11 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)cpu_core_map_get_socket_id_linux ( lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -Why to remove the
lcore_socket_idcheck?int lcore_core_id = cpu_core_map_get_core_id_linux( lcore_id);examples/ip_pipeline/cpu_core_map.c +0
-4-if (lcore_core_id <0 ) -return -1 ; - - if (((uint32_t) lcore_socket_id ==
socket_id) &&examples/ip_pipeline/cpu_core_map.c +0
-1- ((uint32_t) lcore_core_id ==
core_id)) {examples/ip_pipeline/cpu_core_map.c +1
-0+if ((uint32_t ) lcore_socket_id == socket_id){
uint32_tpos = cpu_core_map_pos(map,
socket_id,core_id_contig,(quoted diff) +0
-0
b/examples/ip_pipeline/init.cindex cd167f6..60c931f 100644examples/ip_pipeline/init.c +2
-0@@ -61,7 +61,11 @@ static void app_init_core_map(struct app_params *app) {APP_LOG (app,HIGH ,"Initializing CPU core map ..." ); +#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
if (app->core_map == NULL) rte_panic("Cannot create CPU core map\n");--
1.9.1
Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Another comment is, comment out lcore_socket_id check will influence other architectures. If possible, I would like to make this change to Power specific.
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月12日 17:00
To: Chao Zhu <[email protected]>
Cc: [email protected]; 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Quoted 9 lines · Chao Zhu
Gowrishankar,
I suggest to set the following value:
n_max_cores_per_socket= 8n_max_ht_per_core= 8This will cover most of the Power8 servers.
Any comments?
Sure Chao. I will include this change in v5. If there are no other comments, I can spin out v5, with changes in this patch.
Regards,
Gowrishankar
Quoted 204 lines
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月11日 20:02
To: Chao Zhu <[email protected]>
Cc: [email protected]; 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Quoted 26 lines · Chao Zhu
Gowrishankar,
Thanks for the detail.
If my understanding is correct, Power8 has different chips. Some of the OpenPOWER chips have 8 cores per socket. And the max threads per core is 8. Should we support this incpu_core_map_init()?Here's a dump from the OpenPOWER system.
======================================# lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 64 On-line CPU(s) list: 0,8,16,24,32,40,48,56 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63 Thread(s) per core: 1 Core(s) per socket: 8 Socket(s): 1 NUMA node(s): 1 Model: unknown L1d cache: 64K L1i cache: 32K L2 cache: 512K L3 cache: 8192K NUMA node0 CPU(s): 0,8,16,24,32,40,48,56 =========================================Quoted 4 lines
Quoted 4 lines
examples/ip_pipeline/init.c +2
-0+#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
Based on config of tested server (as below output),
CPU(s): 80 On-line CPU(s) list: 0,8,16,24,32,40,48,56,64,72 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79 Thread(s) per core: 1 <<< Core(s) per socket: 5 <<< Socket(s): 2 <<< NUMA node(s): 2
cpu_core_map_initparameters (2,5,1,0) were prepared. Instead, we can cap max sockets/core/ht counts to possible maximum supported today.Regards,
GowrishankarQuoted 143 lines
Quoted 2 lines
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月9日 19:14
To: Chao Zhu <[email protected]>; [email protected]
Cc: 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Hi Chao,
Sure. Please find below one.This patch fixes
ip_pipelinepanic inapp_init_core_mapwhile preparing cpu core map in powerpc with SMT off.cpu_core_map_compute_linuxcurrently prepares core mapping based on file existence in sysfs ie./sys/devices/system/cpu/cpu<LCORE_NUM>/topology/physical_package_id
/sys/devices/system/cpu/cpu<LCORE_NUM>/topology/core_idThese files do not exist for lcores which are offline for any reason (as in powerpc, while SMT is off). In this situation, this function should further continue preparing map for other online lcores instead of returning with -1 for a first unavailable lcore.
Also, in SMT=off scenario for powerpc, lcore ids can not be always
indexed from
0 upto 'number of cores present' (/sys/devices/system/cpu/present).
For eg, for an online lcore 32,core_idreturned in sysfs is 112
where online lcores are
10 (as in one configuration), hence sysfs lcore id can not be checked with indexing lcore number before positioning lcore map array.Thanks,
GowrishankarQuoted 106 lines · Chao Zhu
Gowrishankar,
Can you give more description about this patch?
Thank you!-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月6日 20:33
To: [email protected]
Cc: Chao Zhu <[email protected]>; Bruce Richardson <[email protected]>; Konstantin Ananyev <[email protected]>; Thomas Monjalon <[email protected]>; Cristian Dumitrescu <[email protected]>; Pradeep <[email protected]>; gowrishankar <[email protected]>
Subject: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64From: gowrishankar <[email protected]>
offline lcore would still refer to original core id and this has to be considered while creating cpu core mask.
Signed-off-by Gowrishankar <[email protected]>--- config/defconfig_ppc_64-power8-linuxapp-gcc | 3 --- examples/ip_pipeline/cpu_core_map.c | 12 +----------- examples/ip_pipeline/init.c | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-)config/defconfig_ppc_64-power8-linuxapp-gcc +0
-0@@ -58,6 +58,3 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. Sothey're turned off.
CONFIG_RTE_LIBRTE_SCHED=nconfig/defconfig_ppc_64-power8-linuxapp-gcc +0
-3-CONFIG_RTE_LIBRTE_PORT=n -CONFIG_RTE_LIBRTE_TABLE=n -CONFIG_RTE_LIBRTE_PIPELINE=nexamples/ip_pipeline/cpu_core_map.c +0
-6@@ -351,9 +351,6 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)int lcore_socket_id =cpu_core_map_get_socket_id_linux (lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -if (((uint32_t ) lcore_socket_id) == socket_id) n_detected++; }@@ -368,18 +365,11 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)cpu_core_map_get_socket_id_linux ( lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -Why to remove the
lcore_socket_idcheck?int lcore_core_id = cpu_core_map_get_core_id_linux( lcore_id);examples/ip_pipeline/cpu_core_map.c +0
-4-if (lcore_core_id <0 ) -return -1 ; - - if (((uint32_t) lcore_socket_id ==
socket_id) &&examples/ip_pipeline/cpu_core_map.c +0
-1- ((uint32_t) lcore_core_id ==
core_id)) {examples/ip_pipeline/cpu_core_map.c +1
-0+if ((uint32_t ) lcore_socket_id == socket_id){
uint32_tpos = cpu_core_map_pos(map,
socket_id,core_id_contig,(quoted diff) +0
-0
b/examples/ip_pipeline/init.cindex cd167f6..60c931f 100644examples/ip_pipeline/init.c +2
-0@@ -61,7 +61,11 @@ static void app_init_core_map(struct app_params *app) {APP_LOG (app,HIGH ,"Initializing CPU core map ..." ); +#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
if (app->core_map == NULL) rte_panic("Cannot create CPU core map\n");--
1.9.1
Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
Quoted 1 line · Chao Zhu
Another comment is, comment out
lcore_socket_idcheck will influence other architectures. If possible, I would like to make this change to Power specific.
Hi Chao,
I am revisiting cpu_core_map_init() fn. I realize, all we handle is max values of socket/core/ht. So, ideally the function should not break in any arch.
In my quick test w/o adjusting prev max values (4,32,4,0), only for ht > 1, creating cpu map panics in ppc i.e (4,32,1,0) is able to create core map and app runs. I continue to debug this and fix this example app separately.
So, I will be sending powerpc specific enablement of lpm,acl,port,table and sched in v5. Example ip_pipeline will be fixed in separate patch.
Thanks,
Gowrishankar
Quoted 224 lines
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月12日 17:00
To: Chao Zhu <[email protected]>
Cc: [email protected]; 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Quoted 9 lines · Chao Zhu
Gowrishankar,
I suggest to set the following value:
n_max_cores_per_socket= 8n_max_ht_per_core= 8This will cover most of the Power8 servers.
Any comments?Sure Chao. I will include this change in v5. If there are no other comments, I can spin out v5, with changes in this patch.
Regards,
GowrishankarQuoted 201 lines
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月11日 20:02
To: Chao Zhu <[email protected]>
Cc: [email protected]; 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Quoted 26 lines · Chao Zhu
Gowrishankar,
Thanks for the detail.
If my understanding is correct, Power8 has different chips. Some of the OpenPOWER chips have 8 cores per socket. And the max threads per core is 8. Should we support this incpu_core_map_init()?Here's a dump from the OpenPOWER system.
======================================# lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 64 On-line CPU(s) list: 0,8,16,24,32,40,48,56 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63 Thread(s) per core: 1 Core(s) per socket: 8 Socket(s): 1 NUMA node(s): 1 Model: unknown L1d cache: 64K L1i cache: 32K L2 cache: 512K L3 cache: 8192K NUMA node0 CPU(s): 0,8,16,24,32,40,48,56 =========================================Quoted 4 lines
Quoted 4 lines
(quoted diff) +2
-0+#if defined(RTE_ARCH_PPC_64) + app->core_map = cpu_core_map_init(2, 5, 1, 0); #elseThis value seems quite strange. Can you give more detail?
Based on config of tested server (as below output),
CPU(s): 80 On-line CPU(s) list: 0,8,16,24,32,40,48,56,64,72 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79 Thread(s) per core: 1 <<< Core(s) per socket: 5 <<< Socket(s): 2 <<< NUMA node(s): 2
cpu_core_map_initparameters (2,5,1,0) were prepared. Instead, we can cap max sockets/core/ht counts to possible maximum supported today.Regards,
GowrishankarQuoted 142 lines
Quoted 2 lines
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月9日 19:14
To: Chao Zhu <[email protected]>; [email protected]
Cc: 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Hi Chao,
Sure. Please find below one.This patch fixes
ip_pipelinepanic inapp_init_core_mapwhile preparing cpu core map in powerpc with SMT off.cpu_core_map_compute_linuxcurrently prepares core mapping based on file existence in sysfs ie./sys/devices/system/cpu/cpu<LCORE_NUM>/topology/physical_package_id
/sys/devices/system/cpu/cpu<LCORE_NUM>/topology/core_idThese files do not exist for lcores which are offline for any reason (as in powerpc, while SMT is off). In this situation, this function should further continue preparing map for other online lcores instead of returning with -1 for a first unavailable lcore.
Also, in SMT=off scenario for powerpc, lcore ids can not be always
indexed from
0 upto 'number of cores present' (/sys/devices/system/cpu/present).
For eg, for an online lcore 32,core_idreturned in sysfs is 112
where online lcores are
10 (as in one configuration), hence sysfs lcore id can not be checked with indexing lcore number before positioning lcore map array.Thanks,
GowrishankarQuoted 106 lines · Chao Zhu
Gowrishankar,
Can you give more description about this patch?
Thank you!-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月6日 20:33
To: [email protected]
Cc: Chao Zhu <[email protected]>; Bruce Richardson <[email protected]>; Konstantin Ananyev <[email protected]>; Thomas Monjalon <[email protected]>; Cristian Dumitrescu <[email protected]>; Pradeep <[email protected]>; gowrishankar <[email protected]>
Subject: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64From: gowrishankar <[email protected]>
offline lcore would still refer to original core id and this has to be considered while creating cpu core mask.
Signed-off-by Gowrishankar <[email protected]>--- config/defconfig_ppc_64-power8-linuxapp-gcc | 3 --- examples/ip_pipeline/cpu_core_map.c | 12 +----------- examples/ip_pipeline/init.c | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-)config/defconfig_ppc_64-power8-linuxapp-gcc +0
-0@@ -58,6 +58,3 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. Sothey're turned off.
CONFIG_RTE_LIBRTE_SCHED=nconfig/defconfig_ppc_64-power8-linuxapp-gcc +0
-3-CONFIG_RTE_LIBRTE_PORT=n -CONFIG_RTE_LIBRTE_TABLE=n -CONFIG_RTE_LIBRTE_PIPELINE=nexamples/ip_pipeline/cpu_core_map.c +0
-6@@ -351,9 +351,6 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)int lcore_socket_id =cpu_core_map_get_socket_id_linux (lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -if (((uint32_t ) lcore_socket_id) == socket_id) n_detected++; }@@ -368,18 +365,11 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)cpu_core_map_get_socket_id_linux ( lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -Why to remove the
lcore_socket_idcheck?int lcore_core_id = cpu_core_map_get_core_id_linux( lcore_id);examples/ip_pipeline/cpu_core_map.c +0
-4-if (lcore_core_id <0 ) -return -1 ; - - if (((uint32_t) lcore_socket_id ==
socket_id) &&examples/ip_pipeline/cpu_core_map.c +0
-1- ((uint32_t) lcore_core_id ==
core_id)) {examples/ip_pipeline/cpu_core_map.c +1
-0+if ((uint32_t ) lcore_socket_id == socket_id){
uint32_tpos = cpu_core_map_pos(map,
socket_id,core_id_contig,(quoted diff) +0
-0
b/examples/ip_pipeline/init.cindex cd167f6..60c931f 100644examples/ip_pipeline/init.c +2
-0@@ -61,7 +61,11 @@ static void app_init_core_map(struct app_params *app) {APP_LOG (app,HIGH ,"Initializing CPU core map ..." ); +#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
if (app->core_map == NULL) rte_panic("Cannot create CPU core map\n");--
1.9.1
Re: [PATCH v4 3/6] ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64
In reply to Chao ZhuHi Chao,
I have simplified the approach for this patch in v5.
* Including ppc64le specific changes
* App panic in creating core map only in SMT=off case, so that would be addressed separately.
Hoping with new patch set v5, your review would be easier.
Regards,
Gowrishankar
Quoted 226 lines · Chao Zhu
Another comment is, comment out
lcore_socket_idcheck will influence other architectures. If possible, I would like to make this change to Power specific.-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月12日 17:00
To: Chao Zhu <[email protected]>
Cc: [email protected]; 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Quoted 9 lines · Chao Zhu
Gowrishankar,
I suggest to set the following value:
n_max_cores_per_socket= 8n_max_ht_per_core= 8This will cover most of the Power8 servers.
Any comments?Sure Chao. I will include this change in v5. If there are no other comments, I can spin out v5, with changes in this patch.
Regards,
GowrishankarQuoted 201 lines
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月11日 20:02
To: Chao Zhu <[email protected]>
Cc: [email protected]; 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Quoted 26 lines · Chao Zhu
Gowrishankar,
Thanks for the detail.
If my understanding is correct, Power8 has different chips. Some of the OpenPOWER chips have 8 cores per socket. And the max threads per core is 8. Should we support this incpu_core_map_init()?Here's a dump from the OpenPOWER system.
======================================# lscpu Architecture: ppc64le Byte Order: Little Endian CPU(s): 64 On-line CPU(s) list: 0,8,16,24,32,40,48,56 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63 Thread(s) per core: 1 Core(s) per socket: 8 Socket(s): 1 NUMA node(s): 1 Model: unknown L1d cache: 64K L1i cache: 32K L2 cache: 512K L3 cache: 8192K NUMA node0 CPU(s): 0,8,16,24,32,40,48,56 =========================================Quoted 4 lines
Quoted 4 lines
(quoted diff) +2
-0+#if defined(RTE_ARCH_PPC_64) + app->core_map = cpu_core_map_init(2, 5, 1, 0); #elseThis value seems quite strange. Can you give more detail?
Based on config of tested server (as below output),
CPU(s): 80 On-line CPU(s) list: 0,8,16,24,32,40,48,56,64,72 Off-line CPU(s) list: 1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79 Thread(s) per core: 1 <<< Core(s) per socket: 5 <<< Socket(s): 2 <<< NUMA node(s): 2
cpu_core_map_initparameters (2,5,1,0) were prepared. Instead, we can cap max sockets/core/ht counts to possible maximum supported today.Regards,
GowrishankarQuoted 142 lines
Quoted 2 lines
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
-----Original Message-----
From: gowrishankar muthukrishnan [mailto:[email protected]]
Sent: 2016年8月9日 19:14
To: Chao Zhu <[email protected]>; [email protected]
Cc: 'Bruce Richardson' <[email protected]>; 'Konstantin Ananyev' <[email protected]>; 'Thomas Monjalon' <[email protected]>; 'Cristian Dumitrescu' <[email protected]>; 'Pradeep' <[email protected]>
Subject: Re: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64Hi Chao,
Sure. Please find below one.This patch fixes
ip_pipelinepanic inapp_init_core_mapwhile preparing cpu core map in powerpc with SMT off.cpu_core_map_compute_linuxcurrently prepares core mapping based on file existence in sysfs ie./sys/devices/system/cpu/cpu<LCORE_NUM>/topology/physical_package_id
/sys/devices/system/cpu/cpu<LCORE_NUM>/topology/core_idThese files do not exist for lcores which are offline for any reason (as in powerpc, while SMT is off). In this situation, this function should further continue preparing map for other online lcores instead of returning with -1 for a first unavailable lcore.
Also, in SMT=off scenario for powerpc, lcore ids can not be always
indexed from
0 upto 'number of cores present' (/sys/devices/system/cpu/present).
For eg, for an online lcore 32,core_idreturned in sysfs is 112
where online lcores are
10 (as in one configuration), hence sysfs lcore id can not be checked with indexing lcore number before positioning lcore map array.Thanks,
GowrishankarQuoted 106 lines · Chao Zhu
Gowrishankar,
Can you give more description about this patch?
Thank you!-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月6日 20:33
To: [email protected]
Cc: Chao Zhu <[email protected]>; Bruce Richardson <[email protected]>; Konstantin Ananyev <[email protected]>; Thomas Monjalon <[email protected]>; Cristian Dumitrescu <[email protected]>; Pradeep <[email protected]>; gowrishankar <[email protected]>
Subject: [PATCH v4 3/6]ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64From: gowrishankar <[email protected]>
offline lcore would still refer to original core id and this has to be considered while creating cpu core mask.
Signed-off-by Gowrishankar <[email protected]>--- config/defconfig_ppc_64-power8-linuxapp-gcc | 3 --- examples/ip_pipeline/cpu_core_map.c | 12 +----------- examples/ip_pipeline/init.c | 4 ++++ 3 files changed, 5 insertions(+), 14 deletions(-)config/defconfig_ppc_64-power8-linuxapp-gcc +0
-0@@ -58,6 +58,3 @@ CONFIG_RTE_LIBRTE_FM10K_PMD=n # This following libraries are not available on Power. Sothey're turned off.
CONFIG_RTE_LIBRTE_SCHED=nconfig/defconfig_ppc_64-power8-linuxapp-gcc +0
-3-CONFIG_RTE_LIBRTE_PORT=n -CONFIG_RTE_LIBRTE_TABLE=n -CONFIG_RTE_LIBRTE_PIPELINE=nexamples/ip_pipeline/cpu_core_map.c +0
-6@@ -351,9 +351,6 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)int lcore_socket_id =cpu_core_map_get_socket_id_linux (lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -if (((uint32_t ) lcore_socket_id) == socket_id) n_detected++; }@@ -368,18 +365,11 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)cpu_core_map_get_socket_id_linux ( lcore_id); -if (lcore_socket_id <0 ) -return -1 ; -Why to remove the
lcore_socket_idcheck?int lcore_core_id = cpu_core_map_get_core_id_linux( lcore_id);examples/ip_pipeline/cpu_core_map.c +0
-4-if (lcore_core_id <0 ) -return -1 ; - - if (((uint32_t) lcore_socket_id ==
socket_id) &&examples/ip_pipeline/cpu_core_map.c +0
-1- ((uint32_t) lcore_core_id ==
core_id)) {examples/ip_pipeline/cpu_core_map.c +1
-0+if ((uint32_t ) lcore_socket_id == socket_id){
uint32_tpos = cpu_core_map_pos(map,
socket_id,core_id_contig,(quoted diff) +0
-0
b/examples/ip_pipeline/init.cindex cd167f6..60c931f 100644examples/ip_pipeline/init.c +2
-0@@ -61,7 +61,11 @@ static void app_init_core_map(struct app_params *app) {APP_LOG (app,HIGH ,"Initializing CPU core map ..." ); +#if defined(RTE_ARCH_PPC_64 ) + app->core_map =cpu_core_map_init (2 ,5 ,1 ,0 );#else This value seems quite strange. Can you give more detail?
app->core_map = cpu_core_map_init(4, 32, 4, 0);+#endif
if (app->core_map == NULL) rte_panic("Cannot create CPU core map\n");--
1.9.1
PATCH v4 4/6 table: cache align rte_bucket_4_8
In reply to Gowrishankar MuthukrishnanFrom: gowrishankar <[email protected]>
Align rte_bucket_4_8 for cache line.
--- lib/librte_table/rte_table_hash_key8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_table/rte_table_hash_key8.c +1 -1
@@ -68,7 +68,7 @@ struct rte_bucket_4_8 {uint64_t key[4 ];/* Cache line 1 */ -uint8_t data[0 ]; + uint8_t data[0] __rte_cache_aligned; };struct rte_table_hash {
Signature · 1 line
1.9.1
PATCH v4 5/6 sched: enable sched library for ppc64le
In reply to Gowrishankar MuthukrishnanFrom: gowrishankar <[email protected]>
This patch enables librte_sched in ppc64le.
--- config/defconfig_ppc_64-power8-linuxapp-gcc | 2 -- 1 file changed, 2 deletions(-)
config/defconfig_ppc_64-power8-linuxapp-gcc +0 -2
@@ -56,5 +56,3 @@ CONFIG_RTE_LIBRTE_PMD_BOND=n CONFIG_RTE_LIBRTE_ENIC_PMD=n CONFIG_RTE_LIBRTE_FM10K_PMD=n -# This following libraries are not available on Power. So they're turned off. -CONFIG_RTE_LIBRTE_SCHED=n
Signature · 1 line
1.9.1
PATCH v4 6/6 l3fwd: add altivec support for em_hash_key
In reply to Gowrishankar MuthukrishnanFrom: gowrishankar <[email protected]>
This patch adds ppc64le port for em_mask_key function.
--- examples/l3fwd/l3fwd_em.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
examples/l3fwd/l3fwd_em.c +9 -1
@@ -259,8 +259,16 @@ em_mask_key(void *key, xmm_t mask)return vandq_s32 (data, mask); } +#elif defined(RTE_MACHINE_CPUFLAG_ALTIVEC ) +static inline xmm_t +em_mask_key (void *key,xmm_t mask) +{ +xmm_t data =vec_ld (0 , (xmm_t *)(key)); + +return vec_and (data, mask); +}#else -#error No vector engine (SSE, NEON) available, check your toolchain +#error No vector engine (SSE, NEON, ALTIVEC) available, check your toolchain#endif static inline uint8_t
Signature · 1 line
1.9.1