memif: fix offset 03/33303/2
authorArtem Glazychev <artem.glazychev@xored.com>
Thu, 29 Jul 2021 07:54:59 +0000 (14:54 +0700)
committerDamjan Marion <dmarion@me.com>
Wed, 4 Aug 2021 06:59:49 +0000 (06:59 +0000)
signs were changed here when calculating the offset:
d78ba5aa01ff1415bff0b06069ce21e0a78df89c

Type: fix

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I62b7a409caaf478e40efbdd6000922dcc7e92860

src/plugins/memif/node.c

index 8bb3758..794e6b7 100644 (file)
@@ -774,7 +774,7 @@ refill:
   n_alloc = vlib_buffer_alloc_to_ring_from_pool (
     vm, mq->buffers, slot, ring_size, n_slots, mq->buffer_pool_index);
   dt->region = mq->buffer_pool_index + 1;
-  offset = (u64) mif->regions[dt->region].shm + start_offset;
+  offset = (u64) mif->regions[dt->region].shm - start_offset;
 
   if (PREDICT_FALSE (n_alloc != n_slots))
     vlib_error_count (vm, node->node_index,