X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_lpm.c;h=8b4ded98220a1d7e5a3f97fb5f650f2010afe1ed;hb=e45ae7065e92ade35d6a3883a986a4210c78cc24;hp=05f0a935810cb0c3531444483e55f1164802d72b;hpb=3440438c5d4749371be8c9c2abace4793af495b9;p=dpdk.git diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c index 05f0a93581..8b4ded9822 100644 --- a/app/test/test_lpm.c +++ b/app/test/test_lpm.c @@ -47,8 +47,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_LPM - #include "rte_lpm.h" #include "test_lpm_routes.h" @@ -167,7 +165,7 @@ test2(void) { struct rte_lpm *lpm = NULL; - lpm = rte_lpm_create(__func__, SOCKET_ID_ANY, MAX_RULES, RTE_LPM_HEAP); + lpm = rte_lpm_create(__func__, SOCKET_ID_ANY, MAX_RULES, 0); TEST_LPM_ASSERT(lpm != NULL); rte_lpm_free(lpm); @@ -609,7 +607,7 @@ test10(void) /* Add rule that covers a TBL24 range previously invalid & lookup * (& delete & lookup) */ - lpm = rte_lpm_create(__func__, SOCKET_ID_ANY, MAX_RULES, RTE_LPM_HEAP); + lpm = rte_lpm_create(__func__, SOCKET_ID_ANY, MAX_RULES, 0); TEST_LPM_ASSERT(lpm != NULL); ip = IPv4(128, 0, 0, 0); @@ -1332,7 +1330,7 @@ perf_test(void) * Do all unit and performance tests. */ -int +static int test_lpm(void) { unsigned i; @@ -1349,13 +1347,8 @@ test_lpm(void) return global_status; } -#else /* RTE_LIBRTE_LPM */ - -int -test_lpm(void) -{ - printf("The LPM library is not included in this build\n"); - return 0; -} - -#endif /* RTE_LIBRTE_LPM */ +static struct test_command lpm_cmd = { + .command = "lpm_autotest", + .callback = test_lpm, +}; +REGISTER_TEST_COMMAND(lpm_cmd);