* Call add, lookup and delete for a single rule with depth = 24 */
| 722 | * Call add, lookup and delete for a single rule with depth = 24 |
| 723 | */ |
| 724 | int32_t |
| 725 | test15(void) |
| 726 | { |
| 727 | struct rte_lpm6 *lpm = NULL; |
| 728 | struct rte_lpm6_config config; |
| 729 | uint8_t ip[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; |
| 730 | uint8_t depth = 24; |
| 731 | uint32_t next_hop_add = 100, next_hop_return = 0; |
| 732 | int32_t status = 0; |
| 733 | |
| 734 | config.max_rules = MAX_RULES; |
| 735 | config.number_tbl8s = NUMBER_TBL8S; |
| 736 | config.flags = 0; |
| 737 | |
| 738 | lpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config); |
| 739 | TEST_LPM_ASSERT(lpm != NULL); |
| 740 | |
| 741 | status = rte_lpm6_add(lpm, ip, depth, next_hop_add); |
| 742 | TEST_LPM_ASSERT(status == 0); |
| 743 | |
| 744 | status = rte_lpm6_lookup(lpm, ip, &next_hop_return); |
| 745 | TEST_LPM_ASSERT((status == 0) && (next_hop_return == next_hop_add)); |
| 746 | |
| 747 | status = rte_lpm6_delete(lpm, ip, depth); |
| 748 | TEST_LPM_ASSERT(status == 0); |
| 749 | |
| 750 | status = rte_lpm6_lookup(lpm, ip, &next_hop_return); |
| 751 | TEST_LPM_ASSERT(status == -ENOENT); |
| 752 | |
| 753 | rte_lpm6_free(lpm); |
| 754 | |
| 755 | return PASS; |
| 756 | } |
| 757 | |
| 758 | /* |
| 759 | * Call add, lookup and delete for a single rule with depth > 24 |
nothing calls this directly
no test coverage detected