| 121 | } |
| 122 | |
| 123 | static __rte_always_inline int |
| 124 | test_loop(struct rte_mempool *mp, struct rte_mempool_cache *cache, |
| 125 | unsigned int x_keep, unsigned int x_get_bulk, unsigned int x_put_bulk) |
| 126 | { |
| 127 | void *obj_table[MAX_KEEP] __rte_cache_aligned; |
| 128 | unsigned int idx; |
| 129 | unsigned int i; |
| 130 | int ret; |
| 131 | |
| 132 | for (i = 0; likely(i < (N / x_keep)); i++) { |
| 133 | /* get x_keep objects by bulk of x_get_bulk */ |
| 134 | for (idx = 0; idx < x_keep; idx += x_get_bulk) { |
| 135 | ret = rte_mempool_generic_get(mp, |
| 136 | &obj_table[idx], |
| 137 | x_get_bulk, |
| 138 | cache); |
| 139 | if (unlikely(ret < 0)) { |
| 140 | rte_mempool_dump(stdout, mp); |
| 141 | return ret; |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | /* put the objects back by bulk of x_put_bulk */ |
| 146 | for (idx = 0; idx < x_keep; idx += x_put_bulk) { |
| 147 | rte_mempool_generic_put(mp, |
| 148 | &obj_table[idx], |
| 149 | x_put_bulk, |
| 150 | cache); |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | return 0; |
| 155 | } |
| 156 | |
| 157 | static int |
| 158 | per_lcore_mempool_test(void *arg) |
no test coverage detected