From patchwork Sat Oct 3 08:58:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Viktorin X-Patchwork-Id: 7396 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 5513391B3; Sat, 3 Oct 2015 10:59:06 +0200 (CEST) Received: from we2-f167.wedos.net (w-smtp-out-7.wedos.net [46.28.106.5]) by dpdk.org (Postfix) with ESMTP id 534868E7A for ; Sat, 3 Oct 2015 10:58:55 +0200 (CEST) Received: from ([147.229.13.147]) by we2-f167.wedos.net (WEDOS Mail Server mail2) with ASMTP (SSL) id QWJ00051; Sat, 03 Oct 2015 10:58:51 +0200 From: Jan Viktorin To: dev@dpdk.org Date: Sat, 3 Oct 2015 10:58:18 +0200 Message-Id: X-Mailer: git-send-email 2.6.0 In-Reply-To: References: In-Reply-To: References: Cc: Vlastimil Kosar , Jan Viktorin Subject: [dpdk-dev] [PATCH v1 12/12] arm: Disable usage of SSE optimized code in librte_acl X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Vlastimil Kosar The SSE optimized code is disabled for architectures other than i686 and x86_64. ACL works now on ARM. FIXME: should be reworked to avoid if/endif mess Signed-off-by: Vlastimil Kosar Signed-off-by: Jan Viktorin --- config/defconfig_arm-armv7-a-linuxapp-gcc | 3 --- lib/librte_acl/acl.h | 2 ++ lib/librte_acl/rte_acl.c | 8 +++++++- lib/librte_acl/rte_acl_osdep.h | 2 ++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config/defconfig_arm-armv7-a-linuxapp-gcc b/config/defconfig_arm-armv7-a-linuxapp-gcc index c434429..e091200 100644 --- a/config/defconfig_arm-armv7-a-linuxapp-gcc +++ b/config/defconfig_arm-armv7-a-linuxapp-gcc @@ -54,9 +54,6 @@ CONFIG_RTE_EAL_IGB_UIO=n # missing rte_vect.h for ARM CONFIG_XMM_SIZE=16 -# fails to compile on ARM -CONFIG_RTE_LIBRTE_ACL=n - # cannot use those on ARM CONFIG_RTE_KNI_KMOD=n CONFIG_RTE_LIBRTE_EM_PMD=n diff --git a/lib/librte_acl/acl.h b/lib/librte_acl/acl.h index eb4930c..cb4e6a8 100644 --- a/lib/librte_acl/acl.h +++ b/lib/librte_acl/acl.h @@ -222,9 +222,11 @@ int rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data, uint32_t *results, uint32_t num, uint32_t categories); +#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) int rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data, uint32_t *results, uint32_t num, uint32_t categories); +#endif int rte_acl_classify_avx2(const struct rte_acl_ctx *ctx, const uint8_t **data, diff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c index a54d531..f173b31 100644 --- a/lib/librte_acl/rte_acl.c +++ b/lib/librte_acl/rte_acl.c @@ -60,8 +60,13 @@ rte_acl_classify_avx2(__rte_unused const struct rte_acl_ctx *ctx, static const rte_acl_classify_t classify_fns[] = { [RTE_ACL_CLASSIFY_DEFAULT] = rte_acl_classify_scalar, [RTE_ACL_CLASSIFY_SCALAR] = rte_acl_classify_scalar, +#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) [RTE_ACL_CLASSIFY_SSE] = rte_acl_classify_sse, [RTE_ACL_CLASSIFY_AVX2] = rte_acl_classify_avx2, +#else + [RTE_ACL_CLASSIFY_SSE] = rte_acl_classify_scalar, + [RTE_ACL_CLASSIFY_AVX2] = rte_acl_classify_scalar, +#endif }; /* by default, use always available scalar code path. */ @@ -95,6 +100,7 @@ rte_acl_init(void) { enum rte_acl_classify_alg alg = RTE_ACL_CLASSIFY_DEFAULT; +#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) #ifdef CC_AVX2_SUPPORT if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2)) alg = RTE_ACL_CLASSIFY_AVX2; @@ -103,7 +109,7 @@ rte_acl_init(void) if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1)) #endif alg = RTE_ACL_CLASSIFY_SSE; - +#endif rte_acl_set_default_classify(alg); } diff --git a/lib/librte_acl/rte_acl_osdep.h b/lib/librte_acl/rte_acl_osdep.h index 41f7e3d..05cf9a8 100644 --- a/lib/librte_acl/rte_acl_osdep.h +++ b/lib/librte_acl/rte_acl_osdep.h @@ -59,7 +59,9 @@ #define DIM(x) RTE_DIM(x) #include +#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) #include +#endif #include #include #include