* Add routes for one supernet with all possible depths and do lookup * on each step * After delete routes with doing lookup on each step */
| 211 | * After delete routes with doing lookup on each step |
| 212 | */ |
| 213 | static int |
| 214 | lookup_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 | |
| 241 | static int |
| 242 | lookup_and_check_desc(struct rte_fib6 *fib, |
no test coverage detected