[dpdk-dev] [PATCH v4 6/8] eal/x86: identify AVX512 extensions flag

David Marchand david.marchand at redhat.com
Wed Apr 15 15:31:57 CEST 2020


On Wed, Apr 15, 2020 at 11:14 AM Marvin Liu <yong.liu at intel.com> wrote:
>
> Read CPUID to check if AVX512 extensions are supported.
>
> Signed-off-by: Marvin Liu <yong.liu at intel.com>
>
> diff --git a/lib/librte_eal/common/arch/x86/rte_cpuflags.c b/lib/librte_eal/common/arch/x86/rte_cpuflags.c
> index 6492df556..54e9f6185 100644
> --- a/lib/librte_eal/common/arch/x86/rte_cpuflags.c
> +++ b/lib/librte_eal/common/arch/x86/rte_cpuflags.c
> @@ -109,6 +109,9 @@ const struct feature_entry rte_cpu_feature_table[] = {
>         FEAT_DEF(RTM, 0x00000007, 0, RTE_REG_EBX, 11)
>         FEAT_DEF(AVX512F, 0x00000007, 0, RTE_REG_EBX, 16)
>         FEAT_DEF(RDSEED, 0x00000007, 0, RTE_REG_EBX, 18)
> +       FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
> +       FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
> +       FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
>
>         FEAT_DEF(LAHF_SAHF, 0x80000001, 0, RTE_REG_ECX,  0)
>         FEAT_DEF(LZCNT, 0x80000001, 0, RTE_REG_ECX,  4)
> diff --git a/lib/librte_eal/common/include/arch/x86/rte_cpuflags.h b/lib/librte_eal/common/include/arch/x86/rte_cpuflags.h
> index 25ba47b96..5bf99e05f 100644
> --- a/lib/librte_eal/common/include/arch/x86/rte_cpuflags.h
> +++ b/lib/librte_eal/common/include/arch/x86/rte_cpuflags.h
> @@ -98,6 +98,9 @@ enum rte_cpu_flag_t {
>         RTE_CPUFLAG_RTM,                    /**< Transactional memory */
>         RTE_CPUFLAG_AVX512F,                /**< AVX512F */
>         RTE_CPUFLAG_RDSEED,                 /**< RDSEED instruction */
> +       RTE_CPUFLAG_AVX512CD,               /**< AVX512CD */
> +       RTE_CPUFLAG_AVX512BW,               /**< AVX512BW */
> +       RTE_CPUFLAG_AVX512VL,               /**< AVX512VL */
>
>         /* (EAX 80000001h) ECX features */
>         RTE_CPUFLAG_LAHF_SAHF,              /**< LAHF_SAHF */

This patch most likely breaks the ABI (renumbering flags after
RTE_CPUFLAG_LAHF_SAHF).
This change should not go through the virtio tree and is not rebased on master.
A similar patch had been proposed by Kevin:
http://patchwork.dpdk.org/patch/67438/


-- 
David Marchand



More information about the dev mailing list