| 429 | } |
| 430 | |
| 431 | static void * |
| 432 | mlx5_ipool_malloc_cache(struct mlx5_indexed_pool *pool, uint32_t *idx) |
| 433 | { |
| 434 | void *entry; |
| 435 | int cidx; |
| 436 | |
| 437 | cidx = rte_lcore_index(rte_lcore_id()); |
| 438 | if (unlikely(cidx == -1)) { |
| 439 | cidx = RTE_MAX_LCORE; |
| 440 | rte_spinlock_lock(&pool->lcore_lock); |
| 441 | } |
| 442 | entry = _mlx5_ipool_malloc_cache(pool, cidx, idx); |
| 443 | if (unlikely(cidx == RTE_MAX_LCORE)) |
| 444 | rte_spinlock_unlock(&pool->lcore_lock); |
| 445 | return entry; |
| 446 | } |
| 447 | |
| 448 | static void |
| 449 | _mlx5_ipool_free_cache(struct mlx5_indexed_pool *pool, int cidx, uint32_t idx) |
no test coverage detected