misc: replace CLIB_PREFETCH with clib_prefetch_{load,store}
Type: refactor
Change-Id: Id10cbf52e8f2dd809080a228d8fa282308be84ac
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vnet/devices/pipe/pipe.c b/src/vnet/devices/pipe/pipe.c
index ec50f63..eb92b3c 100644
--- a/src/vnet/devices/pipe/pipe.c
+++ b/src/vnet/devices/pipe/pipe.c
@@ -324,8 +324,8 @@
p3 = vlib_get_buffer (vm, from[3]);
vlib_prefetch_buffer_header (p2, STORE);
vlib_prefetch_buffer_header (p3, STORE);
- 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);
}
bi0 = from[0];
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c
index 6abc1fc..bdb3d27 100644
--- a/src/vnet/devices/virtio/vhost_user_input.c
+++ b/src/vnet/devices/virtio/vhost_user_input.c
@@ -163,8 +163,8 @@
(!(src3 = map_guest_mem (vui, cpy[3].src, map_hint))))
return 1;
- CLIB_PREFETCH (src2, 64, LOAD);
- CLIB_PREFETCH (src3, 64, LOAD);
+ clib_prefetch_load (src2);
+ clib_prefetch_load (src3);
clib_memcpy_fast ((void *) cpy[0].dst, src0, cpy[0].len);
clib_memcpy_fast ((void *) cpy[1].dst, src1, cpy[1].len);
@@ -872,10 +872,10 @@
bad = (src4 == 0) + (src5 == 0) + (src6 == 0) + (src7 == 0);
if (PREDICT_FALSE (bad))
goto one_by_one;
- CLIB_PREFETCH (src4, 64, LOAD);
- CLIB_PREFETCH (src5, 64, LOAD);
- CLIB_PREFETCH (src6, 64, LOAD);
- CLIB_PREFETCH (src7, 64, LOAD);
+ clib_prefetch_load (src4);
+ clib_prefetch_load (src5);
+ clib_prefetch_load (src6);
+ clib_prefetch_load (src7);
while (PREDICT_TRUE (copy_len >= 8))
{
@@ -892,10 +892,10 @@
if (PREDICT_FALSE (bad))
break;
- CLIB_PREFETCH (src4, 64, LOAD);
- CLIB_PREFETCH (src5, 64, LOAD);
- CLIB_PREFETCH (src6, 64, LOAD);
- CLIB_PREFETCH (src7, 64, LOAD);
+ clib_prefetch_load (src4);
+ clib_prefetch_load (src5);
+ clib_prefetch_load (src6);
+ clib_prefetch_load (src7);
clib_memcpy_fast ((void *) cpy[0].dst, src0, cpy[0].len);
clib_memcpy_fast ((void *) cpy[1].dst, src1, cpy[1].len);
diff --git a/src/vnet/devices/virtio/vhost_user_output.c b/src/vnet/devices/virtio/vhost_user_output.c
index 59ea810..40faefa 100644
--- a/src/vnet/devices/virtio/vhost_user_output.c
+++ b/src/vnet/devices/virtio/vhost_user_output.c
@@ -194,8 +194,8 @@
(!(dst3 = map_guest_mem (vui, cpy[3].dst, map_hint))))
return 1;
- CLIB_PREFETCH ((void *) cpy[2].src, 64, LOAD);
- CLIB_PREFETCH ((void *) cpy[3].src, 64, LOAD);
+ clib_prefetch_load ((void *) cpy[2].src);
+ clib_prefetch_load ((void *) cpy[3].src);
clib_memcpy_fast (dst0, (void *) cpy[0].src, cpy[0].len);
clib_memcpy_fast (dst1, (void *) cpy[1].src, cpy[1].len);
@@ -601,7 +601,7 @@
buffer_map_addr += cpy->len;
desc_len += cpy->len;
- CLIB_PREFETCH (&rxvq->packed_desc, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&rxvq->packed_desc);
/* Check if vlib buffer has more data. If not, get more or break */
if (PREDICT_TRUE (!bytes_left))
@@ -922,7 +922,7 @@
buffer_map_addr += cpy->len;
desc_len += cpy->len;
- CLIB_PREFETCH (&rxvq->desc, CLIB_CACHE_LINE_BYTES, LOAD);
+ clib_prefetch_load (&rxvq->desc);
}
// Check if vlib buffer has more data. If not, get more or break.