crypto-ipsecmb: call init_mb_mgr_auto instead of the logic implemented on the plugin... 47/42447/3
authorPiotr Bronowski <[email protected]>
Sun, 2 Mar 2025 21:45:55 +0000 (21:45 +0000)
committerFan Zhang <[email protected]>
Thu, 24 Apr 2025 12:06:37 +0000 (12:06 +0000)
This patch replaces logic for calling init version  with the supported vector instruction set
for a given processor family in the plugin with the call to init_mb_mgr_auto,
which correctly implements it on the ipsecmb engine side.

Type: improvement

Change-Id: I43e502f622f5cc5613917e1c5c943c0ff27d8982
Signed-off-by: Piotr Bronowski <[email protected]>
src/crypto_engines/ipsecmb/ipsecmb.c

index 9981d73..3006c52 100644 (file)
@@ -861,6 +861,7 @@ crypto_ipsecmb_init (vnet_crypto_engine_registration_t *r)
   ipsecmb_alg_data_t *ad;
   ipsecmb_per_thread_data_t *ptd;
   IMB_MGR *m = 0;
+  IMB_ARCH arch;
 
   if (!clib_cpu_supports_aes ())
     return "AES ISA not available on this CPU";
@@ -875,12 +876,8 @@ crypto_ipsecmb_init (vnet_crypto_engine_registration_t *r)
        clib_memset_u8 (ptd->burst_jobs, 0,
                        sizeof (IMB_JOB) * IMB_MAX_BURST_SIZE);
 #endif
-       if (clib_cpu_supports_avx512f ())
-         init_mb_mgr_avx512 (ptd->mgr);
-       else if (clib_cpu_supports_avx2 () && clib_cpu_supports_bmi2 ())
-         init_mb_mgr_avx2 (ptd->mgr);
-       else
-         init_mb_mgr_sse (ptd->mgr);
+
+       init_mb_mgr_auto (ptd->mgr, &arch);
 
        if (ptd == imbm->per_thread_data)
          m = ptd->mgr;