* Helper function for acl_check_alg. * Check support for x86 specific classify methods. */
| 157 | * Check support for x86 specific classify methods. |
| 158 | */ |
| 159 | static int |
| 160 | acl_check_alg_x86(enum rte_acl_classify_alg alg) |
| 161 | { |
| 162 | if (alg == RTE_ACL_CLASSIFY_AVX512X32) { |
| 163 | #ifdef CC_AVX512_SUPPORT |
| 164 | if (acl_check_avx512_cpu_flags() != 0 && |
| 165 | rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512) |
| 166 | return 0; |
| 167 | #endif |
| 168 | return -ENOTSUP; |
| 169 | } |
| 170 | |
| 171 | if (alg == RTE_ACL_CLASSIFY_AVX512X16) { |
| 172 | #ifdef CC_AVX512_SUPPORT |
| 173 | if (acl_check_avx512_cpu_flags() != 0 && |
| 174 | rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256) |
| 175 | return 0; |
| 176 | #endif |
| 177 | return -ENOTSUP; |
| 178 | } |
| 179 | |
| 180 | if (alg == RTE_ACL_CLASSIFY_AVX2) { |
| 181 | #ifdef RTE_ARCH_X86 |
| 182 | if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) && |
| 183 | rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256) |
| 184 | return 0; |
| 185 | #endif |
| 186 | return -ENOTSUP; |
| 187 | } |
| 188 | |
| 189 | if (alg == RTE_ACL_CLASSIFY_SSE) { |
| 190 | #ifdef RTE_ARCH_X86 |
| 191 | if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1) && |
| 192 | rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) |
| 193 | return 0; |
| 194 | #endif |
| 195 | return -ENOTSUP; |
| 196 | } |
| 197 | |
| 198 | return -EINVAL; |
| 199 | } |
| 200 | |
| 201 | /* |
| 202 | * Check if input alg is supported by given platform/binary. |
no test coverage detected