Skip to content

Commit

Permalink
eal: add notes to SMP memory barrier APIs
Browse files Browse the repository at this point in the history
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>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
Ruifeng Wang authored and ovsrobot committed Jul 3, 2023
1 parent 93a4b3b commit 41f3a42
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lib/eal/include/generic/rte_atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);
///@}
Expand Down

0 comments on commit 41f3a42

Please sign in to comment.