eal: add experimental tags for write combining store

Message ID 20201014081430.31349-1-david.marchand@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series eal: add experimental tags for write combining store |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/Intel-compilation fail Compilation issues

Commit Message

David Marchand Oct. 14, 2020, 8:14 a.m. UTC
  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")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eal/arm/include/rte_io_64.h | 2 ++
 lib/librte_eal/x86/include/rte_io.h    | 9 +++++++++
 2 files changed, 11 insertions(+)
  

Comments

Ruifeng Wang Oct. 14, 2020, 9:30 a.m. UTC | #1
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Wednesday, October 14, 2020 4:14 PM
> To: dev@dpdk.org; radu.nicolau@intel.com
> Cc: jerinj@marvell.com; Ruifeng Wang <Ruifeng.Wang@arm.com>; Jan
> Viktorin <viktorin@rehivetech.com>; Bruce Richardson
> <bruce.richardson@intel.com>; Konstantin Ananyev
> <konstantin.ananyev@intel.com>
> 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")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/librte_eal/arm/include/rte_io_64.h | 2 ++
>  lib/librte_eal/x86/include/rte_io.h    | 9 +++++++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/lib/librte_eal/arm/include/rte_io_64.h
> b/lib/librte_eal/arm/include/rte_io_64.h
> index d07d9cb226..f9a1f10ce7 100644
> --- a/lib/librte_eal/arm/include/rte_io_64.h
> +++ b/lib/librte_eal/arm/include/rte_io_64.h
> @@ -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
> --- a/lib/librte_eal/x86/include/rte_io.h
> +++ b/lib/librte_eal/x86/include/rte_io.h
> @@ -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
> --
> 2.23.0

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
  
Radu Nicolau Oct. 14, 2020, 9:57 a.m. UTC | #2
On 10/14/2020 9:14 AM, David Marchand wrote:
> 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")
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Reviewed-by: Radu Nicolau <radu.nicolau@intel.com 
<mailto:radu.nicolau@intel.com>>
  

Patch

diff --git a/lib/librte_eal/arm/include/rte_io_64.h b/lib/librte_eal/arm/include/rte_io_64.h
index d07d9cb226..f9a1f10ce7 100644
--- a/lib/librte_eal/arm/include/rte_io_64.h
+++ b/lib/librte_eal/arm/include/rte_io_64.h
@@ -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
--- a/lib/librte_eal/x86/include/rte_io.h
+++ b/lib/librte_eal/x86/include/rte_io.h
@@ -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