DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jan Viktorin <viktorin@rehivetech.com>
To: dev@dpdk.org
Cc: Vlastimil Kosar <kosar@rehivetech.com>,
	Jan Viktorin <viktorin@rehivetech.com>
Subject: [dpdk-dev] [PATCH v1 12/12] arm: Disable usage of SSE optimized code in librte_acl
Date: Sat,  3 Oct 2015 10:58:18 +0200	[thread overview]
Message-ID: <b4836bdec46be5a0c457ca185d9e82f7a5ad1570.1443737626.git.viktorin@rehivetech.com> (raw)
In-Reply-To: <cover.1443737626.git.viktorin@rehivetech.com>
In-Reply-To: <cover.1443737626.git.viktorin@rehivetech.com>

From: Vlastimil Kosar <kosar@rehivetech.com>

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 <kosar@rehivetech.com>
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
---
 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 <rte_common.h>
+#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686)
 #include <rte_vect.h>
+#endif
 #include <rte_memory.h>
 #include <rte_log.h>
 #include <rte_memcpy.h>
-- 
2.5.2

      parent reply	other threads:[~2015-10-03  8:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-03  8:58 [dpdk-dev] [PATCH v1 00/12] Support for ARM(v7) Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 01/12] mk: Introduce ARMv7 architecture Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 02/12] eal/arm: atomic operations for ARM Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 03/12] eal/arm: byte order " Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 04/12] eal/arm: cpu cycle " Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 05/12] eal/arm: prefetch " Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 06/12] eal/arm: spinlock operations for ARM (without HTM) Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 07/12] eal/arm: vector memcpy for ARM Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 08/12] eal/arm: cpu flag checks " Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 09/12] eal/arm: rwlock support " Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 10/12] gcc/arm: avoid alignment errors to break build Jan Viktorin
2015-10-03  8:58 ` [dpdk-dev] [PATCH v1 11/12] lpm/arm: implement rte_lpm_lookupx4 using rte_lpm_lookup_bulk on for-x86 Jan Viktorin
2015-10-03  8:58 ` Jan Viktorin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4836bdec46be5a0c457ca185d9e82f7a5ad1570.1443737626.git.viktorin@rehivetech.com \
    --to=viktorin@rehivetech.com \
    --cc=dev@dpdk.org \
    --cc=kosar@rehivetech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).