launch all the per-lcore test, and display the result */
| 226 | |
| 227 | /* launch all the per-lcore test, and display the result */ |
| 228 | static int |
| 229 | launch_cores(struct rte_mempool *mp, unsigned int cores) |
| 230 | { |
| 231 | unsigned lcore_id; |
| 232 | uint64_t rate; |
| 233 | int ret; |
| 234 | unsigned cores_save = cores; |
| 235 | |
| 236 | __atomic_store_n(&synchro, 0, __ATOMIC_RELAXED); |
| 237 | |
| 238 | /* reset stats */ |
| 239 | memset(stats, 0, sizeof(stats)); |
| 240 | |
| 241 | printf("mempool_autotest cache=%u cores=%u n_get_bulk=%u " |
| 242 | "n_put_bulk=%u n_keep=%u constant_n=%u ", |
| 243 | use_external_cache ? |
| 244 | external_cache_size : (unsigned) mp->cache_size, |
| 245 | cores, n_get_bulk, n_put_bulk, n_keep, use_constant_values); |
| 246 | |
| 247 | if (rte_mempool_avail_count(mp) != MEMPOOL_SIZE) { |
| 248 | printf("mempool is not full\n"); |
| 249 | return -1; |
| 250 | } |
| 251 | |
| 252 | RTE_LCORE_FOREACH_WORKER(lcore_id) { |
| 253 | if (cores == 1) |
| 254 | break; |
| 255 | cores--; |
| 256 | rte_eal_remote_launch(per_lcore_mempool_test, |
| 257 | mp, lcore_id); |
| 258 | } |
| 259 | |
| 260 | /* start synchro and launch test on main */ |
| 261 | __atomic_store_n(&synchro, 1, __ATOMIC_RELAXED); |
| 262 | |
| 263 | ret = per_lcore_mempool_test(mp); |
| 264 | |
| 265 | cores = cores_save; |
| 266 | RTE_LCORE_FOREACH_WORKER(lcore_id) { |
| 267 | if (cores == 1) |
| 268 | break; |
| 269 | cores--; |
| 270 | if (rte_eal_wait_lcore(lcore_id) < 0) |
| 271 | ret = -1; |
| 272 | } |
| 273 | |
| 274 | if (ret < 0) { |
| 275 | printf("per-lcore test returned -1\n"); |
| 276 | return -1; |
| 277 | } |
| 278 | |
| 279 | rate = 0; |
| 280 | for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) |
| 281 | rate += (stats[lcore_id].enq_count / TIME_S); |
| 282 | |
| 283 | printf("rate_persec=%" PRIu64 "\n", rate); |
| 284 | |
| 285 | return 0; |
no test coverage detected