[v3] eal: add notes to SMP memory barrier APIs

Message ID 20230703095642.3326601-1-ruifeng.wang@arm.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v3] eal: add notes to SMP memory barrier APIs |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Ruifeng Wang July 3, 2023, 9:56 a.m. UTC
  The rte_smp_xx() APIs are deprecated. But it is not mentioned
in the function header.
Added notes in function header for clarification.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
v3: Added suggested memory ordering semantic for replacement.
    Refined deprecation explanation.
v2: Made the notes more specific.

 lib/eal/include/generic/rte_atomic.h | 30 ++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
  

Comments

Thomas Monjalon July 28, 2023, 9:17 a.m. UTC | #1
03/07/2023 11:56, Ruifeng Wang:
> The rte_smp_xx() APIs are deprecated. But it is not mentioned
> in the function header.
> Added notes in function header for clarification.
> 
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
> v3: Added suggested memory ordering semantic for replacement.
>     Refined deprecation explanation.
> v2: Made the notes more specific.
> 
>  lib/eal/include/generic/rte_atomic.h | 30 ++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h
> index 58df843c54..aef44e2455 100644
> --- a/lib/eal/include/generic/rte_atomic.h
> +++ b/lib/eal/include/generic/rte_atomic.h
> @@ -55,6 +55,14 @@ static inline void rte_rmb(void);
>   * Guarantees that the LOAD and STORE operations that precede the
>   * rte_smp_mb() call are globally visible across the lcores
>   * before the LOAD and STORE operations that follows it.
> + *
> + * @note
> + *  This function is deprecated.
> + *  It provides similar synchronization primitive as atomic fence,
> + *  but has different syntax and memory ordering semantic. Hence
> + *  deprecated for the simplicity of memory ordering semantics in use.
> + *
> + *  rte_atomic_thread_fence(__ATOMIC_ACQ_REL) should be used instead.
>   */
>  static inline void rte_smp_mb(void);
>  
> @@ -64,6 +72,17 @@ static inline void rte_smp_mb(void);
>   * Guarantees that the STORE operations that precede the
>   * rte_smp_wmb() call are globally visible across the lcores
>   * before the STORE operations that follows it.
> + *
> + * @note
> + *  This function is deprecated.
> + *  It provides similar synchronization primitive as atomic fence,
> + *  but has different syntax and memory ordering semantic. Hence
> + *  deprecated for the simplicity of memory ordering semantics in use.
> + *
> + *  rte_atomic_thread_fence(__ATOMIC_RELEASE) should be used instead.
> + *  The fence also guarantees LOAD operations that precede the call
> + *  are globally visible across the lcores before the STORE operations
> + *  that follows it.
>   */
>  static inline void rte_smp_wmb(void);
>  
> @@ -73,6 +92,17 @@ static inline void rte_smp_wmb(void);
>   * Guarantees that the LOAD operations that precede the
>   * rte_smp_rmb() call are globally visible across the lcores
>   * before the LOAD operations that follows it.
> + *
> + * @note
> + *  This function is deprecated.
> + *  It provides similar synchronization primitive as atomic fence,
> + *  but has different syntax and memory ordering semantic. Hence
> + *  deprecated for the simplicity of memory ordering semantics in use.
> + *
> + *  rte_atomic_thread_fence(__ATOMIC_ACQUIRE) should be used instead.
> + *  The fence also guarantees LOAD operations that precede the call
> + *  are globally visible across the lcores before the STORE operations
> + *  that follows it.
>   */
>  static inline void rte_smp_rmb(void);
>  ///@}

There was no more comment.

Applied, thanks.
  

Patch

diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h
index 58df843c54..aef44e2455 100644
--- a/lib/eal/include/generic/rte_atomic.h
+++ b/lib/eal/include/generic/rte_atomic.h
@@ -55,6 +55,14 @@  static inline void rte_rmb(void);
  * Guarantees that the LOAD and STORE operations that precede the
  * rte_smp_mb() call are globally visible across the lcores
  * before the LOAD and STORE operations that follows it.
+ *
+ * @note
+ *  This function is deprecated.
+ *  It provides similar synchronization primitive as atomic fence,
+ *  but has different syntax and memory ordering semantic. Hence
+ *  deprecated for the simplicity of memory ordering semantics in use.
+ *
+ *  rte_atomic_thread_fence(__ATOMIC_ACQ_REL) should be used instead.
  */
 static inline void rte_smp_mb(void);
 
@@ -64,6 +72,17 @@  static inline void rte_smp_mb(void);
  * Guarantees that the STORE operations that precede the
  * rte_smp_wmb() call are globally visible across the lcores
  * before the STORE operations that follows it.
+ *
+ * @note
+ *  This function is deprecated.
+ *  It provides similar synchronization primitive as atomic fence,
+ *  but has different syntax and memory ordering semantic. Hence
+ *  deprecated for the simplicity of memory ordering semantics in use.
+ *
+ *  rte_atomic_thread_fence(__ATOMIC_RELEASE) should be used instead.
+ *  The fence also guarantees LOAD operations that precede the call
+ *  are globally visible across the lcores before the STORE operations
+ *  that follows it.
  */
 static inline void rte_smp_wmb(void);
 
@@ -73,6 +92,17 @@  static inline void rte_smp_wmb(void);
  * Guarantees that the LOAD operations that precede the
  * rte_smp_rmb() call are globally visible across the lcores
  * before the LOAD operations that follows it.
+ *
+ * @note
+ *  This function is deprecated.
+ *  It provides similar synchronization primitive as atomic fence,
+ *  but has different syntax and memory ordering semantic. Hence
+ *  deprecated for the simplicity of memory ordering semantics in use.
+ *
+ *  rte_atomic_thread_fence(__ATOMIC_ACQUIRE) should be used instead.
+ *  The fence also guarantees LOAD operations that precede the call
+ *  are globally visible across the lcores before the STORE operations
+ *  that follows it.
  */
 static inline void rte_smp_rmb(void);
 ///@}