svm: init chunk rb tree indices in fifo
Type: improvement Let fifo segment mainly deal with fifo and chunk allocations not initialization. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1f1eb5a1423ba52cb950ae771641fd7eeff4e76c
This commit is contained in:

committed by
Dave Barach

parent
d9ed0b6786
commit
91b364010c
@ -512,8 +512,6 @@ fsh_try_alloc_chunk_batch (fifo_segment_header_t * fsh,
|
|||||||
{
|
{
|
||||||
c->start_byte = 0;
|
c->start_byte = 0;
|
||||||
c->length = rounded_data_size;
|
c->length = rounded_data_size;
|
||||||
c->enq_rb_index = RBTREE_TNIL_INDEX;
|
|
||||||
c->deq_rb_index = RBTREE_TNIL_INDEX;
|
|
||||||
c->next = head;
|
c->next = head;
|
||||||
head = c;
|
head = c;
|
||||||
cmem += sizeof (*c) + rounded_data_size;
|
cmem += sizeof (*c) + rounded_data_size;
|
||||||
@ -708,8 +706,6 @@ fsh_slice_collect_chunks (fifo_segment_header_t * fsh,
|
|||||||
CLIB_MEM_UNPOISON (c, sizeof (*c));
|
CLIB_MEM_UNPOISON (c, sizeof (*c));
|
||||||
next = c->next;
|
next = c->next;
|
||||||
fl_index = fs_freelist_for_size (c->length);
|
fl_index = fs_freelist_for_size (c->length);
|
||||||
c->enq_rb_index = RBTREE_TNIL_INDEX;
|
|
||||||
c->deq_rb_index = RBTREE_TNIL_INDEX;
|
|
||||||
fss_chunk_free_list_push (fss, fl_index, c);
|
fss_chunk_free_list_push (fss, fl_index, c);
|
||||||
n_collect += fs_freelist_index_to_size (fl_index);
|
n_collect += fs_freelist_index_to_size (fl_index);
|
||||||
c = next;
|
c = next;
|
||||||
|
@ -389,11 +389,13 @@ svm_fifo_init (svm_fifo_t * f, u32 size)
|
|||||||
*/
|
*/
|
||||||
f->start_chunk->start_byte = 0;
|
f->start_chunk->start_byte = 0;
|
||||||
prev = f->start_chunk;
|
prev = f->start_chunk;
|
||||||
|
prev->enq_rb_index = prev->deq_rb_index = RBTREE_TNIL_INDEX;
|
||||||
c = prev->next;
|
c = prev->next;
|
||||||
|
|
||||||
while (c)
|
while (c)
|
||||||
{
|
{
|
||||||
c->start_byte = prev->start_byte + prev->length;
|
c->start_byte = prev->start_byte + prev->length;
|
||||||
|
c->enq_rb_index = c->deq_rb_index = RBTREE_TNIL_INDEX;
|
||||||
prev = c;
|
prev = c;
|
||||||
c = c->next;
|
c = c->next;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user