[v1] crypto/aesni_gcm: fix performance issue
Checks
Commit Message
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: pablo.de.lara.guarch@intel.com
Signed-off-by: Kai Ji <kai.ji@intel.com>
---
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
@@ -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);