* Add routes for one supernet with all possible depths and do lookup * on each step * After delete routes with doing lookup on each step */
| 208 | * After delete routes with doing lookup on each step |
| 209 | */ |
| 210 | static int |
| 211 | lookup_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 | |
| 236 | static int |
| 237 | lookup_and_check_desc(struct rte_fib *fib, uint32_t ip_arr[RTE_FIB_MAXDEPTH], |
no test coverage detected