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

Function acl_get_best_alg

dpdk/lib/acl/rte_acl.c:231–261  ·  view source on GitHub ↗

* Get preferred alg for given platform. */

Source from the content-addressed store, hash-verified

229 * Get preferred alg for given platform.
230 */
231static enum rte_acl_classify_alg
232acl_get_best_alg(void)
233{
234 /*
235 * array of supported methods for each platform.
236 * Note that order is important - from most to less preferable.
237 */
238 static const enum rte_acl_classify_alg alg[] = {
239#if defined(RTE_ARCH_ARM)
240 RTE_ACL_CLASSIFY_NEON,
241#elif defined(RTE_ARCH_PPC_64)
242 RTE_ACL_CLASSIFY_ALTIVEC,
243#elif defined(RTE_ARCH_X86)
244 RTE_ACL_CLASSIFY_AVX512X32,
245 RTE_ACL_CLASSIFY_AVX512X16,
246 RTE_ACL_CLASSIFY_AVX2,
247 RTE_ACL_CLASSIFY_SSE,
248#endif
249 RTE_ACL_CLASSIFY_SCALAR,
250 };
251
252 uint32_t i;
253
254 /* find best possible alg */
255 for (i = 0; i != RTE_DIM(alg) && acl_check_alg(alg[i]) != 0; i++)
256 ;
257
258 /* we always have to find something suitable */
259 RTE_VERIFY(i != RTE_DIM(alg));
260 return alg[i];
261}
262
263extern int
264rte_acl_set_ctx_classify(struct rte_acl_ctx *ctx, enum rte_acl_classify_alg alg)

Callers 2

rte_acl_set_ctx_classifyFunction · 0.85
rte_acl_createFunction · 0.85

Calls 1

acl_check_algFunction · 0.85

Tested by

no test coverage detected