session: remove fifo segment va allocator
[vpp.git] / src / svm / svm_fifo.c
index f79f37a..dc9e4fb 100644 (file)
@@ -398,6 +398,7 @@ svm_fifo_init (svm_fifo_t * f, u32 size)
     {
       c->start_byte = prev->start_byte + prev->length;
       c->enq_rb_index = c->deq_rb_index = RBTREE_TNIL_INDEX;
+      ASSERT (c->length >= 1 << FS_MIN_LOG2_CHUNK_SZ);
       prev = c;
       c = f_cptr (f, c->next);
     }
@@ -1339,7 +1340,7 @@ svm_fifo_clone (svm_fifo_t * df, svm_fifo_t * sf)
   ASSERT (svm_fifo_n_chunks (sf) == 1);
 
   clib_memcpy_fast (f_head_cptr (df)->data, f_head_cptr (sf)->data,
-                   sf->shr->size);
+                   f_head_cptr (sf)->length);
 
   f_load_head_tail_all_acq (sf, &head, &tail);
   clib_atomic_store_rel_n (&df->shr->head, head);