Skip to contentSkip to conversation

enable lpm, acl and other missing libraries in ppc64le

PATCH Superseded Gowrishankar Muthukrishnan 2 participants 11 messages Aug 12, 2016 – Aug 16, 2016

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v5 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:
1. LPM and ACL unit tests passed.
Steps:
compile test app and run (with any needed params) lpm_autotest
acl_autotest

2. Example ip_pipeline application verified for port forwarding. compile examples/ip_pipeline (adjust app_init_core_map param for ht to 1 in case of ppc64le in SMT=off mode). modify config/l3fwd.cfg as per enabled PMD ports. run ip_pipeline with config file option and check packets fwd.

v5 changes:
- no change in lpm lib enablement
- no change in acl lib enablement
- config file changes individually for sched,table,port,pipeline lib enablement
- ip_pipeline patch description and changes flagged only for ppc64le. app_init_core_map changes removed (due to bug found and under investigation only on ppc64le/smt=off case).

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 Muthukrishnan (3):
port: enable port library for ppc64le
pipeline: enable pipeline library for ppc64le
ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64

gowrishankar (5):
lpm: add altivec intrinsics for dpdk lpm on ppc_64
acl: add altivec intrinsics for dpdk acl on ppc_64
l3fwd: add altivec support for em_hash_key
table: enable table library for ppc64le
sched: enable sched library for ppc64le

 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                |   8 +
 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 ++++++++++
 16 files changed, 653 insertions(+), 8 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
#1 lore raw

PATCH v5 1/8 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
index de9c16f..42174d2 100644
@@ -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
index bef8f49..9ddf3c5 100644
@@ -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
index 656ade2..3dc549d 100644
@@ -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
index 2df1d67..dbe5483 100644
@@ -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
#2 lore raw

PATCH v5 2/8 acl: add altivec intrinsics for dpdk acl on ppc_64

In reply to Gowrishankar Muthukrishnan

From: 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
index d366981..1b2b176 100644
@@ -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
index 9ddf3c5..dede34f 100644
@@ -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
index 9803e9d..d05be66 100644
@@ -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
index 09d6784..6664a55 100644
@@ -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
index b2fc42c..024f393 100644
@@ -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
index 4ba9786..8b7e92c 100644
@@ -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
index 0979a09..8d4e2a6 100644
@@ -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
#3 lore raw

PATCH v5 3/8 l3fwd: add altivec support for em_hash_key

In reply to Gowrishankar Muthukrishnan

From: 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
index def5a02..6053a62 100644
@@ -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
#4 lore raw

PATCH v5 4/8 table: enable table library for ppc64le

In reply to Gowrishankar Muthukrishnan

From: gowrishankar <[email protected]>

This patch enables librte_table in ppc64le.

---
 config/defconfig_ppc_64-power8-linuxapp-gcc | 1 -
 1 file changed, 1 deletion(-)
config/defconfig_ppc_64-power8-linuxapp-gcc +0 -1
index dede34f..41f67d5 100644
@@ -59,5 +59,4 @@ 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
Signature · 1 line
1.9.1
#5 lore raw

Re: [PATCH v5 4/8] table: enable table library for ppc64le

Gowrishankar,

