summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
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/vnet/ip
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/vnet/ip')
-rw-r--r--src/vnet/ip/icmp4.c2
-rw-r--r--src/vnet/ip/ip4_forward.c12
-rw-r--r--src/vnet/ip/ip6_forward.c4
-rw-r--r--src/vnet/ip/ip6_hop_by_hop.c12
-rw-r--r--src/vnet/ip/ip_in_out_acl.c4
-rw-r--r--src/vnet/ip/reass/ip4_sv_reass.c4
6 files changed, 19 insertions, 19 deletions
diff --git a/src/vnet/ip/icmp4.c b/src/vnet/ip/icmp4.c
index 05262e6f8e4..0363092d5d5 100644
--- a/src/vnet/ip/icmp4.c
+++ b/src/vnet/ip/icmp4.c
@@ -176,7 +176,7 @@ ip4_icmp_input (vlib_main_t * vm,
vlib_prefetch_buffer_with_index (vm, from[2], LOAD);
p0 = vlib_get_buffer (vm, from[1]);
ip0 = vlib_buffer_get_current (p0);
- CLIB_PREFETCH (ip0, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (ip0);
}
bi0 = to_next[0] = from[0];
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index 36f05a27820..750b75ffcff 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -1762,8 +1762,8 @@ ip4_local_inline (vlib_main_t * vm,
vlib_prefetch_buffer_header (b[4], LOAD);
vlib_prefetch_buffer_header (b[5], LOAD);
- CLIB_PREFETCH (b[4]->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (b[5]->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b[4]->data);
+ clib_prefetch_load (b[5]->data);
}
error[0] = error[1] = IP4_ERROR_UNKNOWN_PROTOCOL;
@@ -2148,12 +2148,12 @@ ip4_rewrite_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
vnet_buffer (b[1])->ip.save_rewrite_length = rw_len1;
p = vlib_buffer_get_current (b[2]);
- CLIB_PREFETCH (p - CLIB_CACHE_LINE_BYTES, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (p, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_store (p - CLIB_CACHE_LINE_BYTES);
+ clib_prefetch_load (p);
p = vlib_buffer_get_current (b[3]);
- CLIB_PREFETCH (p - CLIB_CACHE_LINE_BYTES, CLIB_CACHE_LINE_BYTES, STORE);
- CLIB_PREFETCH (p, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_store (p - CLIB_CACHE_LINE_BYTES);
+ clib_prefetch_load (p);
/* Check MTU of outgoing interface. */
u16 ip0_len = clib_net_to_host_u16 (ip0->length);
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index fd742d6b3e2..ba616ebc7c7 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -1780,8 +1780,8 @@ ip6_rewrite_inline_with_gso (vlib_main_t * vm,
vlib_prefetch_buffer_header (p2, LOAD);
vlib_prefetch_buffer_header (p3, LOAD);
- CLIB_PREFETCH (p2->pre_data, 32, STORE);
- CLIB_PREFETCH (p3->pre_data, 32, STORE);
+ clib_prefetch_store (p2->pre_data);
+ clib_prefetch_store (p3->pre_data);
CLIB_PREFETCH (p2->data, sizeof (ip0[0]), STORE);
CLIB_PREFETCH (p3->data, sizeof (ip0[0]), STORE);
diff --git a/src/vnet/ip/ip6_hop_by_hop.c b/src/vnet/ip/ip6_hop_by_hop.c
index 9923b416b65..e66084c2c4d 100644
--- a/src/vnet/ip/ip6_hop_by_hop.c
+++ b/src/vnet/ip/ip6_hop_by_hop.c
@@ -620,8 +620,8 @@ VLIB_NODE_FN (ip6_pop_hop_by_hop_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 */
@@ -879,10 +879,10 @@ ip6_local_hop_by_hop_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);
}
/*
diff --git a/src/vnet/ip/ip_in_out_acl.c b/src/vnet/ip/ip_in_out_acl.c
index 2f73e1307dc..a5e652e1ee8 100644
--- a/src/vnet/ip/ip_in_out_acl.c
+++ b/src/vnet/ip/ip_in_out_acl.c
@@ -220,8 +220,8 @@ ip_in_out_acl_inline (vlib_main_t * vm,
vlib_prefetch_buffer_header (b[4], LOAD);
vlib_prefetch_buffer_header (b[5], LOAD);
- CLIB_PREFETCH (b[4]->data, CLIB_CACHE_LINE_BYTES, LOAD);
- CLIB_PREFETCH (b[5]->data, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (b[4]->data);
+ clib_prefetch_load (b[5]->data);
}
/* calculate hashes for b[2] & b[3] */
diff --git a/src/vnet/ip/reass/ip4_sv_reass.c b/src/vnet/ip/reass/ip4_sv_reass.c
index 43390eae2ab..9b3f1b98558 100644
--- a/src/vnet/ip/reass/ip4_sv_reass.c
+++ b/src/vnet/ip/reass/ip4_sv_reass.c
@@ -468,8 +468,8 @@ ip4_sv_reass_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);
}
ip4_header_t *ip0 =