summaryrefslogtreecommitdiff
path: root/lib/hash/rte_cuckoo_hash.c
diff options
context:
space:
mode:
authorTyler Retzlaff <roretzla@linux.microsoft.com>2024-02-14 22:50:54 -0800
committerThomas Monjalon <thomas@monjalon.net>2024-02-18 13:12:33 +0100
commit283d843722f11c4cb4714fa8661f4cfb7986b0e6 (patch)
treeab748b1176e063ce47207dac28e6a4e093804be4 /lib/hash/rte_cuckoo_hash.c
parent93998f3c5f22747e4f2c5e8714fa5cbe6c9d1574 (diff)
lib: use atomic thread fence recommended API
Use rte_atomic_thread_fence() instead of directly using __atomic_thread_fence() builtin GCC intrinsic or __rte_atomic_thread_fence() internal function. Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Diffstat (limited to 'lib/hash/rte_cuckoo_hash.c')
-rw-r--r--lib/hash/rte_cuckoo_hash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 70456754c4..9cf94645f6 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -878,7 +878,7 @@ rte_hash_cuckoo_move_insert_mw(const struct rte_hash *h,
/* The store to sig_current should not
* move above the store to tbl_chng_cnt.
*/
- __atomic_thread_fence(rte_memory_order_release);
+ rte_atomic_thread_fence(rte_memory_order_release);
}
/* Need to swap current/alt sig to allow later
@@ -910,7 +910,7 @@ rte_hash_cuckoo_move_insert_mw(const struct rte_hash *h,
/* The store to sig_current should not
* move above the store to tbl_chng_cnt.
*/
- __atomic_thread_fence(rte_memory_order_release);
+ rte_atomic_thread_fence(rte_memory_order_release);
}
curr_bkt->sig_current[curr_slot] = sig;
@@ -1403,7 +1403,7 @@ __rte_hash_lookup_with_hash_lf(const struct rte_hash *h, const void *key,
/* The loads of sig_current in search_one_bucket
* should not move below the load from tbl_chng_cnt.
*/
- __atomic_thread_fence(rte_memory_order_acquire);
+ rte_atomic_thread_fence(rte_memory_order_acquire);
/* Re-read the table change counter to check if the
* table has changed during search. If yes, re-do
* the search.
@@ -1632,7 +1632,7 @@ __rte_hash_compact_ll(const struct rte_hash *h,
/* The store to sig_current should
* not move above the store to tbl_chng_cnt.
*/
- __atomic_thread_fence(rte_memory_order_release);
+ rte_atomic_thread_fence(rte_memory_order_release);
}
last_bkt->sig_current[i] = NULL_SIGNATURE;
rte_atomic_store_explicit(&last_bkt->key_idx[i],
@@ -2223,7 +2223,7 @@ next_key:
/* The loads of sig_current in compare_signatures
* should not move below the load from tbl_chng_cnt.
*/
- __atomic_thread_fence(rte_memory_order_acquire);
+ rte_atomic_thread_fence(rte_memory_order_acquire);
/* Re-read the table change counter to check if the
* table has changed during search. If yes, re-do
* the search.