The unit test of table got failed.
When I took a look at the code, it failed on this line in file lib/librte_table/rte_table_hash_key8.c , lib/librte_table/rte_table_hash_key16.c, lib/librte_table/rte_table_hash_key32.c:

	if ((check_params_create_lru(p) != 0) ||
		((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0)
||
		((sizeof(struct rte_bucket_4_8) % RTE_CACHE_LINE_SIZE) !=
0)) {
		return NULL;
	}

	if ((check_params_create_lru(p) != 0) ||
		((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0)
||
		((sizeof(struct rte_bucket_4_16) % RTE_CACHE_LINE_SIZE) !=
0)) {
		return NULL;
	}

	if ((check_params_create_lru(p) != 0) ||
		((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0)
||
		((sizeof(struct rte_bucket_4_32) % RTE_CACHE_LINE_SIZE) !=
0)) {
		return NULL;
	}

The size of rte_bucket_4_8/16/32 is not aligned to cache line size. This is normal, because POWER has different cache line size. The change of struct rte_bucket_4_8/16/32 may solve this problem. I didn't do further investigation. Can you help to double check this patch?

-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月12日 20:03
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 v5 4/8] table: enable table library for ppc64le

From: gowrishankar <[email protected]>

This patch enables librte_table in ppc64le.

Signed-off-by: Gowrishankar Muthukrishnan
<[email protected]>

---
 config/defconfig_ppc_64-power8-linuxapp-gcc | 1 -
 1 file changed, 1 deletion(-)
(quoted diff) +0 -0

b/config/defconfig_ppc_64-power8-linuxapp-gcc
index dede34f..41f67d5 100644

config/defconfig_ppc_64-power8-linuxapp-gcc +0 -0
@@ -59,5 +59,4 @@ 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
--
1.9.1

#6 lore raw

Re: [PATCH v5 4/8] table: enable table library for ppc64le

Thanks Chao for bringing up.

I had fixed one of .c earlier before rebasing to master. I then dropped the patch while decoupling ppc enablement and bug fixes. Now I realize on why we need this fix as part of enabling table in ppc completely. So, added one additional patch separately fixing this in v6. After this patch, a ltable lib unit test fail as in Intel case currently and it is not related to powerpc changes.

If some one already looking into broken unit test failure for table lib, that is helpful.

Regards,
Gowrishankar

Quoted 75 lines · Chao Zhu

Gowrishankar,

The unit test of table got failed.
When I took a look at the code, it failed on this line in file lib/librte_table/rte_table_hash_key8.c , lib/librte_table/rte_table_hash_key16.c, lib/librte_table/rte_table_hash_key32.c:

	if ((check_params_create_lru(p) != 0) ||
		((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0)
||
		((sizeof(struct rte_bucket_4_8) % RTE_CACHE_LINE_SIZE) !=
0)) {
		return NULL;
	}

	if ((check_params_create_lru(p) != 0) ||
		((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0)
||
		((sizeof(struct rte_bucket_4_16) % RTE_CACHE_LINE_SIZE) !=
0)) {
		return NULL;
	}

	if ((check_params_create_lru(p) != 0) ||
		((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0)
||
		((sizeof(struct rte_bucket_4_32) % RTE_CACHE_LINE_SIZE) !=
0)) {
		return NULL;
	}

The size of rte_bucket_4_8/16/32 is not aligned to cache line size. This is normal, because POWER has different cache line size. The change of struct rte_bucket_4_8/16/32 may solve this problem. I didn't do further investigation. Can you help to double check this patch?

-----Original Message-----
From: Gowrishankar Muthukrishnan [mailto:[email protected]]
Sent: 2016年8月12日 20:03
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 v5 4/8] table: enable table library for ppc64le

From: gowrishankar <[email protected]>

This patch enables librte_table in ppc64le.

Signed-off-by: Gowrishankar Muthukrishnan
<[email protected]>

---
  config/defconfig_ppc_64-power8-linuxapp-gcc | 1 -
  1 file changed, 1 deletion(-)
config/defconfig_ppc_64-power8-linuxapp-gcc +0 -0
index dede34f..41f67d5 100644
@@ -59,5 +59,4 @@ 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
--
1.9.1

#7 lore raw

PATCH v5 5/8 sched: enable sched library for ppc64le

In reply to Gowrishankar Muthukrishnan

From: gowrishankar <[email protected]>

This patch enables librte_sched in ppc64le.

---
 config/defconfig_ppc_64-power8-linuxapp-gcc | 1 -
 1 file changed, 1 deletion(-)
config/defconfig_ppc_64-power8-linuxapp-gcc +0 -1
index 41f67d5..0c7060f 100644
@@ -57,6 +57,5 @@ 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
 CONFIG_RTE_LIBRTE_PORT=n
 CONFIG_RTE_LIBRTE_PIPELINE=n
Signature · 1 line
1.9.1
#8 lore raw

PATCH v5 6/8 port: enable port library for ppc64le

In reply to Gowrishankar Muthukrishnan

This patch enables librte_port in ppc64le.

---
 config/defconfig_ppc_64-power8-linuxapp-gcc | 1 -
 1 file changed, 1 deletion(-)
config/defconfig_ppc_64-power8-linuxapp-gcc +0 -1
index 0c7060f..1fc8df2 100644
@@ -57,5 +57,4 @@ 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_PORT=n
 CONFIG_RTE_LIBRTE_PIPELINE=n
Signature · 1 line
1.9.1
#9 lore raw

PATCH v5 7/8 pipeline: enable pipeline library for ppc64le

In reply to Gowrishankar Muthukrishnan

This patch enables librte_pipeline for ppc64le.

---
 config/defconfig_ppc_64-power8-linuxapp-gcc | 2 --
 1 file changed, 2 deletions(-)
config/defconfig_ppc_64-power8-linuxapp-gcc +0 -2
index 1fc8df2..f953e61 100644
@@ -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_PIPELINE=n
Signature · 1 line
1.9.1
#10 lore raw

PATCH v5 8/8 ip_pipeline: fix lcore mapping for varying SMT threads as in ppc64

In reply to Gowrishankar Muthukrishnan

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.

---
 examples/ip_pipeline/cpu_core_map.c | 8 ++++++++
 1 file changed, 8 insertions(+)
examples/ip_pipeline/cpu_core_map.c +8 -0
index cb088b1..dd8f678 100644
@@ -351,8 +351,10 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)
 			int lcore_socket_id =
 				cpu_core_map_get_socket_id_linux(lcore_id);
 
+#if !defined(RTE_ARCH_PPC_64)
 			if (lcore_socket_id < 0)
 				return -1;
+#endif
 
 			if (((uint32_t) lcore_socket_id) == socket_id)
 				n_detected++;
@@ -368,6 +370,7 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)
 					cpu_core_map_get_socket_id_linux(
 					lcore_id);
 
+#if !defined(RTE_ARCH_PPC_64)
 				if (lcore_socket_id < 0)
 					return -1;
 
@@ -377,9 +380,14 @@ cpu_core_map_compute_linux(struct cpu_core_map *map)
 
 				if (lcore_core_id < 0)
 					return -1;
+#endif
 
+#if !defined(RTE_ARCH_PPC_64)
 				if (((uint32_t) lcore_socket_id == socket_id) &&
 					((uint32_t) lcore_core_id == core_id)) {
+#else
+				if (((uint32_t) lcore_socket_id == socket_id)) {
+#endif
 					uint32_t pos = cpu_core_map_pos(map,
 						socket_id,
 						core_id_contig,
Signature · 1 line
1.9.1