* Test ACL lookup (all possible methods). */
| 338 | * Test ACL lookup (all possible methods). |
| 339 | */ |
| 340 | static int |
| 341 | test_classify_run(struct rte_acl_ctx *acx, struct ipv4_7tuple test_data[], |
| 342 | size_t dim) |
| 343 | { |
| 344 | int32_t ret; |
| 345 | uint32_t i; |
| 346 | const uint8_t *data[dim]; |
| 347 | |
| 348 | static const enum rte_acl_classify_alg alg[] = { |
| 349 | RTE_ACL_CLASSIFY_SCALAR, |
| 350 | RTE_ACL_CLASSIFY_SSE, |
| 351 | RTE_ACL_CLASSIFY_AVX2, |
| 352 | RTE_ACL_CLASSIFY_NEON, |
| 353 | RTE_ACL_CLASSIFY_ALTIVEC, |
| 354 | RTE_ACL_CLASSIFY_AVX512X16, |
| 355 | RTE_ACL_CLASSIFY_AVX512X32, |
| 356 | }; |
| 357 | |
| 358 | /* swap all bytes in the data to network order */ |
| 359 | bswap_test_data(test_data, dim, 1); |
| 360 | |
| 361 | /* store pointers to test data */ |
| 362 | for (i = 0; i < dim; i++) |
| 363 | data[i] = (uint8_t *)&test_data[i]; |
| 364 | |
| 365 | ret = 0; |
| 366 | for (i = 0; i != RTE_DIM(alg); i++) { |
| 367 | ret = test_classify_alg(acx, test_data, data, dim, alg[i]); |
| 368 | if (ret < 0) { |
| 369 | printf("Line %i: %s() for alg=%d failed, errno=%d\n", |
| 370 | __LINE__, __func__, alg[i], -ret); |
| 371 | break; |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | /* swap data back to cpu order so that next time tests don't fail */ |
| 376 | bswap_test_data(test_data, dim, 0); |
| 377 | return ret; |
| 378 | } |
| 379 | |
| 380 | static int |
| 381 | test_classify_buid(struct rte_acl_ctx *acx, |
no test coverage detected