X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Fbuffer_node.h;h=bff7a78cb94fda6a8291bf61443fc49c3bca1aab;hb=0c4fec0134f32bc913299b37d048a99293b1a851;hp=93ffb1e9dce8f1f8927cd6f55d9ca9b4e25493da;hpb=78fd7e810c24b9d638ac7c7f08edabf692543743;p=vpp.git diff --git a/src/vlib/buffer_node.h b/src/vlib/buffer_node.h index 93ffb1e9dce..bff7a78cb94 100644 --- a/src/vlib/buffer_node.h +++ b/src/vlib/buffer_node.h @@ -366,10 +366,15 @@ vlib_buffer_enqueue_to_next (vlib_main_t * vm, vlib_node_runtime_t * node, n_enqueued = count_trailing_zeros (~bitmap) / 2; #else u16 x = 0; - x |= next_index ^ nexts[1]; - x |= next_index ^ nexts[2]; - x |= next_index ^ nexts[3]; - n_enqueued = (x == 0) ? 4 : 1; + if (count + 3 < max) + { + x |= next_index ^ nexts[1]; + x |= next_index ^ nexts[2]; + x |= next_index ^ nexts[3]; + n_enqueued = (x == 0) ? 4 : 1; + } + else + n_enqueued = 1; #endif if (PREDICT_FALSE (n_enqueued > max)) @@ -378,7 +383,7 @@ vlib_buffer_enqueue_to_next (vlib_main_t * vm, vlib_node_runtime_t * node, #ifdef CLIB_HAVE_VEC512 if (n_enqueued >= 32) { - clib_memcpy (to_next, buffers, 32 * sizeof (u32)); + clib_memcpy_fast (to_next, buffers, 32 * sizeof (u32)); nexts += 32; to_next += 32; buffers += 32; @@ -392,7 +397,7 @@ vlib_buffer_enqueue_to_next (vlib_main_t * vm, vlib_node_runtime_t * node, #ifdef CLIB_HAVE_VEC256 if (n_enqueued >= 16) { - clib_memcpy (to_next, buffers, 16 * sizeof (u32)); + clib_memcpy_fast (to_next, buffers, 16 * sizeof (u32)); nexts += 16; to_next += 16; buffers += 16; @@ -406,7 +411,7 @@ vlib_buffer_enqueue_to_next (vlib_main_t * vm, vlib_node_runtime_t * node, #ifdef CLIB_HAVE_VEC128 if (n_enqueued >= 8) { - clib_memcpy (to_next, buffers, 8 * sizeof (u32)); + clib_memcpy_fast (to_next, buffers, 8 * sizeof (u32)); nexts += 8; to_next += 8; buffers += 8; @@ -419,7 +424,7 @@ vlib_buffer_enqueue_to_next (vlib_main_t * vm, vlib_node_runtime_t * node, if (n_enqueued >= 4) { - clib_memcpy (to_next, buffers, 4 * sizeof (u32)); + clib_memcpy_fast (to_next, buffers, 4 * sizeof (u32)); nexts += 4; to_next += 4; buffers += 4;