- stats[lcore_id].enq_count = 0;
-
- /* wait synchro for slaves */
- if (lcore_id != rte_get_master_lcore())
- while (rte_atomic32_read(&synchro) == 0);
-
- start_cycles = rte_get_hpet_cycles();
-
- while (time_diff/hz < TIME_S) {
- for (i = 0; likely(i < (N/n_keep)); i++) {
- /* get n_keep objects by bulk of n_bulk */
- idx = 0;
- while (idx < n_keep) {
- ret = rte_mempool_get_bulk(mp, &obj_table[idx],
- n_get_bulk);
- if (unlikely(ret < 0)) {
- rte_mempool_dump(mp);
- rte_ring_dump(mp->ring);
- /* in this case, objects are lost... */
- return -1;
- }
- idx += n_get_bulk;
- }
-
- /* put the objects back */
- idx = 0;
- while (idx < n_keep) {
- rte_mempool_put_bulk(mp, &obj_table[idx],
- n_put_bulk);
- idx += n_put_bulk;
- }
- }
- end_cycles = rte_get_hpet_cycles();
- time_diff = end_cycles - start_cycles;
- stats[lcore_id].enq_count += N;
- }
+ cm = rte_zmalloc("custom_mempool",
+ sizeof(struct custom_mempool) + mp->size * sizeof(void *), 0);
+ if (cm == NULL)
+ return -ENOMEM;