| 170 | } |
| 171 | |
| 172 | static int |
| 173 | tbl8_alloc(struct dir24_8_tbl *dp, uint64_t nh) |
| 174 | { |
| 175 | int64_t tbl8_idx; |
| 176 | uint8_t *tbl8_ptr; |
| 177 | |
| 178 | tbl8_idx = tbl8_get_idx(dp); |
| 179 | if (tbl8_idx < 0) |
| 180 | return tbl8_idx; |
| 181 | tbl8_ptr = (uint8_t *)dp->tbl8 + |
| 182 | ((tbl8_idx * DIR24_8_TBL8_GRP_NUM_ENT) << |
| 183 | dp->nh_sz); |
| 184 | /*Init tbl8 entries with nexthop from tbl24*/ |
| 185 | write_to_fib((void *)tbl8_ptr, nh| |
| 186 | DIR24_8_EXT_ENT, dp->nh_sz, |
| 187 | DIR24_8_TBL8_GRP_NUM_ENT); |
| 188 | dp->cur_tbl8s++; |
| 189 | return tbl8_idx; |
| 190 | } |
| 191 | |
| 192 | static void |
| 193 | tbl8_recycle(struct dir24_8_tbl *dp, uint32_t ip, uint64_t tbl8_idx) |
no test coverage detected