From: Kai Ji Date: Tue, 29 Jun 2021 15:19:07 +0000 (+0100) Subject: crypto/aesni_gcm: fix performance on some AVX512 CPUs X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=93d5bdb5e39a46dad5d87e2317cc59a483cdc3a3;p=dpdk.git crypto/aesni_gcm: fix performance on some AVX512 CPUs This patch fixes the aesni_gcm performance issue on systems with AVX512 CPU flag presented but with VAES CPU flag missing, such as Skylake. Fixes: 81fe96a0cece ("crypto/aesni_gcm: use architecture independent API") Cc: stable@dpdk.org Signed-off-by: Kai Ji Acked-by: Fan Zhang --- diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index bc87e44a9d..886e2a5aaa 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -842,8 +842,14 @@ aesni_gcm_create(const char *name, init_mb_mgr_avx2(mb_mgr); break; case RTE_AESNI_GCM_AVX512: - dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX512; - init_mb_mgr_avx512(mb_mgr); + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_VAES)) { + dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX512; + init_mb_mgr_avx512(mb_mgr); + } else { + dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX2; + init_mb_mgr_avx2(mb_mgr); + vector_mode = RTE_AESNI_GCM_AVX2; + } break; default: AESNI_GCM_LOG(ERR, "Unsupported vector mode %u\n", vector_mode);