crypto-ipsecmb: fix plugin crash in VirtualBox 14/37614/3
authorMaros Ondrejicka <maros.ondrejicka@pantheon.tech>
Thu, 10 Nov 2022 13:11:40 +0000 (14:11 +0100)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 14 Nov 2022 21:03:02 +0000 (21:03 +0000)
Plugin checks just for AVX2 instruction set, while the v1.3 of IPsec
Multi-Buffer library checks for both AVX2 and BMI2 sets during init.
VirtualBox VM doesn't provide BMI2 by default to guest operating system.

Result is that VPP plugin decides to use AVX2 initialization and library
then doesn't do it. Since flush_job remains empty, the self-check fails
and with that the whole VPP crashes on start-up.

Type: fix
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I6b661f2b9bbe6dd03b499c55c38a9b814e6d718a

src/plugins/crypto_ipsecmb/ipsecmb.c
src/vppinfra/cpu.h

index 3ceda1e..02e1345 100644 (file)
@@ -928,7 +928,7 @@ crypto_ipsecmb_init (vlib_main_t * vm)
 #endif
        if (clib_cpu_supports_avx512f ())
          init_mb_mgr_avx512 (ptd->mgr);
-        else if (clib_cpu_supports_avx2 ())
+       else if (clib_cpu_supports_avx2 () && clib_cpu_supports_bmi2 ())
          init_mb_mgr_avx2 (ptd->mgr);
        else
          init_mb_mgr_sse (ptd->mgr);
index 3c5e59e..31049f5 100644 (file)
@@ -123,6 +123,7 @@ _CLIB_MARCH_FN_REGISTRATION(fn)
   _ (avx, 1, ecx, 28)                                                         \
   _ (rdrand, 1, ecx, 30)                                                      \
   _ (avx2, 7, ebx, 5)                                                         \
+  _ (bmi2, 7, ebx, 8)                                                         \
   _ (rtm, 7, ebx, 11)                                                         \
   _ (pqm, 7, ebx, 12)                                                         \
   _ (pqe, 7, ebx, 15)                                                         \