summaryrefslogtreecommitdiffstats
path: root/src/plugins
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/plugins
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/plugins')
-rw-r--r--src/plugins/acl/dataplane_node.c2
-rw-r--r--src/plugins/adl/ip4_allowlist.c40
-rw-r--r--src/plugins/adl/ip6_allowlist.c4
-rw-r--r--src/plugins/adl/node.c4
-rw-r--r--src/plugins/avf/input.c15
-rw-r--r--src/plugins/cnat/cnat_session.c4
-rw-r--r--src/plugins/crypto_sw_scheduler/main.c4
-rw-r--r--src/plugins/ct6/ct6_in2out.c8
-rw-r--r--src/plugins/ct6/ct6_out2in.c8
-rw-r--r--src/plugins/dns/reply_node.c4
-rw-r--r--src/plugins/dns/request_node.c4
-rw-r--r--src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c8
-rw-r--r--src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c10
-rw-r--r--src/plugins/dpdk/device/device.c10
-rw-r--r--src/plugins/dpdk/device/node.c16
-rw-r--r--src/plugins/flowprobe/node.c4
-rw-r--r--src/plugins/memif/device.c14
-rw-r--r--src/plugins/memif/node.c14
-rw-r--r--src/plugins/nat/det44/det44_in2out.c4
-rw-r--r--src/plugins/nat/det44/det44_out2in.c4
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed_handoff.c8
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed_in2out.c2
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed_inlines.h4
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed_out2in.c2
-rw-r--r--src/plugins/nat/nat44-ei/nat44_ei_handoff.c8
-rw-r--r--src/plugins/nat/nat44-ei/nat44_ei_in2out.c4
-rw-r--r--src/plugins/nat/nat44-ei/nat44_ei_out2in.c4
-rw-r--r--src/plugins/nsim/nsim_input.c2
-rw-r--r--src/plugins/rdma/input.c8
-rw-r--r--src/plugins/unittest/mpcap_node.c8
30 files changed, 110 insertions, 121 deletions
diff --git a/src/plugins/acl/dataplane_node.c b/src/plugins/acl/dataplane_node.c
index 3a351a01a04..1a050f54b14 100644
--- a/src/plugins/acl/dataplane_node.c
+++ b/src/plugins/acl/dataplane_node.c
@@ -277,7 +277,7 @@ acl_fa_node_common_prepare_fn (vlib_main_t * vm,
for (ii = ACL_PLUGIN_PREFETCH_GAP * vec_sz;
ii < (ACL_PLUGIN_PREFETCH_GAP + 1) * vec_sz; ii++)
{
- CLIB_PREFETCH (b[ii], CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b[ii]);
CLIB_PREFETCH (b[ii]->data, 2 * CLIB_CACHE_LINE_BYTES, LOAD);
}
}
diff --git a/src/plugins/adl/ip4_allowlist.c b/src/plugins/adl/ip4_allowlist.c
index ca7b4c115f0..316e2cb558b 100644
--- a/src/plugins/adl/ip4_allowlist.c
+++ b/src/plugins/adl/ip4_allowlist.c
@@ -98,30 +98,28 @@ VLIB_NODE_FN (ip4_adl_allowlist_node) (vlib_main_t * vm,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
- }
-
- /* speculatively enqueue b0 and b1 to the current next frame */
- to_next[0] = bi0 = from[0];
- to_next[1] = bi1 = from[1];
- from += 2;
- to_next += 2;
- n_left_from -= 2;
- n_left_to_next -= 2;
-
- b0 = vlib_get_buffer (vm, bi0);
- sw_if_index0 = vnet_buffer(b0)->sw_if_index[VLIB_RX];
+ clib_prefetch_store (p2->data);
+ clib_prefetch_store (p3->data);
+ }
+
+ /* speculatively enqueue b0 and b1 to the current next frame */
+ to_next[0] = bi0 = from[0];
+ to_next[1] = bi1 = from[1];
+ from += 2;
+ to_next += 2;
+ n_left_from -= 2;
+ n_left_to_next -= 2;
- ip0 = vlib_buffer_get_current (b0);
+ b0 = vlib_get_buffer (vm, bi0);
+ sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
- ccm0 = cm->adl_config_mains + VNET_ADL_IP4;
+ ip0 = vlib_buffer_get_current (b0);
- c0 = vnet_get_config_data
- (&ccm0->config_main,
- &adl_buffer (b0)->adl.current_config_index,
- &next0,
- sizeof (c0[0]));
+ ccm0 = cm->adl_config_mains + VNET_ADL_IP4;
+
+ c0 = vnet_get_config_data (
+ &ccm0->config_main, &adl_buffer (b0)->adl.current_config_index,
+ &next0, sizeof (c0[0]));
mtrie0 = &ip4_fib_get (c0->fib_index)->mtrie;
diff --git a/src/plugins/adl/ip6_allowlist.c b/src/plugins/adl/ip6_allowlist.c
index d272f101b43..5f38484666b 100644
--- a/src/plugins/adl/ip6_allowlist.c
+++ b/src/plugins/adl/ip6_allowlist.c
@@ -96,8 +96,8 @@ VLIB_NODE_FN (ip6_adl_allowlist_node) (vlib_main_t * vm,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
+ clib_prefetch_store (p2->data);
+ clib_prefetch_store (p3->data);
}
/* speculatively enqueue b0 and b1 to the current next frame */
diff --git a/src/plugins/adl/node.c b/src/plugins/adl/node.c
index 7dfaf3b2eb2..5578c13086a 100644
--- a/src/plugins/adl/node.c
+++ b/src/plugins/adl/node.c
@@ -88,8 +88,8 @@ VLIB_NODE_FN (adl_input_node) (vlib_main_t * vm,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
+ clib_prefetch_store (p2->data);
+ clib_prefetch_store (p3->data);
}
/* speculatively enqueue b0 and b1 to the current next frame */
diff --git a/src/plugins/avf/input.c b/src/plugins/avf/input.c
index 4d037b44a28..1406d789e0b 100644
--- a/src/plugins/avf/input.c
+++ b/src/plugins/avf/input.c
@@ -309,14 +309,10 @@ avf_device_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
if (next + 11 < size)
{
int stride = 8;
- CLIB_PREFETCH ((void *) (fd + (next + stride)),
- CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH ((void *) (fd + (next + stride + 1)),
- CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH ((void *) (fd + (next + stride + 2)),
- CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH ((void *) (fd + (next + stride + 3)),
- CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load ((void *) (fd + (next + stride)));
+ clib_prefetch_load ((void *) (fd + (next + stride + 1)));
+ clib_prefetch_load ((void *) (fd + (next + stride + 2)));
+ clib_prefetch_load ((void *) (fd + (next + stride + 3)));
}
#ifdef CLIB_HAVE_VEC256
@@ -375,8 +371,7 @@ avf_device_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
continue;
one_by_one:
#endif
- CLIB_PREFETCH ((void *) (fd + ((next + 8) & mask)),
- CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load ((void *) (fd + ((next + 8) & mask)));
if (avf_rxd_is_not_dd (d))
break;
diff --git a/src/plugins/cnat/cnat_session.c b/src/plugins/cnat/cnat_session.c
index bb04de07c82..216d2575c37 100644
--- a/src/plugins/cnat/cnat_session.c
+++ b/src/plugins/cnat/cnat_session.c
@@ -192,13 +192,13 @@ cnat_session_scan (vlib_main_t * vm, f64 start_time, int i)
{
BVT (clib_bihash_bucket) * b =
BV (clib_bihash_get_bucket) (h, i + 3);
- CLIB_PREFETCH (b, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b);
b = BV (clib_bihash_get_bucket) (h, i + 1);
if (!BV (clib_bihash_bucket_is_empty) (b))
{
BVT (clib_bihash_value) * v =
BV (clib_bihash_get_value) (h, b->offset);
- CLIB_PREFETCH (v, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (v);
}
}
diff --git a/src/plugins/crypto_sw_scheduler/main.c b/src/plugins/crypto_sw_scheduler/main.c
index 2842b18d70b..b0548fa297a 100644
--- a/src/plugins/crypto_sw_scheduler/main.c
+++ b/src/plugins/crypto_sw_scheduler/main.c
@@ -370,7 +370,7 @@ crypto_sw_scheduler_dequeue_aead (vlib_main_t * vm,
while (n_elts--)
{
if (n_elts > 1)
- CLIB_PREFETCH (fe + 1, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (fe + 1);
crypto_sw_scheduler_convert_aead (vm, ptd, fe, fe - f->elts, bi[0],
sync_op_id, aad_len, tag_len);
@@ -438,7 +438,7 @@ crypto_sw_scheduler_dequeue_link (vlib_main_t * vm,
while (n_elts--)
{
if (n_elts > 1)
- CLIB_PREFETCH (fe + 1, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (fe + 1);
crypto_sw_scheduler_convert_link_crypto (vm, ptd,
cm->keys + fe->key_index,
diff --git a/src/plugins/ct6/ct6_in2out.c b/src/plugins/ct6/ct6_in2out.c
index 39da7891c75..b8bda18370c 100644
--- a/src/plugins/ct6/ct6_in2out.c
+++ b/src/plugins/ct6/ct6_in2out.c
@@ -165,10 +165,10 @@ ct6_in2out_inline (vlib_main_t * vm,
vlib_prefetch_buffer_header (b[5], STORE);
vlib_prefetch_buffer_header (b[6], STORE);
vlib_prefetch_buffer_header (b[7], STORE);
- CLIB_PREFETCH (b[4]->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (b[5]->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (b[6]->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (b[7]->data, CLIB_CACHE_LINE_BYTES, STORE);
+ clib_prefetch_store (b[4]->data);
+ clib_prefetch_store (b[5]->data);
+ clib_prefetch_store (b[6]->data);
+ clib_prefetch_store (b[7]->data);
}
/* $$$$ process 4x pkts right here */
diff --git a/src/plugins/ct6/ct6_out2in.c b/src/plugins/ct6/ct6_out2in.c
index bbe9c2e293a..ebb6da56134 100644
--- a/src/plugins/ct6/ct6_out2in.c
+++ b/src/plugins/ct6/ct6_out2in.c
@@ -102,10 +102,10 @@ ct6_out2in_inline (vlib_main_t * vm,
vlib_prefetch_buffer_header (b[5], STORE);
vlib_prefetch_buffer_header (b[6], STORE);
vlib_prefetch_buffer_header (b[7], STORE);
- CLIB_PREFETCH (b[4]->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (b[5]->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (b[6]->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (b[7]->data, CLIB_CACHE_LINE_BYTES, STORE);
+ clib_prefetch_store (b[4]->data);
+ clib_prefetch_store (b[5]->data);
+ clib_prefetch_store (b[6]->data);
+ clib_prefetch_store (b[7]->data);
}
/* $$$$ process 4x pkts right here */
diff --git a/src/plugins/dns/reply_node.c b/src/plugins/dns/reply_node.c
index 5d7e735e885..b15943a6448 100644
--- a/src/plugins/dns/reply_node.c
+++ b/src/plugins/dns/reply_node.c
@@ -93,8 +93,8 @@ dns46_reply_node_fn (vlib_main_t * vm,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
+ clib_prefetch_store (p2->data);
+ clib_prefetch_store (p3->data);
}
/* speculatively enqueue b0 and b1 to the current next frame */
diff --git a/src/plugins/dns/request_node.c b/src/plugins/dns/request_node.c
index a80876927e9..72a76d12e4f 100644
--- a/src/plugins/dns/request_node.c
+++ b/src/plugins/dns/request_node.c
@@ -95,8 +95,8 @@ dns46_request_inline (vlib_main_t * vm,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
+ clib_prefetch_store (p2->data);
+ clib_prefetch_store (p3->data);
}
/* speculatively enqueue b0 and b1 to the current next frame */
diff --git a/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c b/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c
index 86f8e041f9e..4545e24fc83 100644
--- a/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c
+++ b/src/plugins/dpdk/cryptodev/cryptodev_op_data_path.c
@@ -171,8 +171,8 @@ cryptodev_frame_linked_algs_enqueue (vlib_main_t *vm,
{
CLIB_PREFETCH (cop[1], CLIB_CACHE_LINE_BYTES * 3, STORE);
CLIB_PREFETCH (cop[2], CLIB_CACHE_LINE_BYTES * 3, STORE);
- CLIB_PREFETCH (&fe[1], CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&fe[2], CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&fe[1]);
+ clib_prefetch_load (&fe[2]);
}
if (last_key_index != fe->key_index)
{
@@ -288,8 +288,8 @@ cryptodev_frame_aead_enqueue (vlib_main_t *vm,
{
CLIB_PREFETCH (cop[1], CLIB_CACHE_LINE_BYTES * 3, STORE);
CLIB_PREFETCH (cop[2], CLIB_CACHE_LINE_BYTES * 3, STORE);
- CLIB_PREFETCH (&fe[1], CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&fe[2], CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&fe[1]);
+ clib_prefetch_load (&fe[2]);
}
if (last_key_index != fe->key_index)
{
diff --git a/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c b/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c
index c045d78ecb1..41a1e0c2a09 100644
--- a/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c
+++ b/src/plugins/dpdk/cryptodev/cryptodev_raw_data_path.c
@@ -144,8 +144,8 @@ cryptodev_frame_linked_algs_enqueue (vlib_main_t *vm,
if (n_elts > 2)
{
- CLIB_PREFETCH (&fe[1], CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&fe[2], CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&fe[1]);
+ clib_prefetch_load (&fe[2]);
vlib_prefetch_buffer_header (b[1], LOAD);
vlib_prefetch_buffer_header (b[2], LOAD);
}
@@ -275,7 +275,7 @@ cryptodev_raw_aead_enqueue (vlib_main_t *vm, vnet_crypto_async_frame_t *frame,
if (n_elts > 1)
{
- CLIB_PREFETCH (&fe[1], CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&fe[1]);
vlib_prefetch_buffer_header (b[1], LOAD);
}
@@ -449,8 +449,8 @@ cryptodev_raw_dequeue (vlib_main_t *vm, u32 *nb_elts_processed,
vnet_crypto_async_frame_t *f1, *f2;
GET_RING_OBJ (cet->cached_frame, i + 1, f1);
GET_RING_OBJ (cet->cached_frame, i + 2, f2);
- CLIB_PREFETCH (f1, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (f2, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (f1);
+ clib_prefetch_load (f2);
}
n_left = f->state & 0x7f;
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c
index 6d130a95e9c..7c083e1dcf4 100644
--- a/src/plugins/dpdk/device/device.c
+++ b/src/plugins/dpdk/device/device.c
@@ -212,7 +212,7 @@ dpdk_prefetch_buffer (vlib_main_t * vm, struct rte_mbuf *mb)
{
vlib_buffer_t *b = vlib_buffer_from_rte_mbuf (mb);
CLIB_PREFETCH (mb, sizeof (struct rte_mbuf), STORE);
- CLIB_PREFETCH (b, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b);
}
static_always_inline void
@@ -357,12 +357,12 @@ VNET_DEVICE_CLASS_TX_FN (dpdk_device_class) (vlib_main_t * vm,
vlib_buffer_t *b2, *b3;
u32 or_flags;
- CLIB_PREFETCH (mb[2], CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (mb[3], CLIB_CACHE_LINE_BYTES, STORE);
+ clib_prefetch_store (mb[2]);
+ clib_prefetch_store (mb[3]);
b2 = vlib_buffer_from_rte_mbuf (mb[2]);
- CLIB_PREFETCH (b2, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b2);
b3 = vlib_buffer_from_rte_mbuf (mb[3]);
- CLIB_PREFETCH (b3, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b3);
b[0] = vlib_buffer_from_rte_mbuf (mb[0]);
b[1] = vlib_buffer_from_rte_mbuf (mb[1]);
diff --git a/src/plugins/dpdk/device/node.c b/src/plugins/dpdk/device/node.c
index 98cda4c452f..25222856912 100644
--- a/src/plugins/dpdk/device/node.c
+++ b/src/plugins/dpdk/device/node.c
@@ -86,10 +86,10 @@ dpdk_process_subseq_segs (vlib_main_t * vm, vlib_buffer_t * b,
static_always_inline void
dpdk_prefetch_mbuf_x4 (struct rte_mbuf *mb[])
{
- CLIB_PREFETCH (mb[0], CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (mb[1], CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (mb[2], CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (mb[3], CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (mb[0]);
+ clib_prefetch_load (mb[1]);
+ clib_prefetch_load (mb[2]);
+ clib_prefetch_load (mb[3]);
}
static_always_inline void
@@ -97,13 +97,13 @@ dpdk_prefetch_buffer_x4 (struct rte_mbuf *mb[])
{
vlib_buffer_t *b;
b = vlib_buffer_from_rte_mbuf (mb[0]);
- CLIB_PREFETCH (b, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b);
b = vlib_buffer_from_rte_mbuf (mb[1]);
- CLIB_PREFETCH (b, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b);
b = vlib_buffer_from_rte_mbuf (mb[2]);
- CLIB_PREFETCH (b, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b);
b = vlib_buffer_from_rte_mbuf (mb[3]);
- CLIB_PREFETCH (b, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b);
}
/** \brief Main DPDK input node
diff --git a/src/plugins/flowprobe/node.c b/src/plugins/flowprobe/node.c
index ab3640ca135..e7a39a7ed7e 100644
--- a/src/plugins/flowprobe/node.c
+++ b/src/plugins/flowprobe/node.c
@@ -755,8 +755,8 @@ flowprobe_node_fn (vlib_main_t * vm,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
+ clib_prefetch_store (p2->data);
+ clib_prefetch_store (p3->data);
}
/* speculatively enqueue b0 and b1 to the current next frame */
diff --git a/src/plugins/memif/device.c b/src/plugins/memif/device.c
index fce4ab22004..fc66420a6ad 100644
--- a/src/plugins/memif/device.c
+++ b/src/plugins/memif/device.c
@@ -143,8 +143,7 @@ retry:
u32 saved_ptd_buffers_len = _vec_len (ptd->buffers);
u16 saved_slot = slot;
- CLIB_PREFETCH (&ring->desc[(slot + 8) & mask], CLIB_CACHE_LINE_BYTES,
- LOAD);
+ clib_prefetch_load (&ring->desc[(slot + 8) & mask]);
d0 = &ring->desc[slot & mask];
if (PREDICT_FALSE (last_region != d0->region))
@@ -235,10 +234,10 @@ no_free_slots:
co = ptd->copy_ops;
while (n_copy_op >= 8)
{
- CLIB_PREFETCH (co[4].data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (co[5].data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (co[6].data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (co[7].data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (co[4].data);
+ clib_prefetch_load (co[5].data);
+ clib_prefetch_load (co[6].data);
+ clib_prefetch_load (co[7].data);
b0 = vlib_get_buffer (vm, ptd->buffers[co[0].buffer_vec_index]);
b1 = vlib_get_buffer (vm, ptd->buffers[co[1].buffer_vec_index]);
@@ -315,8 +314,7 @@ retry:
memif_desc_t *d0;
u32 bi0;
- CLIB_PREFETCH (&ring->desc[(slot + 8) & mask], CLIB_CACHE_LINE_BYTES,
- STORE);
+ clib_prefetch_store (&ring->desc[(slot + 8) & mask]);
if (PREDICT_TRUE (n_left >= 4))
vlib_prefetch_buffer_header (vlib_get_buffer (vm, buffers[3]), LOAD);
diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c
index a69ab7f7c2c..8bb3758c5fd 100644
--- a/src/plugins/memif/node.c
+++ b/src/plugins/memif/node.c
@@ -207,8 +207,7 @@ memif_device_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
dst_off = start_offset;
next_slot:
- CLIB_PREFETCH (&ring->desc[(cur_slot + 8) & mask],
- CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&ring->desc[(cur_slot + 8) & mask]);
s0 = cur_slot & mask;
d0 = &ring->desc[s0];
n_bytes_left = d0->length;
@@ -277,10 +276,10 @@ memif_device_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
co = ptd->copy_ops;
while (n_left >= 8)
{
- CLIB_PREFETCH (co[4].data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (co[5].data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (co[6].data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (co[7].data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (co[4].data);
+ clib_prefetch_load (co[5].data);
+ clib_prefetch_load (co[6].data);
+ clib_prefetch_load (co[7].data);
b0 = vlib_get_buffer (vm, ptd->buffers[co[0].buffer_vec_index]);
b1 = vlib_get_buffer (vm, ptd->buffers[co[1].buffer_vec_index]);
@@ -574,8 +573,7 @@ memif_device_input_zc_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
bi0 = mq->buffers[s0];
ptd->buffers[n_rx_packets++] = bi0;
- CLIB_PREFETCH (&ring->desc[(cur_slot + 8) & mask],
- CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&ring->desc[(cur_slot + 8) & mask]);
d0 = &ring->desc[s0];
hb = b0 = vlib_get_buffer (vm, bi0);
b0->current_data = start_offset;
diff --git a/src/plugins/nat/det44/det44_in2out.c b/src/plugins/nat/det44/det44_in2out.c
index 0857ca18886..5fe4a9a0658 100644
--- a/src/plugins/nat/det44/det44_in2out.c
+++ b/src/plugins/nat/det44/det44_in2out.c
@@ -451,8 +451,8 @@ VLIB_NODE_FN (det44_in2out_node) (vlib_main_t * vm,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (p2->data);
+ clib_prefetch_load (p3->data);
}
next0 = DET44_IN2OUT_NEXT_LOOKUP;
diff --git a/src/plugins/nat/det44/det44_out2in.c b/src/plugins/nat/det44/det44_out2in.c
index 48b816bca56..111bc61c476 100644
--- a/src/plugins/nat/det44/det44_out2in.c
+++ b/src/plugins/nat/det44/det44_out2in.c
@@ -415,8 +415,8 @@ VLIB_NODE_FN (det44_out2in_node) (vlib_main_t * vm,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (p2->data);
+ clib_prefetch_load (p3->data);
}
diff --git a/src/plugins/nat/nat44-ed/nat44_ed_handoff.c b/src/plugins/nat/nat44-ed/nat44_ed_handoff.c
index 52d52b4e65c..918d7728c1d 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed_handoff.c
+++ b/src/plugins/nat/nat44-ed/nat44_ed_handoff.c
@@ -112,10 +112,10 @@ nat44_worker_handoff_fn_inline (vlib_main_t * vm,
vlib_prefetch_buffer_header (b[5], LOAD);
vlib_prefetch_buffer_header (b[6], LOAD);
vlib_prefetch_buffer_header (b[7], LOAD);
- CLIB_PREFETCH (&b[4]->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&b[5]->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&b[6]->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&b[7]->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&b[4]->data);
+ clib_prefetch_load (&b[5]->data);
+ clib_prefetch_load (&b[6]->data);
+ clib_prefetch_load (&b[7]->data);
}
if (is_output)
diff --git a/src/plugins/nat/nat44-ed/nat44_ed_in2out.c b/src/plugins/nat/nat44-ed/nat44_ed_in2out.c
index 523d26257bf..bfabdbd71d0 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed_in2out.c
+++ b/src/plugins/nat/nat44-ed/nat44_ed_in2out.c
@@ -1010,7 +1010,7 @@ nat44_ed_in2out_fast_path_node_fn_inline (vlib_main_t *vm,
vlib_prefetch_buffer_header (p2, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (p2->data);
}
if (is_output_feature)
diff --git a/src/plugins/nat/nat44-ed/nat44_ed_inlines.h b/src/plugins/nat/nat44-ed/nat44_ed_inlines.h
index 680bdef1f9f..0d75e736849 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed_inlines.h
+++ b/src/plugins/nat/nat44-ed/nat44_ed_inlines.h
@@ -638,8 +638,8 @@ nat_pre_node_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (p2->data);
+ clib_prefetch_load (p3->data);
}
next0 = def_next;
diff --git a/src/plugins/nat/nat44-ed/nat44_ed_out2in.c b/src/plugins/nat/nat44-ed/nat44_ed_out2in.c
index 995260a2499..eaf89937e54 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed_out2in.c
+++ b/src/plugins/nat/nat44-ed/nat44_ed_out2in.c
@@ -838,7 +838,7 @@ nat44_ed_out2in_fast_path_node_fn_inline (vlib_main_t * vm,
vlib_prefetch_buffer_header (p2, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (p2->data);
}
next[0] = vnet_buffer2 (b0)->nat.arc_next;
diff --git a/src/plugins/nat/nat44-ei/nat44_ei_handoff.c b/src/plugins/nat/nat44-ei/nat44_ei_handoff.c
index 567f53915d2..c7a1317026b 100644
--- a/src/plugins/nat/nat44-ei/nat44_ei_handoff.c
+++ b/src/plugins/nat/nat44-ei/nat44_ei_handoff.c
@@ -108,10 +108,10 @@ nat44_ei_worker_handoff_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
vlib_prefetch_buffer_header (b[5], LOAD);
vlib_prefetch_buffer_header (b[6], LOAD);
vlib_prefetch_buffer_header (b[7], LOAD);
- CLIB_PREFETCH (&b[4]->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&b[5]->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&b[6]->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&b[7]->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&b[4]->data);
+ clib_prefetch_load (&b[5]->data);
+ clib_prefetch_load (&b[6]->data);
+ clib_prefetch_load (&b[7]->data);
}
if (is_output)
diff --git a/src/plugins/nat/nat44-ei/nat44_ei_in2out.c b/src/plugins/nat/nat44-ei/nat44_ei_in2out.c
index 42923aa0f77..7ac1a92a61b 100644
--- a/src/plugins/nat/nat44-ei/nat44_ei_in2out.c
+++ b/src/plugins/nat/nat44-ei/nat44_ei_in2out.c
@@ -964,8 +964,8 @@ nat44_ei_in2out_node_fn_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (p2->data);
+ clib_prefetch_load (p3->data);
}
if (is_output_feature)
diff --git a/src/plugins/nat/nat44-ei/nat44_ei_out2in.c b/src/plugins/nat/nat44-ei/nat44_ei_out2in.c
index 1f04ba056b5..7796b11cfd7 100644
--- a/src/plugins/nat/nat44-ei/nat44_ei_out2in.c
+++ b/src/plugins/nat/nat44-ei/nat44_ei_out2in.c
@@ -758,8 +758,8 @@ VLIB_NODE_FN (nat44_ei_out2in_node)
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (p2->data);
+ clib_prefetch_load (p3->data);
}
vnet_buffer (b0)->snat.flags = 0;
diff --git a/src/plugins/nsim/nsim_input.c b/src/plugins/nsim/nsim_input.c
index 1976d051df7..65a7ae11251 100644
--- a/src/plugins/nsim/nsim_input.c
+++ b/src/plugins/nsim/nsim_input.c
@@ -94,7 +94,7 @@ nsim_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
{
/* prefetch one line / 2 entries ahead */
if ((((uword) ep) & (CLIB_CACHE_LINE_BYTES - 1)) == 0)
- CLIB_PREFETCH ((ep + 2), CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load ((ep + 2));
ep = wp->entries + wp->head;
from[0] = ep->buffer_index;
diff --git a/src/plugins/rdma/input.c b/src/plugins/rdma/input.c
index df101e544bd..f1c508affa2 100644
--- a/src/plugins/rdma/input.c
+++ b/src/plugins/rdma/input.c
@@ -389,10 +389,10 @@ rdma_device_input_bufs (vlib_main_t * vm, const rdma_device_t * rd,
{
if (PREDICT_TRUE (n_left_from >= 8))
{
- CLIB_PREFETCH (&wc[4 + 0], CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&wc[4 + 1], CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&wc[4 + 2], CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (&wc[4 + 3], CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&wc[4 + 0]);
+ clib_prefetch_load (&wc[4 + 1]);
+ clib_prefetch_load (&wc[4 + 2]);
+ clib_prefetch_load (&wc[4 + 3]);
vlib_prefetch_buffer_header (b[4 + 0], STORE);
vlib_prefetch_buffer_header (b[4 + 1], STORE);
vlib_prefetch_buffer_header (b[4 + 2], STORE);
diff --git a/src/plugins/unittest/mpcap_node.c b/src/plugins/unittest/mpcap_node.c
index f3c24843d82..083c22e32df 100644
--- a/src/plugins/unittest/mpcap_node.c
+++ b/src/plugins/unittest/mpcap_node.c
@@ -116,10 +116,10 @@ mpcap_inline (vlib_main_t * vm,
vlib_prefetch_buffer_header (b[5], STORE);
vlib_prefetch_buffer_header (b[6], STORE);
vlib_prefetch_buffer_header (b[7], STORE);
- CLIB_PREFETCH (b[4]->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (b[5]->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (b[6]->data, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (b[7]->data, CLIB_CACHE_LINE_BYTES, STORE);
+ clib_prefetch_store (b[4]->data);
+ clib_prefetch_store (b[5]->data);
+ clib_prefetch_store (b[6]->data);
+ clib_prefetch_store (b[7]->data);
}
next[0] = 0;