* Sequence of operations for find existing lpm table * * - create table * - find existing table: hit * - find non-existing table: miss * */
| 1063 | * |
| 1064 | */ |
| 1065 | int32_t |
| 1066 | test15(void) |
| 1067 | { |
| 1068 | struct rte_lpm *lpm = NULL, *result = NULL; |
| 1069 | struct rte_lpm_config config; |
| 1070 | |
| 1071 | config.max_rules = 256 * 32; |
| 1072 | config.number_tbl8s = NUMBER_TBL8S; |
| 1073 | config.flags = 0; |
| 1074 | |
| 1075 | /* Create lpm */ |
| 1076 | lpm = rte_lpm_create("lpm_find_existing", SOCKET_ID_ANY, &config); |
| 1077 | TEST_LPM_ASSERT(lpm != NULL); |
| 1078 | |
| 1079 | /* Try to find existing lpm */ |
| 1080 | result = rte_lpm_find_existing("lpm_find_existing"); |
| 1081 | TEST_LPM_ASSERT(result == lpm); |
| 1082 | |
| 1083 | /* Try to find non-existing lpm */ |
| 1084 | result = rte_lpm_find_existing("lpm_find_non_existing"); |
| 1085 | TEST_LPM_ASSERT(result == NULL); |
| 1086 | |
| 1087 | /* Cleanup. */ |
| 1088 | rte_lpm_delete_all(lpm); |
| 1089 | rte_lpm_free(lpm); |
| 1090 | |
| 1091 | return PASS; |
| 1092 | } |
| 1093 | |
| 1094 | /* |
| 1095 | * test failure condition of overloading the tbl8 so no more will fit |
nothing calls this directly
no test coverage detected