X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_acl.c;h=356d6206b820a36189e40a60e95550fe7300167d;hb=51e16682cf5c8ee64b4ce4cc6a18d6d8f5e68948;hp=869f6d32e115c9daafa1c72c006ae7d50a935dc6;hpb=93b6c43b91b08ccfde9dbcc45620f378c8a20067;p=dpdk.git diff --git a/app/test/test_acl.c b/app/test/test_acl.c index 869f6d32e1..356d6206b8 100644 --- a/app/test/test_acl.c +++ b/app/test/test_acl.c @@ -36,8 +36,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_ACL - #include #include #include @@ -148,8 +146,9 @@ test_classify_run(struct rte_acl_ctx *acx) } /* make a quick check for scalar */ - ret = rte_acl_classify_scalar(acx, data, results, - RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES); + ret = rte_acl_classify_alg(acx, data, results, + RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES, + RTE_ACL_CLASSIFY_SCALAR); if (ret != 0) { printf("Line %i: SSE classify failed!\n", __LINE__); goto err; @@ -343,8 +342,8 @@ test_invalid_layout(void) } /* classify tuples */ - ret = rte_acl_classify(acx, data, results, - RTE_DIM(results), 1); + ret = rte_acl_classify_alg(acx, data, results, + RTE_DIM(results), 1, RTE_ACL_CLASSIFY_SCALAR); if (ret != 0) { printf("Line %i: SSE classify failed!\n", __LINE__); rte_acl_free(acx); @@ -362,8 +361,9 @@ test_invalid_layout(void) } /* classify tuples (scalar) */ - ret = rte_acl_classify_scalar(acx, data, results, - RTE_DIM(results), 1); + ret = rte_acl_classify_alg(acx, data, results, RTE_DIM(results), 1, + RTE_ACL_CLASSIFY_SCALAR); + if (ret != 0) { printf("Line %i: Scalar classify failed!\n", __LINE__); rte_acl_free(acx); @@ -850,7 +850,8 @@ test_invalid_parameters(void) /* scalar classify test */ /* cover zero categories in classify (should not fail) */ - result = rte_acl_classify_scalar(acx, NULL, NULL, 0, 0); + result = rte_acl_classify_alg(acx, NULL, NULL, 0, 0, + RTE_ACL_CLASSIFY_SCALAR); if (result != 0) { printf("Line %i: Scalar classify with zero categories " "failed!\n", __LINE__); @@ -859,7 +860,7 @@ test_invalid_parameters(void) } /* cover invalid but positive categories in classify */ - result = rte_acl_classify_scalar(acx, NULL, NULL, 0, 3); + result = rte_acl_classify(acx, NULL, NULL, 0, 3); if (result == 0) { printf("Line %i: Scalar classify with 3 categories " "should have failed!\n", __LINE__); @@ -910,7 +911,7 @@ test_misc(void) return 0; } -int +static int test_acl(void) { if (test_invalid_parameters() < 0) @@ -928,13 +929,9 @@ test_acl(void) return 0; } -#else - -int -test_acl(void) -{ - printf("This binary was not compiled with ACL support!\n"); - return 0; -} -#endif /* RTE_LIBRTE_ACL */ +static struct test_command acl_cmd = { + .command = "acl_autotest", + .callback = test_acl, +}; +REGISTER_TEST_COMMAND(acl_cmd);