From af7fb04b81c765c3e3f621c6b23fc3390310715b Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 15 Jul 2021 11:54:41 +0200 Subject: misc: replace CLIB_PREFETCH with clib_prefetch_{load,store} Type: refactor Change-Id: Id10cbf52e8f2dd809080a228d8fa282308be84ac Signed-off-by: Damjan Marion --- src/vppinfra/callback_data.h | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'src/vppinfra') diff --git a/src/vppinfra/callback_data.h b/src/vppinfra/callback_data.h index 9a1ad0a9778..23a7f900b99 100644 --- a/src/vppinfra/callback_data.h +++ b/src/vppinfra/callback_data.h @@ -273,16 +273,18 @@ do { \ * @param vec_ the callback vector * @param varargs additional callback parameters */ -#define clib_callback_data_call_vec(vec_, ...) \ -do { \ - u32 sz_ = vec_len (vec_); \ - u32 i_; \ - for (i_ = 0; i_ < sz_; i_++) \ - { \ - CLIB_PREFETCH (&vec_[i_+1], CLIB_CACHE_LINE_BYTES, STORE); \ - (vec_[i_].fp) (&vec_[i_], __VA_ARGS__); \ - } \ -} while (0) +#define clib_callback_data_call_vec(vec_, ...) \ + do \ + { \ + u32 sz_ = vec_len (vec_); \ + u32 i_; \ + for (i_ = 0; i_ < sz_; i_++) \ + { \ + clib_prefetch_store (&vec_[i_ + 1]); \ + (vec_[i_].fp) (&vec_[i_], __VA_ARGS__); \ + } \ + } \ + while (0) /** @brief Call the specified callback set * @param set_ the callback set @@ -297,12 +299,13 @@ do { \ /** @brief prefetch the callback set * @param set_ The callback set */ -#define clib_callback_data_prefetch(set_) \ -do { \ - if (PREDICT_FALSE ((set_)->curr)) \ - CLIB_PREFETCH ((set_)->curr, CLIB_CACHE_LINE_BYTES, STORE); \ -} while (0) - +#define clib_callback_data_prefetch(set_) \ + do \ + { \ + if (PREDICT_FALSE ((set_)->curr)) \ + clib_prefetch_store ((set_)->curr); \ + } \ + while (0) #endif /* included_callback_data_h */ -- cgit 1.2.3-korg