* Test scalar and SSE ACL lookup. */
| 408 | * Test scalar and SSE ACL lookup. |
| 409 | */ |
| 410 | static int |
| 411 | test_classify(void) |
| 412 | { |
| 413 | struct rte_acl_ctx *acx; |
| 414 | int i, ret; |
| 415 | |
| 416 | acx = rte_acl_create(&acl_param); |
| 417 | if (acx == NULL) { |
| 418 | printf("Line %i: Error creating ACL context!\n", __LINE__); |
| 419 | return -1; |
| 420 | } |
| 421 | |
| 422 | ret = 0; |
| 423 | for (i = 0; i != TEST_CLASSIFY_ITER; i++) { |
| 424 | |
| 425 | if ((i & 1) == 0) |
| 426 | rte_acl_reset(acx); |
| 427 | else |
| 428 | rte_acl_reset_rules(acx); |
| 429 | |
| 430 | ret = test_classify_buid(acx, acl_test_rules, |
| 431 | RTE_DIM(acl_test_rules)); |
| 432 | if (ret != 0) { |
| 433 | printf("Line %i, iter: %d: " |
| 434 | "Adding rules to ACL context failed!\n", |
| 435 | __LINE__, i); |
| 436 | break; |
| 437 | } |
| 438 | |
| 439 | ret = test_classify_run(acx, acl_test_data, |
| 440 | RTE_DIM(acl_test_data)); |
| 441 | if (ret != 0) { |
| 442 | printf("Line %i, iter: %d: %s failed!\n", |
| 443 | __LINE__, i, __func__); |
| 444 | break; |
| 445 | } |
| 446 | |
| 447 | /* reset rules and make sure that classify still works ok. */ |
| 448 | rte_acl_reset_rules(acx); |
| 449 | ret = test_classify_run(acx, acl_test_data, |
| 450 | RTE_DIM(acl_test_data)); |
| 451 | if (ret != 0) { |
| 452 | printf("Line %i, iter: %d: %s failed!\n", |
| 453 | __LINE__, i, __func__); |
| 454 | break; |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | rte_acl_free(acx); |
| 459 | return ret; |
| 460 | } |
| 461 | |
| 462 | static int |
| 463 | test_build_ports_range(void) |
no test coverage detected