From 767a9ab4b1f77760a633ba3de30a0dcad44cb4b1 Mon Sep 17 00:00:00 2001 From: Leyi Rong Date: Wed, 8 Mar 2023 13:34:56 +0800 Subject: vlib: 512-bit SIMD version of vlib_buffer_free Process 8 packets perf batch in vlib_buffer_free_inline() when CLIB_HAVE_VEC512 is enabled. Type: improvement Signed-off-by: Leyi Rong Change-Id: I78b8a525bce25ee355c9bf0e0f651698a8c45bda --- src/vppinfra/vector/index_to_ptr.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/vppinfra') diff --git a/src/vppinfra/vector/index_to_ptr.h b/src/vppinfra/vector/index_to_ptr.h index 91de3546439..3985b757d54 100644 --- a/src/vppinfra/vector/index_to_ptr.h +++ b/src/vppinfra/vector/index_to_ptr.h @@ -92,7 +92,7 @@ clib_index_to_ptr_u32 (u32 *indices, void *base, u8 shift, void **ptrs, indices += 16; n_elts -= 16; } - if (n_elts > 8) + if (n_elts >= 8) { b0 = u64x8_from_u32x8 (u32x8_load_unaligned (indices)); u64x8_store_unaligned ((b0 << shift) + off, ptrs); @@ -101,6 +101,9 @@ clib_index_to_ptr_u32 (u32 *indices, void *base, u8 shift, void **ptrs, n_elts -= 8; } + if (n_elts == 0) + return; + b0 = u64x8_from_u32x8 (u32x8_load_unaligned (indices + n_elts - 8)); u64x8_store_unaligned ((b0 << shift) + off, ptrs + n_elts - 8); } -- cgit 1.2.3-korg