- 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_generic_get(mp,
- &obj_table[idx],
- n_get_bulk,
- cache);
- if (unlikely(ret < 0)) {
- rte_mempool_dump(stdout, mp);
- /* in this case, objects are lost... */
- GOTO_ERR(ret, out);
- }
- idx += n_get_bulk;
- }
+ if (!use_constant_values)
+ ret = test_loop(mp, cache, n_keep, n_get_bulk, n_put_bulk);
+ else if (n_get_bulk == 1)
+ ret = test_loop(mp, cache, n_keep, 1, 1);
+ else if (n_get_bulk == 4)
+ ret = test_loop(mp, cache, n_keep, 4, 4);
+ else if (n_get_bulk == CACHE_LINE_BURST)
+ ret = test_loop(mp, cache, n_keep,
+ CACHE_LINE_BURST, CACHE_LINE_BURST);
+ else if (n_get_bulk == 32)
+ ret = test_loop(mp, cache, n_keep, 32, 32);
+ else
+ ret = -1;
+
+ if (ret < 0)
+ GOTO_ERR(ret, out);