]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw, crypto plugin: now isal_crypto_plugin initializates only if CPU supports...
authorAdam Kupczyk <akupczyk@mirantis.com>
Fri, 24 Mar 2017 18:32:58 +0000 (19:32 +0100)
committerAdam Kupczyk <akupczyk@mirantis.com>
Wed, 5 Apr 2017 16:31:58 +0000 (18:31 +0200)
Signed-off-by: Adam Kupczyk <akupczyk@mirantis.com>
src/crypto/isa-l/isal_crypto_plugin.h

index 7f30da729e74eb837dfff657b5a53de145501c4a..e8749dc0568051f5ce1fc162cd3d12694377014b 100644 (file)
@@ -17,6 +17,8 @@
 // -----------------------------------------------------------------------------
 #include "crypto/crypto_plugin.h"
 #include "crypto/isa-l/isal_crypto_accel.h"
+#include "arch/intel.h"
+#include "arch/probe.h"
 // -----------------------------------------------------------------------------
 
 
@@ -34,7 +36,10 @@ public:
   {
     if (cryptoaccel == nullptr)
     {
-      cryptoaccel = CryptoAccelRef(new ISALCryptoAccel);
+      ceph_arch_probe();
+      if (ceph_arch_intel_aesni && ceph_arch_intel_sse41) {
+        cryptoaccel = CryptoAccelRef(new ISALCryptoAccel);
+      }
     }
     *cs = cryptoaccel;
     return 0;