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/plugins/adl/ip4_allowlist.c | 40 +++++++++++++++++++--------------------- src/plugins/adl/ip6_allowlist.c | 4 ++-- src/plugins/adl/node.c | 4 ++-- 3 files changed, 23 insertions(+), 25 deletions(-) (limited to 'src/plugins/adl') 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 */ -- cgit 1.2.3-korg