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

Function test_classify_run

dpdk/app/test/test_acl.c:340–378  ·  view source on GitHub ↗

* Test ACL lookup (all possible methods). */

Source from the content-addressed store, hash-verified

338 * Test ACL lookup (all possible methods).
339 */
340static int
341test_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
380static int
381test_classify_buid(struct rte_acl_ctx *acx,

Callers 3

test_classifyFunction · 0.85
test_convert_rulesFunction · 0.85
test_u32_rangeFunction · 0.85

Calls 3

bswap_test_dataFunction · 0.85
test_classify_algFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected