* Check if input alg is supported by given platform/binary. * Note that both conditions should be met: * - at build time compiler supports ISA used by given methods * - at run time target cpu supports necessary ISA. */
| 205 | * - at run time target cpu supports necessary ISA. |
| 206 | */ |
| 207 | static int |
| 208 | acl_check_alg(enum rte_acl_classify_alg alg) |
| 209 | { |
| 210 | switch (alg) { |
| 211 | case RTE_ACL_CLASSIFY_NEON: |
| 212 | return acl_check_alg_arm(alg); |
| 213 | case RTE_ACL_CLASSIFY_ALTIVEC: |
| 214 | return acl_check_alg_ppc(alg); |
| 215 | case RTE_ACL_CLASSIFY_AVX512X32: |
| 216 | case RTE_ACL_CLASSIFY_AVX512X16: |
| 217 | case RTE_ACL_CLASSIFY_AVX2: |
| 218 | case RTE_ACL_CLASSIFY_SSE: |
| 219 | return acl_check_alg_x86(alg); |
| 220 | /* scalar method is supported on all platforms */ |
| 221 | case RTE_ACL_CLASSIFY_SCALAR: |
| 222 | return 0; |
| 223 | default: |
| 224 | return -EINVAL; |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | /* |
| 229 | * Get preferred alg for given platform. |
no test coverage detected