src/dpdk/lib/librte_acl/rte_acl.c
static int
acl_check_alg_x86(enum rte_acl_classify_alg alg)
{
	if (alg == RTE_ACL_CLASSIFY_AVX512X32) {
#ifdef CC_AVX512_SUPPORT
		if (acl_check_avx512_cpu_flags() != 0 &&
			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512)
			return 0;
#endif
		return -ENOTSUP;
	}

	if (alg == RTE_ACL_CLASSIFY_AVX512X16) {
#ifdef CC_AVX512_SUPPORT
		if (acl_check_avx512_cpu_flags() != 0 &&
			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
			return 0;
#endif
		return -ENOTSUP;
	}

	if (alg == RTE_ACL_CLASSIFY_AVX2) {
#ifdef CC_AVX2_SUPPORT
		if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) &&
				rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
			return 0;
#endif
		return -ENOTSUP;
	}

	if (alg == RTE_ACL_CLASSIFY_SSE) {
#ifdef RTE_ARCH_X86
		if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1) &&
				rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128)
			return 0;
#endif
		return -ENOTSUP;
	}

	return -EINVAL;
}
/*
 * Helper function for acl_check_alg.
 * Check support for x86 specific classify methods.
 */
Helper function for acl_check_alg.
Check support for x86 specific classify methods.
Helper function for acl_check_alg . Check support for x86 specific classify methods .
static int
acl_check_alg_x86(enum rte_acl_classify_alg alg)
{
	if (alg == RTE_ACL_CLASSIFY_AVX512X32) {
#ifdef CC_AVX512_SUPPORT
		if (acl_check_avx512_cpu_flags() != 0 &&
			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512)
			return 0;
#endif
		return -ENOTSUP;
	}
	if (alg == RTE_ACL_CLASSIFY_AVX512X16) {
#ifdef CC_AVX512_SUPPORT
		if (acl_check_avx512_cpu_flags() != 0 &&
			rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
			return 0;
#endif
		return -ENOTSUP;
	}
	if (alg == RTE_ACL_CLASSIFY_AVX2) {
#ifdef CC_AVX2_SUPPORT
		if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) &&
				rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
			return 0;
#endif
		return -ENOTSUP;
	}
	if (alg == RTE_ACL_CLASSIFY_SSE) {
#ifdef RTE_ARCH_X86
		if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1) &&
				rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128)
			return 0;
#endif
		return -ENOTSUP;
	}
	return -EINVAL;
}
static int acl_check_alg_x86 ( enum rte_acl_classify_alg alg ) { if ( alg == RTE_ACL_CLASSIFY_AVX512X32 ) { #ifdef CC_AVX512_SUPPORT if ( acl_check_avx512_cpu_flags ( ) != 0 && rte_vect_get_max_simd_bitwidth ( ) >= RTE_VECT_SIMD_512 ) return 0 ; #endif return - ENOTSUP ; } if ( alg == RTE_ACL_CLASSIFY_AVX512X16 ) { #ifdef CC_AVX512_SUPPORT if ( acl_check_avx512_cpu_flags ( ) != 0 && rte_vect_get_max_simd_bitwidth ( ) >= RTE_VECT_SIMD_256 ) return 0 ; #endif return - ENOTSUP ; } if ( alg == RTE_ACL_CLASSIFY_AVX2 ) { #ifdef CC_AVX2_SUPPORT if ( rte_cpu_get_flag_enabled ( RTE_CPUFLAG_AVX2 ) && rte_vect_get_max_simd_bitwidth ( ) >= RTE_VECT_SIMD_256 ) return 0 ; #endif return - ENOTSUP ; } if ( alg == RTE_ACL_CLASSIFY_SSE ) { #ifdef RTE_ARCH_X86 if ( rte_cpu_get_flag_enabled ( RTE_CPUFLAG_SSE4_1 ) && rte_vect_get_max_simd_bitwidth ( ) >= RTE_VECT_SIMD_128 ) return 0 ; #endif return - ENOTSUP ; } return - EINVAL ; }
Helper function for acl_check_alg.
Helper function for acl_check_alg .