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

Function test_classify

dpdk/app/test/test_acl.c:410–460  ·  view source on GitHub ↗

* Test scalar and SSE ACL lookup. */

Source from the content-addressed store, hash-verified

408 * Test scalar and SSE ACL lookup.
409 */
410static int
411test_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
462static int
463test_build_ports_range(void)

Callers 1

test_aclFunction · 0.85

Calls 7

rte_acl_createFunction · 0.85
rte_acl_resetFunction · 0.85
rte_acl_reset_rulesFunction · 0.85
test_classify_buidFunction · 0.85
test_classify_runFunction · 0.85
rte_acl_freeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected