diff options
Diffstat (limited to 'src/svm/svm_fifo.c')
-rw-r--r-- | src/svm/svm_fifo.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/svm/svm_fifo.c b/src/svm/svm_fifo.c index 817cb8d2639..fb942a63d43 100644 --- a/src/svm/svm_fifo.c +++ b/src/svm/svm_fifo.c @@ -485,7 +485,7 @@ CLIB_MARCH_FN (svm_fifo_enqueue_nowait, int, svm_fifo_t * f, u32 max_bytes, first_copy_bytes = ((nitems - f->tail) < total_copy_bytes) ? (nitems - f->tail) : total_copy_bytes; - _clib_memcpy (&f->data[f->tail], copy_from_here, first_copy_bytes); + clib_memcpy_fast (&f->data[f->tail], copy_from_here, first_copy_bytes); f->tail += first_copy_bytes; f->tail = (f->tail == nitems) ? 0 : f->tail; @@ -493,8 +493,9 @@ CLIB_MARCH_FN (svm_fifo_enqueue_nowait, int, svm_fifo_t * f, u32 max_bytes, second_copy_bytes = total_copy_bytes - first_copy_bytes; if (second_copy_bytes) { - _clib_memcpy (&f->data[f->tail], copy_from_here + first_copy_bytes, - second_copy_bytes); + clib_memcpy_fast (&f->data[f->tail], + copy_from_here + first_copy_bytes, + second_copy_bytes); f->tail += second_copy_bytes; f->tail = (f->tail == nitems) ? 0 : f->tail; } @@ -571,8 +572,8 @@ CLIB_MARCH_FN (svm_fifo_enqueue_with_offset, int, svm_fifo_t * f, first_copy_bytes = ((nitems - normalized_offset) < total_copy_bytes) ? (nitems - normalized_offset) : total_copy_bytes; - _clib_memcpy (&f->data[normalized_offset], copy_from_here, - first_copy_bytes); + clib_memcpy_fast (&f->data[normalized_offset], copy_from_here, + first_copy_bytes); /* Number of bytes in second copy segment, if any */ second_copy_bytes = total_copy_bytes - first_copy_bytes; @@ -583,8 +584,8 @@ CLIB_MARCH_FN (svm_fifo_enqueue_with_offset, int, svm_fifo_t * f, ASSERT (normalized_offset == 0); - _clib_memcpy (&f->data[normalized_offset], - copy_from_here + first_copy_bytes, second_copy_bytes); + clib_memcpy_fast (&f->data[normalized_offset], + copy_from_here + first_copy_bytes, second_copy_bytes); } return (0); @@ -608,11 +609,11 @@ svm_fifo_overwrite_head (svm_fifo_t * f, u8 * data, u32 len) first_chunk = f->nitems - f->head; ASSERT (len <= f->nitems); if (len <= first_chunk) - _clib_memcpy (&f->data[f->head], data, len); + clib_memcpy_fast (&f->data[f->head], data, len); else { - _clib_memcpy (&f->data[f->head], data, first_chunk); - _clib_memcpy (&f->data[0], data + first_chunk, len - first_chunk); + clib_memcpy_fast (&f->data[f->head], data, first_chunk); + clib_memcpy_fast (&f->data[0], data + first_chunk, len - first_chunk); } } #endif @@ -638,7 +639,7 @@ CLIB_MARCH_FN (svm_fifo_dequeue_nowait, int, svm_fifo_t * f, u32 max_bytes, /* Number of bytes in first copy segment */ first_copy_bytes = ((nitems - f->head) < total_copy_bytes) ? (nitems - f->head) : total_copy_bytes; - _clib_memcpy (copy_here, &f->data[f->head], first_copy_bytes); + clib_memcpy_fast (copy_here, &f->data[f->head], first_copy_bytes); f->head += first_copy_bytes; f->head = (f->head == nitems) ? 0 : f->head; @@ -646,8 +647,8 @@ CLIB_MARCH_FN (svm_fifo_dequeue_nowait, int, svm_fifo_t * f, u32 max_bytes, second_copy_bytes = total_copy_bytes - first_copy_bytes; if (second_copy_bytes) { - _clib_memcpy (copy_here + first_copy_bytes, - &f->data[f->head], second_copy_bytes); + clib_memcpy_fast (copy_here + first_copy_bytes, + &f->data[f->head], second_copy_bytes); f->head += second_copy_bytes; f->head = (f->head == nitems) ? 0 : f->head; } @@ -705,14 +706,14 @@ CLIB_MARCH_FN (svm_fifo_peek, int, svm_fifo_t * f, u32 relative_offset, first_copy_bytes = ((nitems - real_head) < total_copy_bytes) ? (nitems - real_head) : total_copy_bytes; - _clib_memcpy (copy_here, &f->data[real_head], first_copy_bytes); + clib_memcpy_fast (copy_here, &f->data[real_head], first_copy_bytes); /* Number of bytes in second copy segment, if any */ second_copy_bytes = total_copy_bytes - first_copy_bytes; if (second_copy_bytes) { - _clib_memcpy (copy_here + first_copy_bytes, &f->data[0], - second_copy_bytes); + clib_memcpy_fast (copy_here + first_copy_bytes, &f->data[0], + second_copy_bytes); } } return total_copy_bytes; |