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

Function lookup_and_check_desc

dpdk/app/test/test_fib6.c:241–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241static int
242lookup_and_check_desc(struct rte_fib6 *fib,
243 uint8_t ip_arr[RTE_FIB6_MAXDEPTH][RTE_FIB6_IPV6_ADDR_SIZE],
244 uint8_t ip_missing[][RTE_FIB6_IPV6_ADDR_SIZE], uint64_t def_nh,
245 uint32_t n)
246{
247 uint64_t nh_arr[RTE_FIB6_MAXDEPTH];
248 int ret;
249 uint32_t i = 0;
250
251 ret = rte_fib6_lookup_bulk(fib, ip_arr, nh_arr, RTE_FIB6_MAXDEPTH);
252 RTE_TEST_ASSERT(ret == 0, "Failed to lookup\n");
253
254 for (; i < n; i++)
255 RTE_TEST_ASSERT(nh_arr[i] == RTE_FIB6_MAXDEPTH - i,
256 "Failed to get proper nexthop\n");
257
258 for (; i < RTE_FIB6_MAXDEPTH; i++)
259 RTE_TEST_ASSERT(nh_arr[i] == def_nh,
260 "Failed to get proper nexthop\n");
261
262 ret = rte_fib6_lookup_bulk(fib, ip_missing, nh_arr, 1);
263 RTE_TEST_ASSERT((ret == 0) && (nh_arr[0] == def_nh),
264 "Failed to get proper nexthop\n");
265
266 return TEST_SUCCESS;
267}
268
269static int
270check_fib(struct rte_fib6 *fib)

Callers 1

check_fibFunction · 0.70

Calls 1

rte_fib6_lookup_bulkFunction · 0.85

Tested by

no test coverage detected