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

Function tbl8_alloc

dpdk/lib/fib/dir24_8.c:172–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172static int
173tbl8_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
192static void
193tbl8_recycle(struct dir24_8_tbl *dp, uint32_t ip, uint64_t tbl8_idx)

Callers 1

install_to_fibFunction · 0.70

Calls 2

tbl8_get_idxFunction · 0.85
write_to_fibFunction · 0.85

Tested by

no test coverage detected