DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev]  [PATCH 1/2] eal: introduce rte_prefetch_non_temporal
Date: Sun, 6 Dec 2015 20:54:29 +0530	[thread overview]
Message-ID: <1449415470-25545-2-git-send-email-jerin.jacob@caviumnetworks.com> (raw)
In-Reply-To: <1449415470-25545-1-git-send-email-jerin.jacob@caviumnetworks.com>

non-temporal/transient/stream version of rte_prefetch0()

The non-temporal prefetch is intended as a prefetch hint that processor
will use the prefetched data only once or short period,
unlike the rte_prefetch0() function which imply that
prefetched data to use repeatedly.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h |  5 +++++
 lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h |  5 +++++
 lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h |  5 +++++
 lib/librte_eal/common/include/arch/tile/rte_prefetch.h   |  5 +++++
 lib/librte_eal/common/include/arch/x86/rte_prefetch.h    |  5 +++++
 lib/librte_eal/common/include/generic/rte_prefetch.h     | 12 ++++++++++++
 6 files changed, 37 insertions(+)

diff --git a/lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h b/lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h
index b716384..3157224 100644
--- a/lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h
+++ b/lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h
@@ -54,6 +54,11 @@ static inline void rte_prefetch2(const volatile void *p)
 	asm volatile ("pld [%0]" : : "r" (p));
 }
 
+static inline void rte_prefetch_non_temporal(const volatile void *p)
+{
+	rte_prefetch0(p);
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h b/lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h
index f9cc62e..3ed46a4 100644
--- a/lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h
+++ b/lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h
@@ -54,6 +54,11 @@ static inline void rte_prefetch2(const volatile void *p)
 	asm volatile ("PRFM PLDL3KEEP, [%0]" : : "r" (p));
 }
 
+static inline void rte_prefetch_non_temporal(const volatile void *p)
+{
+	asm volatile ("PRFM PLDL1STRM, [%0]" : : "r" (p));
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h b/lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h
index fea3be1..cab6fe0 100644
--- a/lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h
+++ b/lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h
@@ -54,6 +54,11 @@ static inline void rte_prefetch2(const volatile void *p)
 	asm volatile ("dcbt 0,%[p],1" : : [p] "r" (p));
 }
 
+static inline void rte_prefetch_non_temporal(const volatile void *p)
+{
+	rte_prefetch0(p);
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_eal/common/include/arch/tile/rte_prefetch.h b/lib/librte_eal/common/include/arch/tile/rte_prefetch.h
index c94075c..19d3c6e 100644
--- a/lib/librte_eal/common/include/arch/tile/rte_prefetch.h
+++ b/lib/librte_eal/common/include/arch/tile/rte_prefetch.h
@@ -54,6 +54,11 @@ static inline void rte_prefetch2(const volatile void *p)
 	__builtin_prefetch((const void *)(uintptr_t)p, 0, 1);
 }
 
+static inline void rte_prefetch_non_temporal(const volatile void *p)
+{
+	rte_prefetch0(p);
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_eal/common/include/arch/x86/rte_prefetch.h b/lib/librte_eal/common/include/arch/x86/rte_prefetch.h
index 8e6e02c..5dac47e 100644
--- a/lib/librte_eal/common/include/arch/x86/rte_prefetch.h
+++ b/lib/librte_eal/common/include/arch/x86/rte_prefetch.h
@@ -55,6 +55,11 @@ static inline void rte_prefetch2(const volatile void *p)
 	asm volatile ("prefetcht2 %[p]" : : [p] "m" (*(const volatile char *)p));
 }
 
+static inline void rte_prefetch_non_temporal(const volatile void *p)
+{
+	asm volatile ("prefetchnta %[p]" : : [p] "m" (*(const volatile char *)p));
+}
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/librte_eal/common/include/generic/rte_prefetch.h b/lib/librte_eal/common/include/generic/rte_prefetch.h
index 725715f..95c3fbc 100644
--- a/lib/librte_eal/common/include/generic/rte_prefetch.h
+++ b/lib/librte_eal/common/include/generic/rte_prefetch.h
@@ -68,4 +68,16 @@ static inline void rte_prefetch1(const volatile void *p);
  */
 static inline void rte_prefetch2(const volatile void *p);
 
+/**
+ * Prefetch a cache line into all cache levels(non-temporal/transient version)
+ *
+ * The non-temporal prefetch is intended as a prefetch hint that processor will
+ * use the prefetched data only once or short period, unlike the
+ * rte_prefetch0() function which imply that prefetched data to use repeatedly.
+ *
+ * @param p
+ *   Address to prefetch
+ */
+static inline void rte_prefetch_non_temporal(const volatile void *p);
+
 #endif /* _RTE_PREFETCH_H_ */
-- 
2.1.0

  reply	other threads:[~2015-12-06 15:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06 15:24 [dpdk-dev] [RFC PATCH 0/2] Fix examples/distributor build issue for non x86 Jerin Jacob
2015-12-06 15:24 ` Jerin Jacob [this message]
2016-02-11 11:00   ` [dpdk-dev] [PATCH 1/2] eal: introduce rte_prefetch_non_temporal Thomas Monjalon
2016-02-11 11:43   ` Jan Viktorin
2015-12-06 15:24 ` [dpdk-dev] [PATCH 2/2] examples/distributor: remove IA specific __mm_prefetch Jerin Jacob
2016-01-29  3:21 ` [dpdk-dev] [RFC PATCH 0/2] Fix examples/distributor build issue for non x86 Jerin Jacob
2016-01-29 15:03   ` Bruce Richardson
2016-01-29 16:53     ` Jerin Jacob
2016-02-12 11:13 ` [dpdk-dev] [PATCH v2 " Jerin Jacob
2016-02-12 11:13   ` [dpdk-dev] [PATCH v2 1/2] eal: introduce rte_prefetch_non_temporal Jerin Jacob
2016-02-12 11:13   ` [dpdk-dev] [PATCH v2 2/2] examples/distributor: remove IA specific __mm_prefetch Jerin Jacob
2016-02-16  6:28   ` [dpdk-dev] [PATCH v2 0/2] Fix examples/distributor build issue for non x86 Thomas Monjalon

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=1449415470-25545-2-git-send-email-jerin.jacob@caviumnetworks.com \
    --to=jerin.jacob@caviumnetworks.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).