| 769 | } |
| 770 | |
| 771 | static void * |
| 772 | mlx5_ipool_get_next_cache(struct mlx5_indexed_pool *pool, uint32_t *pos) |
| 773 | { |
| 774 | struct rte_bitmap *ibmp; |
| 775 | uint64_t slab = 0; |
| 776 | uint32_t iidx = *pos; |
| 777 | |
| 778 | ibmp = pool->ibmp; |
| 779 | if (!ibmp || !rte_bitmap_scan(ibmp, &iidx, &slab)) { |
| 780 | if (pool->bmp_mem) { |
| 781 | pool->cfg.free(pool->bmp_mem); |
| 782 | pool->bmp_mem = NULL; |
| 783 | pool->ibmp = NULL; |
| 784 | } |
| 785 | return NULL; |
| 786 | } |
| 787 | iidx += rte_ctz64(slab); |
| 788 | rte_bitmap_clear(ibmp, iidx); |
| 789 | iidx++; |
| 790 | *pos = iidx; |
| 791 | return mlx5_ipool_get_cache(pool, iidx); |
| 792 | } |
| 793 | |
| 794 | void * |
| 795 | mlx5_ipool_get_next(struct mlx5_indexed_pool *pool, uint32_t *pos) |
no test coverage detected