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

Function lookup_and_check_asc

dpdk/app/test/test_fib.c:210–234  ·  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

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

Callers 1

check_fibFunction · 0.70

Calls 1

rte_fib_lookup_bulkFunction · 0.85

Tested by

no test coverage detected