* Call add, lookup and delete for a single rule with depth <= 24 */
| 274 | * Call add, lookup and delete for a single rule with depth <= 24 |
| 275 | */ |
| 276 | int32_t |
| 277 | test6(void) |
| 278 | { |
| 279 | struct rte_lpm *lpm = NULL; |
| 280 | struct rte_lpm_config config; |
| 281 | |
| 282 | config.max_rules = MAX_RULES; |
| 283 | config.number_tbl8s = NUMBER_TBL8S; |
| 284 | config.flags = 0; |
| 285 | uint32_t ip = RTE_IPV4(0, 0, 0, 0), next_hop_add = 100, next_hop_return = 0; |
| 286 | uint8_t depth = 24; |
| 287 | int32_t status = 0; |
| 288 | |
| 289 | lpm = rte_lpm_create(__func__, SOCKET_ID_ANY, &config); |
| 290 | TEST_LPM_ASSERT(lpm != NULL); |
| 291 | |
| 292 | status = rte_lpm_add(lpm, ip, depth, next_hop_add); |
| 293 | TEST_LPM_ASSERT(status == 0); |
| 294 | |
| 295 | status = rte_lpm_lookup(lpm, ip, &next_hop_return); |
| 296 | TEST_LPM_ASSERT((status == 0) && (next_hop_return == next_hop_add)); |
| 297 | |
| 298 | status = rte_lpm_delete(lpm, ip, depth); |
| 299 | TEST_LPM_ASSERT(status == 0); |
| 300 | |
| 301 | status = rte_lpm_lookup(lpm, ip, &next_hop_return); |
| 302 | TEST_LPM_ASSERT(status == -ENOENT); |
| 303 | |
| 304 | rte_lpm_free(lpm); |
| 305 | |
| 306 | return PASS; |
| 307 | } |
| 308 | |
| 309 | /* |
| 310 | * Call add, lookup and delete for a single rule with depth > 24 |
nothing calls this directly
no test coverage detected