MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bitmap_ffs

Function bitmap_ffs

dpdk/drivers/net/mlx5/hws/mlx5dr_buddy.c:53–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53static 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
73static unsigned long mlx5dr_buddy_find_first_bit(struct rte_bitmap *addr,
74 uint32_t size)

Callers 1

Calls 3

__rte_bitmap_scan_initFunction · 0.85
rte_bitmap_scanFunction · 0.85
rte_ctz64Function · 0.85

Tested by

no test coverage detected