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

Function lookup_and_check_asc

dpdk/app/test/test_fib6.c:213–239  ·  view source on GitHub ↗

* Add routes for one supernet with all possible depths and do lookup * on each step * After delete routes with doing lookup on each step */

Source from the content-addressed store, hash-verified

211 * After delete routes with doing lookup on each step
212 */
213static int
214lookup_and_check_asc(struct rte_fib6 *fib,
215 uint8_t ip_arr[RTE_FIB6_MAXDEPTH][RTE_FIB6_IPV6_ADDR_SIZE],
216 uint8_t ip_missing[][RTE_FIB6_IPV6_ADDR_SIZE], uint64_t def_nh,
217 uint32_t n)
218{
219 uint64_t nh_arr[RTE_FIB6_MAXDEPTH];
220 int ret;
221 uint32_t i = 0;
222
223 ret = rte_fib6_lookup_bulk(fib, ip_arr, nh_arr, RTE_FIB6_MAXDEPTH);
224 RTE_TEST_ASSERT(ret == 0, "Failed to lookup\n");
225
226 for (; i <= RTE_FIB6_MAXDEPTH - n; i++)
227 RTE_TEST_ASSERT(nh_arr[i] == n,
228 "Failed to get proper nexthop\n");
229
230 for (; i < RTE_FIB6_MAXDEPTH; i++)
231 RTE_TEST_ASSERT(nh_arr[i] == --n,
232 "Failed to get proper nexthop\n");
233
234 ret = rte_fib6_lookup_bulk(fib, ip_missing, nh_arr, 1);
235 RTE_TEST_ASSERT((ret == 0) && (nh_arr[0] == def_nh),
236 "Failed to get proper nexthop\n");
237
238 return TEST_SUCCESS;
239}
240
241static int
242lookup_and_check_desc(struct rte_fib6 *fib,

Callers 1

check_fibFunction · 0.70

Calls 1

rte_fib6_lookup_bulkFunction · 0.85

Tested by

no test coverage detected