* - Add rule that covers a TBL24 range previously invalid & lookup (& delete & * lookup) * - Add rule that extends a TBL24 invalid entry & lookup (& delete & lookup) * - Add rule that extends a TBL24 valid entry & lookup for both rules (& * delete & lookup) * - Add rule that updates the next hop in TBL24 & lookup (& delete & lookup) * - Add rule that updates the next hop in TBL8 & lookup
| 1033 | * - Delete a rule that is not present in the TBL8 & lookup |
| 1034 | */ |
| 1035 | int32_t |
| 1036 | test19(void) |
| 1037 | { |
| 1038 | struct rte_lpm6 *lpm = NULL; |
| 1039 | struct rte_lpm6_config config; |
| 1040 | uint8_t ip[16]; |
| 1041 | uint8_t depth; |
| 1042 | uint32_t next_hop_add, next_hop_return; |
| 1043 | int32_t status = 0; |
| 1044 | |
| 1045 | config.max_rules = MAX_RULES; |
| 1046 | config.number_tbl8s = NUMBER_TBL8S; |
| 1047 | config.flags = 0; |
| 1048 | |
| 1049 | /* Add rule that covers a TBL24 range previously invalid & lookup |
| 1050 | * (& delete & lookup) |
| 1051 | */ |
| 1052 | lpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config); |
| 1053 | TEST_LPM_ASSERT(lpm != NULL); |
| 1054 | |
| 1055 | IPv6(ip, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
| 1056 | depth = 16; |
| 1057 | next_hop_add = 100; |
| 1058 | |
| 1059 | status = rte_lpm6_add(lpm, ip, depth, next_hop_add); |
| 1060 | TEST_LPM_ASSERT(status == 0); |
| 1061 | |
| 1062 | status = rte_lpm6_lookup(lpm, ip, &next_hop_return); |
| 1063 | TEST_LPM_ASSERT((status == 0) && (next_hop_return == next_hop_add)); |
| 1064 | |
| 1065 | status = rte_lpm6_delete(lpm, ip, depth); |
| 1066 | TEST_LPM_ASSERT(status == 0); |
| 1067 | |
| 1068 | status = rte_lpm6_lookup(lpm, ip, &next_hop_return); |
| 1069 | TEST_LPM_ASSERT(status == -ENOENT); |
| 1070 | |
| 1071 | rte_lpm6_delete_all(lpm); |
| 1072 | |
| 1073 | IPv6(ip, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); |
| 1074 | depth = 25; |
| 1075 | next_hop_add = 100; |
| 1076 | |
| 1077 | status = rte_lpm6_add(lpm, ip, depth, next_hop_add); |
| 1078 | TEST_LPM_ASSERT(status == 0); |
| 1079 | |
| 1080 | status = rte_lpm6_lookup(lpm, ip, &next_hop_return); |
| 1081 | TEST_LPM_ASSERT((status == 0) && (next_hop_return == next_hop_add)); |
| 1082 | |
| 1083 | status = rte_lpm6_delete(lpm, ip, depth); |
| 1084 | TEST_LPM_ASSERT(status == 0); |
| 1085 | |
| 1086 | rte_lpm6_delete_all(lpm); |
| 1087 | |
| 1088 | /* |
| 1089 | * Add rule that extends a TBL24 valid entry & lookup for both rules |
| 1090 | * (& delete & lookup) |
| 1091 | */ |
| 1092 |
nothing calls this directly
no test coverage detected