aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-07-15 11:54:41 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2021-07-15 11:25:08 +0000
commitaf7fb04b81c765c3e3f621c6b23fc3390310715b (patch)
treefec5e2de4dc1ec64026c7339eb898797ce66fba0 /src/vppinfra
parent0aea808ac5cb1132b9787c8f7d5f9d995cd3413b (diff)
misc: replace CLIB_PREFETCH with clib_prefetch_{load,store}
Type: refactor Change-Id: Id10cbf52e8f2dd809080a228d8fa282308be84ac Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/callback_data.h35
1 files changed, 19 insertions, 16 deletions
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 */