MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test15

Function test15

dpdk/app/test/test_lpm.c:1065–1092  ·  view source on GitHub ↗

* Sequence of operations for find existing lpm table * * - create table * - find existing table: hit * - find non-existing table: miss * */

Source from the content-addressed store, hash-verified

1063 *
1064 */
1065int32_t
1066test15(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

Callers

nothing calls this directly

Calls 4

rte_lpm_createFunction · 0.50
rte_lpm_find_existingFunction · 0.50
rte_lpm_delete_allFunction · 0.50
rte_lpm_freeFunction · 0.50

Tested by

no test coverage detected