u8 *fmem;
int i;
+ ASSERT (batch_size != 0);
+
size = (uword) sizeof (*f) * batch_size;
oldheap = ssvm_push_heap (fsh->ssvm_sh);
u8 *cmem;
int i;
+ ASSERT (batch_size != 0);
+
rounded_data_size = fs_freelist_index_to_size (fl_index);
total_chunk_bytes = (uword) batch_size *rounded_data_size;
size = (uword) (sizeof (*c) + rounded_data_size) * batch_size;
for (i = 0; i < fs->n_slices; i++)
{
- fss = fsh_slice_get (fsh, i);
alloc_now = clib_min (pairs_per_slice, *n_fifo_pairs);
+ if (0 == alloc_now)
+ break;
+
+ fss = fsh_slice_get (fsh, i);
if (fs_try_alloc_fifo_batch (fsh, fss, rx_fl_index, alloc_now))
clib_warning ("rx prealloc failed: pairs %u", alloc_now);
if (fs_try_alloc_fifo_batch (fsh, fss, tx_fl_index, alloc_now))