DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 3/3] net/sfc: support aarch64 architecture
Date: Thu, 22 Oct 2020 13:24:07 +0100	[thread overview]
Message-ID: <1603369447-28388-3-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1603369447-28388-1-git-send-email-arybchenko@solarflare.com>

Enable the PMD build on aarch64.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 config/arm/meson.build                 |  1 -
 doc/guides/nics/features/sfc_efx.ini   |  1 +
 doc/guides/rel_notes/release_20_11.rst |  1 +
 drivers/common/sfc_efx/efsys.h         | 17 +++++++++++++++++
 drivers/common/sfc_efx/meson.build     |  4 ++--
 drivers/net/sfc/meson.build            |  4 ++--
 drivers/net/sfc/sfc_ef10.h             |  9 +++++++++
 7 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index b49203f..13f42cd 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -22,7 +22,6 @@ flags_common_default = [
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
 	['RTE_NET_FM10K', false],
-	['RTE_NET_SFC_EFX', false],
 	['RTE_NET_AVP', false],
 
 	['RTE_SCHED_VECTOR', false],
diff --git a/doc/guides/nics/features/sfc_efx.ini b/doc/guides/nics/features/sfc_efx.ini
index eca1427..213b6e1 100644
--- a/doc/guides/nics/features/sfc_efx.ini
+++ b/doc/guides/nics/features/sfc_efx.ini
@@ -40,4 +40,5 @@ Multiprocess aware   = Y
 BSD nic_uio          = Y
 Linux UIO            = Y
 Linux VFIO           = Y
+ARMv8                = Y
 x86-64               = Y
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index fa666e0..fcf206a 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -167,6 +167,7 @@ New Features
   * Added SR-IOV PF support
   * Added Alveo SN1000 SmartNICs (EF100 architecture) support including
     flow API transfer rules for switch HW offload
+  * Added ARMv8 support
 
 * **Updated Virtio driver.**
 
diff --git a/drivers/common/sfc_efx/efsys.h b/drivers/common/sfc_efx/efsys.h
index 139f4d8..a3ae313 100644
--- a/drivers/common/sfc_efx/efsys.h
+++ b/drivers/common/sfc_efx/efsys.h
@@ -39,8 +39,25 @@
 
 #define EFSYS_HAS_UINT64 1
 #define EFSYS_USE_UINT64 1
+/*
+ * __SSE2__ is defined by a compiler if target architecture supports
+ * Streaming SIMD Extensions 2 (SSE2). __m128i is a data type used
+ * by the extension instructions.
+ */
+#if defined(__SSE2__)
 #define EFSYS_HAS_UINT128 1
 typedef __m128i efsys_uint128_t;
+/*
+ * __int128 and unsigned __int128 are compiler extensions (built-in types).
+ * __SIZEOF_INT128__ is defined by the compiler if these data types are
+ * available.
+ */
+#elif defined(__SIZEOF_INT128__)
+#define EFSYS_HAS_UINT128 1
+typedef unsigned __int128 efsys_uint128_t;
+#else
+#error Unsigned 128-bit width integers support is required
+#endif
 
 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
 #define EFSYS_IS_BIG_ENDIAN 1
diff --git a/drivers/common/sfc_efx/meson.build b/drivers/common/sfc_efx/meson.build
index b7a0763..6cb9f07 100644
--- a/drivers/common/sfc_efx/meson.build
+++ b/drivers/common/sfc_efx/meson.build
@@ -5,9 +5,9 @@
 # This software was jointly developed between OKTET Labs (under contract
 # for Solarflare) and Solarflare Communications, Inc.
 
-if arch_subdir != 'x86' or not dpdk_conf.get('RTE_ARCH_64')
+if (arch_subdir != 'x86' or not dpdk_conf.get('RTE_ARCH_64')) and (arch_subdir != 'arm' or not host_machine.cpu_family().startswith('aarch64'))
 	build = false
-	reason = 'only supported on x86_64'
+	reason = 'only supported on x86_64 and aarch64'
 endif
 
 extra_flags = []
diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build
index 42b184c..be888bd 100644
--- a/drivers/net/sfc/meson.build
+++ b/drivers/net/sfc/meson.build
@@ -6,9 +6,9 @@
 # This software was jointly developed between OKTET Labs (under contract
 # for Solarflare) and Solarflare Communications, Inc.
 
-if arch_subdir != 'x86' or not dpdk_conf.get('RTE_ARCH_64')
+if (arch_subdir != 'x86' or not dpdk_conf.get('RTE_ARCH_64')) and (arch_subdir != 'arm' or not host_machine.cpu_family().startswith('aarch64'))
 	build = false
-	reason = 'only supported on x86_64'
+	reason = 'only supported on x86_64 and aarch64'
 endif
 
 extra_flags = []
diff --git a/drivers/net/sfc/sfc_ef10.h b/drivers/net/sfc/sfc_ef10.h
index 7bca219..e13f43f 100644
--- a/drivers/net/sfc/sfc_ef10.h
+++ b/drivers/net/sfc/sfc_ef10.h
@@ -22,6 +22,15 @@
 
 #define SFC_EF10_EV_QCLEAR_MASK		(~(SFC_EF10_EV_PER_CACHE_LINE - 1))
 
+/*
+ * Use simple libefx-based implementation of the
+ * sfc_ef10_ev_qclear_cache_line() if SSE2 is not available
+ * since optimized implementation uses __m128i intrinsics.
+ */
+#ifndef __SSE2__
+#define SFC_EF10_EV_QCLEAR_USE_EFX
+#endif
+
 #if defined(SFC_EF10_EV_QCLEAR_USE_EFX)
 static inline void
 sfc_ef10_ev_qclear_cache_line(void *ptr)
-- 
1.8.3.1


  parent reply	other threads:[~2020-10-22 12:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 12:24 [dpdk-dev] [PATCH 1/3] common/sfc_efx: introduce 128-bit unsigned integer compat Andrew Rybchenko
2020-10-22 12:24 ` [dpdk-dev] [PATCH 2/3] net/sfc: use compat for 128-bit unsigned integer Andrew Rybchenko
2020-10-22 12:24 ` Andrew Rybchenko [this message]
2020-10-30  9:04 ` [dpdk-dev] [PATCH 1/3] common/sfc_efx: introduce 128-bit unsigned integer compat Ferruh Yigit
2020-11-04 16:29 ` Thomas Monjalon
2020-11-04 16:41   ` Honnappa Nagarahalli

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=1603369447-28388-3-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    /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).