summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/memif')
-rw-r--r--src/plugins/memif/node.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c
index 1f636f2b3a2..5bb10fc6eec 100644
--- a/src/plugins/memif/node.c
+++ b/src/plugins/memif/node.c
@@ -557,7 +557,7 @@ memif_device_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
vlib_get_buffers (vm, ptd->buffers, buffer_ptrs, n_buffers);
- for (i = 0; i < n_pkts - 8; i++)
+ for (i = 0; i + 8 < n_pkts; i++)
{
clib_prefetch_load (desc_data[i + 8]);
clib_prefetch_store (buffer_ptrs[i + 8]->data);
@@ -574,7 +574,7 @@ memif_device_input_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
u32 n_pkts = vec_len (ptd->copy_ops);
co = ptd->copy_ops;
- for (i = 0; i < n_pkts - 8; i++)
+ for (i = 0; i + 8 < n_pkts; i++)
{
clib_prefetch_load (co[i + 8].data);
b = vlib_get_buffer (vm, ptd->buffers[co[i].buffer_vec_index]);