| 234 | } |
| 235 | |
| 236 | static int |
| 237 | lookup_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 | |
| 262 | static int |
| 263 | check_fib(struct rte_fib *fib) |
no test coverage detected