* Call add, lookup and delete for a single rule with depth > 24 */
| 759 | * Call add, lookup and delete for a single rule with depth > 24 |
| 760 | */ |
| 761 | int32_t |
| 762 | test16(void) |
| 763 | { |
| 764 | struct rte_lpm6 *lpm = NULL; |
| 765 | struct rte_lpm6_config config; |
| 766 | uint8_t ip[] = {12,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0}; |
| 767 | uint8_t depth = 128; |
| 768 | uint32_t next_hop_add = 100, next_hop_return = 0; |
| 769 | int32_t status = 0; |
| 770 | |
| 771 | config.max_rules = MAX_RULES; |
| 772 | config.number_tbl8s = NUMBER_TBL8S; |
| 773 | config.flags = 0; |
| 774 | |
| 775 | lpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config); |
| 776 | TEST_LPM_ASSERT(lpm != NULL); |
| 777 | |
| 778 | status = rte_lpm6_add(lpm, ip, depth, next_hop_add); |
| 779 | TEST_LPM_ASSERT(status == 0); |
| 780 | |
| 781 | status = rte_lpm6_lookup(lpm, ip, &next_hop_return); |
| 782 | TEST_LPM_ASSERT((status == 0) && (next_hop_return == next_hop_add)); |
| 783 | |
| 784 | status = rte_lpm6_delete(lpm, ip, depth); |
| 785 | TEST_LPM_ASSERT(status == 0); |
| 786 | |
| 787 | status = rte_lpm6_lookup(lpm, ip, &next_hop_return); |
| 788 | TEST_LPM_ASSERT(status == -ENOENT); |
| 789 | |
| 790 | rte_lpm6_free(lpm); |
| 791 | |
| 792 | return PASS; |
| 793 | } |
| 794 | |
| 795 | /* |
| 796 | * Use rte_lpm6_add to add rules which effect only the second half of the lpm |
nothing calls this directly
no test coverage detected