summaryrefslogtreecommitdiffstats
path: root/vlib-api
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-03-13 02:22:06 +0100
committerDamjan Marion <damarion@cisco.com>2016-04-22 17:29:47 +0200
commitf1213b82771ce929c076339c24a777cfd59690e6 (patch)
tree3c74305e8848047d8ccd1228ee511d57cbf1b1a6 /vlib-api
parent2b836cf4d1e4e59ca34229a9fdf49d79216da20e (diff)
Add clib_memcpy macro based on DPDK rte_memcpy implementation
Change-Id: I22cb443c4bd0bf298abb6f06e8e4ca65a44a2854 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vlib-api')
-rw-r--r--vlib-api/vlibapi/api_shared.c6
-rw-r--r--vlib-api/vlibmemory/memory_vlib.c4
-rw-r--r--vlib-api/vlibmemory/unix_shared_memory_queue.c10
-rw-r--r--vlib-api/vlibsocket/socksvr_vlib.c2
4 files changed, 11 insertions, 11 deletions
diff --git a/vlib-api/vlibapi/api_shared.c b/vlib-api/vlibapi/api_shared.c
index 8b8698b175d..308f0028e25 100644
--- a/vlib-api/vlibapi/api_shared.c
+++ b/vlib-api/vlibapi/api_shared.c
@@ -102,7 +102,7 @@ void vl_msg_api_trace(api_main_t *am, vl_api_trace_t *tp, void *msg)
}
vec_validate(msg_copy, cfgp->size - 1);
- memcpy(msg_copy, msg, cfgp->size);
+ clib_memcpy(msg_copy, msg, cfgp->size);
*this_trace = msg_copy;
}
@@ -772,7 +772,7 @@ static void vl_msg_api_process_file (vlib_main_t *vm, u8 *filename,
/* Copy the buffer (from the read-only mmap'ed file) */
vec_validate (tmpbuf, size-1 + sizeof(uword));
- memcpy (tmpbuf+sizeof(uword), msg, size);
+ clib_memcpy (tmpbuf+sizeof(uword), msg, size);
memset (tmpbuf, 0xf, sizeof(uword));
/*
@@ -870,7 +870,7 @@ static void vl_msg_api_process_file (vlib_main_t *vm, u8 *filename,
}
if (saved_print_handlers) {
- memcpy (am->msg_print_handlers, saved_print_handlers,
+ clib_memcpy (am->msg_print_handlers, saved_print_handlers,
vec_len(am->msg_print_handlers) * sizeof (void *));
vec_free (saved_print_handlers);
}
diff --git a/vlib-api/vlibmemory/memory_vlib.c b/vlib-api/vlibmemory/memory_vlib.c
index 8aa0fe4a20d..0cac49d7997 100644
--- a/vlib-api/vlibmemory/memory_vlib.c
+++ b/vlib-api/vlibmemory/memory_vlib.c
@@ -422,7 +422,7 @@ memclnt_process (vlib_main_t * vm,
}
headp = (i8 *) (q->data + sizeof(uword)*q->head);
- memcpy (&mp, headp, sizeof(uword));
+ clib_memcpy (&mp, headp, sizeof(uword));
q->head++;
need_broadcast = (q->cursize == q->maxsize/2);
@@ -1174,7 +1174,7 @@ void vl_api_rpc_call_main_thread (void *fp, u8 * data, u32 data_length)
mp = vl_msg_api_alloc_as_if_client (sizeof (*mp) + data_length);
memset (mp, 0, sizeof (*mp));
- memcpy (mp->data, data, data_length);
+ clib_memcpy (mp->data, data, data_length);
mp->_vl_msg_id = ntohs (VL_API_RPC_CALL);
mp->function = pointer_to_uword(fp);
mp->need_barrier_sync = 1;
diff --git a/vlib-api/vlibmemory/unix_shared_memory_queue.c b/vlib-api/vlibmemory/unix_shared_memory_queue.c
index 62fb240cc6c..b8182658f65 100644
--- a/vlib-api/vlibmemory/unix_shared_memory_queue.c
+++ b/vlib-api/vlibmemory/unix_shared_memory_queue.c
@@ -134,7 +134,7 @@ int unix_shared_memory_queue_add_nolock (unix_shared_memory_queue_t *q,
}
tailp = (i8 *)(&q->data[0] + q->elsize*q->tail);
- memcpy(tailp, elem, q->elsize);
+ clib_memcpy(tailp, elem, q->elsize);
q->tail++;
q->cursize++;
@@ -163,7 +163,7 @@ int unix_shared_memory_queue_add_raw (unix_shared_memory_queue_t *q,
}
tailp = (i8 *)(&q->data[0] + q->elsize*q->tail);
- memcpy(tailp, elem, q->elsize);
+ clib_memcpy(tailp, elem, q->elsize);
q->tail++;
q->cursize++;
@@ -202,7 +202,7 @@ int unix_shared_memory_queue_add (unix_shared_memory_queue_t *q,
}
tailp = (i8 *)(&q->data[0] + q->elsize*q->tail);
- memcpy(tailp, elem, q->elsize);
+ clib_memcpy(tailp, elem, q->elsize);
q->tail++;
q->cursize++;
@@ -250,7 +250,7 @@ int unix_shared_memory_queue_sub(unix_shared_memory_queue_t *q,
}
headp = (i8 *)(&q->data[0] + q->elsize*q->head);
- memcpy(elem, headp, q->elsize);
+ clib_memcpy(elem, headp, q->elsize);
q->head++;
if (q->cursize == q->maxsize)
@@ -280,7 +280,7 @@ int unix_shared_memory_queue_sub_raw (unix_shared_memory_queue_t *q,
}
headp = (i8 *)(&q->data[0] + q->elsize*q->head);
- memcpy(elem, headp, q->elsize);
+ clib_memcpy(elem, headp, q->elsize);
q->head++;
q->cursize--;
diff --git a/vlib-api/vlibsocket/socksvr_vlib.c b/vlib-api/vlibsocket/socksvr_vlib.c
index 91dff22f631..d65646acf39 100644
--- a/vlib-api/vlibsocket/socksvr_vlib.c
+++ b/vlib-api/vlibsocket/socksvr_vlib.c
@@ -301,7 +301,7 @@ clib_error_t * vl_socket_read_ready (unix_file_t * uf)
if (msg_buffer == socket_main.input_buffer) {
ASSERT(vec_len(rp->unprocessed_input) == 0);
vec_validate (rp->unprocessed_input, vec_len (msg_buffer)-1);
- memcpy (rp->unprocessed_input, msg_buffer, vec_len(msg_buffer));
+ clib_memcpy (rp->unprocessed_input, msg_buffer, vec_len(msg_buffer));
_vec_len (rp->unprocessed_input) = vec_len (msg_buffer);
}
_vec_len(socket_main.input_buffer) = save_input_buffer_length;