Skip to contentSkip to conversation

eal: add experimental tags for write combining store

PATCH Superseded David Marchand 3 participants 5 messages Oct 14, 2020 – Oct 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: add experimental tags for write combining store

Only marking the doxygen declarations is not enough.
Arch specific implementations must be tagged as well since there is no common declaration of those inlines.

Fixes 8a00dfc738fe ("eal: add write combining store")
---
 lib/librte_eal/arm/include/rte_io_64.h | 2 ++
 lib/librte_eal/x86/include/rte_io.h    | 9 +++++++++
 2 files changed, 11 insertions(+)
lib/librte_eal/arm/include/rte_io_64.h +2 -0
index d07d9cb226..f9a1f10ce7 100644
@@ -164,12 +164,14 @@ rte_write64(uint64_t value, volatile void *addr)
 	rte_write64_relaxed(value, addr);
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc(uint32_t value, volatile void *addr)
 {
 	rte_write32(value, addr);
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc_relaxed(uint32_t value, volatile void *addr)
 {
lib/librte_eal/x86/include/rte_io.h +9 -0
index c035eecc6a..730f958758 100644
@@ -28,6 +28,7 @@ __rte_x86_movdiri(uint32_t value, volatile void *addr)
 		: "a" (value), "d" (addr));
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc_relaxed(uint32_t value, volatile void *addr)
 {
@@ -47,11 +48,19 @@ rte_write32_wc_relaxed(uint32_t value, volatile void *addr)
 	}
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc(uint32_t value, volatile void *addr)
 {
+	/* gcc complains about calling this experimental function even
+	 * when not using it. Hide it with ALLOW_EXPERIMENTAL_API.
+	 */
+#ifdef ALLOW_EXPERIMENTAL_API
 	rte_wmb();
 	rte_write32_wc_relaxed(value, addr);
+#else
+	rte_write32(value, addr);
+#endif
 }
 
 #ifdef __cplusplus
Signature · 1 line
2.23.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 72 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Wednesday, October 14, 2020 4:14 PM
To: [email protected]; [email protected]
Cc: [email protected]; Ruifeng Wang <[email protected]>; Jan Viktorin <[email protected]>; Bruce Richardson <[email protected]>; Konstantin Ananyev <[email protected]>
Subject: [PATCH] eal: add experimental tags for write combining store

Only marking the doxygen declarations is not enough.
Arch specific implementations must be tagged as well since there is no common declaration of those inlines.

Fixes 8a00dfc738fe ("eal: add write combining store")
---
 lib/librte_eal/arm/include/rte_io_64.h | 2 ++
 lib/librte_eal/x86/include/rte_io.h    | 9 +++++++++
 2 files changed, 11 insertions(+)
lib/librte_eal/arm/include/rte_io_64.h +2 -0
index d07d9cb226..f9a1f10ce7 100644
@@ -164,12 +164,14 @@ rte_write64(uint64_t value, volatile void *addr)
 	rte_write64_relaxed(value, addr);
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc(uint32_t value, volatile void *addr)  {
 	rte_write32(value, addr);
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc_relaxed(uint32_t value, volatile void *addr)  { diff --git

a/lib/librte_eal/x86/include/rte_io.h b/lib/librte_eal/x86/include/rte_io.h index c035eecc6a..730f958758 100644

lib/librte_eal/x86/include/rte_io.h +10 -1
@@ -28,6 +28,7 @@ __rte_x86_movdiri(uint32_t value, volatile void *addr)
 		: "a" (value), "d" (addr));
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc_relaxed(uint32_t value, volatile void *addr)  { @@ -47,11
+48,19 @@ rte_write32_wc_relaxed(uint32_t value, volatile void *addr)
 	}
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc(uint32_t value, volatile void *addr)  {
+	/* gcc complains about calling this experimental function even
+	 * when not using it. Hide it with ALLOW_EXPERIMENTAL_API.
+	 */
+#ifdef ALLOW_EXPERIMENTAL_API
 	rte_wmb();
 	rte_write32_wc_relaxed(value, addr);
+#else
+	rte_write32(value, addr);
+#endif
 }
 
 #ifdef __cplusplus
--
Quoted 1 line

2.23.0

#3 lore raw

PATCH v2 1/1 eal: add experimental tags for write combining store

In reply to David Marchand

Only marking the doxygen declarations is not enough.
Arch specific implementations must be tagged as well since there is no common declaration of those inlines.

Fixes 8a00dfc738fe ("eal: add write combining store")

---
Changelog since v1:
- fix 32-bit build by adding missing rte_compat.h include,

---
 lib/librte_eal/arm/include/rte_io_64.h  | 2 ++
 lib/librte_eal/include/generic/rte_io.h | 1 +
 lib/librte_eal/x86/include/rte_io.h     | 9 +++++++++
 3 files changed, 12 insertions(+)
lib/librte_eal/arm/include/rte_io_64.h +2 -0
index d07d9cb226..f9a1f10ce7 100644
@@ -164,12 +164,14 @@ rte_write64(uint64_t value, volatile void *addr)
 	rte_write64_relaxed(value, addr);
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc(uint32_t value, volatile void *addr)
 {
 	rte_write32(value, addr);
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc_relaxed(uint32_t value, volatile void *addr)
 {
lib/librte_eal/include/generic/rte_io.h +1 -0
index 0669baa0b6..ebcf8051e1 100644
@@ -14,6 +14,7 @@
 
 #include <stdint.h>
 #include <rte_common.h>
+#include <rte_compat.h>
 #include <rte_atomic.h>
 
 #ifdef __DOXYGEN__
lib/librte_eal/x86/include/rte_io.h +9 -0
index c035eecc6a..730f958758 100644
@@ -28,6 +28,7 @@ __rte_x86_movdiri(uint32_t value, volatile void *addr)
 		: "a" (value), "d" (addr));
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc_relaxed(uint32_t value, volatile void *addr)
 {
@@ -47,11 +48,19 @@ rte_write32_wc_relaxed(uint32_t value, volatile void *addr)
 	}
 }
 
+__rte_experimental
 static __rte_always_inline void
 rte_write32_wc(uint32_t value, volatile void *addr)
 {
+	/* gcc complains about calling this experimental function even
+	 * when not using it. Hide it with ALLOW_EXPERIMENTAL_API.
+	 */
+#ifdef ALLOW_EXPERIMENTAL_API
 	rte_wmb();
 	rte_write32_wc_relaxed(value, addr);
+#else
+	rte_write32(value, addr);
+#endif
 }
 
 #ifdef __cplusplus
Signature · 1 line
2.23.0