| 146 | } |
| 147 | |
| 148 | static int |
| 149 | tbl8_get_idx(struct dir24_8_tbl *dp) |
| 150 | { |
| 151 | uint32_t i; |
| 152 | int bit_idx; |
| 153 | |
| 154 | for (i = 0; (i < (dp->number_tbl8s >> BITMAP_SLAB_BIT_SIZE_LOG2)) && |
| 155 | (dp->tbl8_idxes[i] == UINT64_MAX); i++) |
| 156 | ; |
| 157 | if (i < (dp->number_tbl8s >> BITMAP_SLAB_BIT_SIZE_LOG2)) { |
| 158 | bit_idx = rte_ctz64(~dp->tbl8_idxes[i]); |
| 159 | dp->tbl8_idxes[i] |= (1ULL << bit_idx); |
| 160 | return (i << BITMAP_SLAB_BIT_SIZE_LOG2) + bit_idx; |
| 161 | } |
| 162 | return -ENOSPC; |
| 163 | } |
| 164 | |
| 165 | static inline void |
| 166 | tbl8_free_idx(struct dir24_8_tbl *dp, int idx) |
no test coverage detected