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

Function lookup_and_check_desc

dpdk/app/test/test_fib.c:236–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236static int
237lookup_and_check_desc(struct rte_fib *fib, uint32_t ip_arr[RTE_FIB_MAXDEPTH],
238 uint32_t ip_missing, uint64_t def_nh, uint32_t n)
239{
240 uint64_t nh_arr[RTE_FIB_MAXDEPTH];
241 int ret;
242 uint32_t i = 0;
243
244 ret = rte_fib_lookup_bulk(fib, ip_arr, nh_arr, RTE_FIB_MAXDEPTH);
245 RTE_TEST_ASSERT(ret == 0, "Failed to lookup\n");
246
247 for (; i < n; i++)
248 RTE_TEST_ASSERT(nh_arr[i] == RTE_FIB_MAXDEPTH - i,
249 "Failed to get proper nexthop\n");
250
251 for (; i < RTE_FIB_MAXDEPTH; i++)
252 RTE_TEST_ASSERT(nh_arr[i] == def_nh,
253 "Failed to get proper nexthop\n");
254
255 ret = rte_fib_lookup_bulk(fib, &ip_missing, nh_arr, 1);
256 RTE_TEST_ASSERT((ret == 0) && (nh_arr[0] == def_nh),
257 "Failed to get proper nexthop\n");
258
259 return TEST_SUCCESS;
260}
261
262static int
263check_fib(struct rte_fib *fib)

Callers 1

check_fibFunction · 0.70

Calls 1

rte_fib_lookup_bulkFunction · 0.85

Tested by

no test coverage detected