git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
virtio: suport multiple MAC addresses
[dpdk.git]
/
app
/
test
/
test_acl.c
diff --git
a/app/test/test_acl.c
b/app/test/test_acl.c
index
869f6d3
..
7119ad3
100644
(file)
--- a/
app/test/test_acl.c
+++ b/
app/test/test_acl.c
@@
-36,8
+36,6
@@
#include "test.h"
#include "test.h"
-#ifdef RTE_LIBRTE_ACL
-
#include <rte_string_fns.h>
#include <rte_mbuf.h>
#include <rte_byteorder.h>
#include <rte_string_fns.h>
#include <rte_mbuf.h>
#include <rte_byteorder.h>
@@
-113,7
+111,7
@@
test_classify_run(struct rte_acl_ctx *acx)
* these will run quite a few times, it's necessary to test code paths
* from num=0 to num>8
*/
* these will run quite a few times, it's necessary to test code paths
* from num=0 to num>8
*/
- for (count = 0; count < RTE_DIM(acl_test_data); count++) {
+ for (count = 0; count <
=
RTE_DIM(acl_test_data); count++) {
ret = rte_acl_classify(acx, data, results,
count, RTE_ACL_MAX_CATEGORIES);
if (ret != 0) {
ret = rte_acl_classify(acx, data, results,
count, RTE_ACL_MAX_CATEGORIES);
if (ret != 0) {
@@
-130,6
+128,7
@@
test_classify_run(struct rte_acl_ctx *acx)
"(expected %"PRIu32" got %"PRIu32")!\n",
__LINE__, i, acl_test_data[i].allow,
result);
"(expected %"PRIu32" got %"PRIu32")!\n",
__LINE__, i, acl_test_data[i].allow,
result);
+ ret = -EINVAL;
goto err;
}
}
goto err;
}
}
@@
-142,16
+141,18
@@
test_classify_run(struct rte_acl_ctx *acx)
"(expected %"PRIu32" got %"PRIu32")!\n",
__LINE__, i, acl_test_data[i].deny,
result);
"(expected %"PRIu32" got %"PRIu32")!\n",
__LINE__, i, acl_test_data[i].deny,
result);
+ ret = -EINVAL;
goto err;
}
}
}
/* make a quick check for scalar */
goto err;
}
}
}
/* 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) {
if (ret != 0) {
- printf("Line %i:
SSE
classify failed!\n", __LINE__);
+ printf("Line %i:
scalar
classify failed!\n", __LINE__);
goto err;
}
goto err;
}
@@
-163,6
+164,7
@@
test_classify_run(struct rte_acl_ctx *acx)
"(expected %"PRIu32" got %"PRIu32")!\n",
__LINE__, i, acl_test_data[i].allow,
result);
"(expected %"PRIu32" got %"PRIu32")!\n",
__LINE__, i, acl_test_data[i].allow,
result);
+ ret = -EINVAL;
goto err;
}
}
goto err;
}
}
@@
-175,6
+177,7
@@
test_classify_run(struct rte_acl_ctx *acx)
"(expected %"PRIu32" got %"PRIu32")!\n",
__LINE__, i, acl_test_data[i].deny,
result);
"(expected %"PRIu32" got %"PRIu32")!\n",
__LINE__, i, acl_test_data[i].deny,
result);
+ ret = -EINVAL;
goto err;
}
}
goto err;
}
}
@@
-343,8
+346,8
@@
test_invalid_layout(void)
}
/* classify tuples */
}
/* 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);
if (ret != 0) {
printf("Line %i: SSE classify failed!\n", __LINE__);
rte_acl_free(acx);
@@
-362,8
+365,9
@@
test_invalid_layout(void)
}
/* classify tuples (scalar) */
}
/* 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);
if (ret != 0) {
printf("Line %i: Scalar classify failed!\n", __LINE__);
rte_acl_free(acx);
@@
-850,7
+854,8
@@
test_invalid_parameters(void)
/* scalar classify test */
/* cover zero categories in classify (should not fail) */
/* 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__);
if (result != 0) {
printf("Line %i: Scalar classify with zero categories "
"failed!\n", __LINE__);
@@
-859,7
+864,7
@@
test_invalid_parameters(void)
}
/* cover invalid but positive categories in classify */
}
/* 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__);
if (result == 0) {
printf("Line %i: Scalar classify with 3 categories "
"should have failed!\n", __LINE__);
@@
-910,7
+915,7
@@
test_misc(void)
return 0;
}
return 0;
}
-int
+
static
int
test_acl(void)
{
if (test_invalid_parameters() < 0)
test_acl(void)
{
if (test_invalid_parameters() < 0)
@@
-928,13
+933,9
@@
test_acl(void)
return 0;
}
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);