| 51 | } |
| 52 | |
| 53 | static unsigned long bitmap_ffs(struct rte_bitmap *bmap, |
| 54 | uint64_t n, unsigned long m) |
| 55 | { |
| 56 | uint64_t out_slab = 0; |
| 57 | uint32_t pos = 0; /* Compilation warn */ |
| 58 | |
| 59 | __rte_bitmap_scan_init(bmap); |
| 60 | if (!rte_bitmap_scan(bmap, &pos, &out_slab)) { |
| 61 | DR_LOG(ERR, "Failed to get slab from bitmap."); |
| 62 | return m; |
| 63 | } |
| 64 | pos = pos + rte_ctz64(out_slab); |
| 65 | |
| 66 | if (pos < n) { |
| 67 | DR_LOG(ERR, "Unexpected bit (%d < %"PRIx64") from bitmap", pos, n); |
| 68 | return m; |
| 69 | } |
| 70 | return pos; |
| 71 | } |
| 72 | |
| 73 | static unsigned long mlx5dr_buddy_find_first_bit(struct rte_bitmap *addr, |
| 74 | uint32_t size) |
no test coverage detected