]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crypto/qat: fix issues about QAT based Encryption for RGW
authorMiaomiao Liu <miaomiao.liu@intel.com>
Fri, 14 Jan 2022 05:44:15 +0000 (13:44 +0800)
committerMiaomiao Liu <miaomiao.liu@intel.com>
Tue, 8 Feb 2022 06:06:07 +0000 (14:06 +0800)
update the librares usage and add a namespace before ostream

Fixes: https://tracker.ceph.com/issues/54059
Signed-off-by: Miaomiao Liu <miaomiao.liu@intel.com>
Signed-off-by: Hualong Feng <hualong.feng@intel.com>
src/crypto/qat/CMakeLists.txt
src/crypto/qat/qat_crypto_plugin.h
src/crypto/qat/qcccrypto.cc

index ea4c1e25d14ab55ff0e59bba98ab5a0fd4b6b8d8..fb751967a97a1cae215b7cdb722be72cc16ea912 100644 (file)
@@ -2,24 +2,19 @@
 # QAT wrapper for Ceph
 ##
 
-# Build QAT driver library first
-include(BuildQatDrv)
-
 set(qat_crypto_plugin_srcs
   qat_crypto_accel.cc
   qat_crypto_plugin.cc
   qcccrypto.cc)
 
 add_library(ceph_crypto_qat SHARED ${qat_crypto_plugin_srcs})
-add_dependencies(ceph_crypto_qat QatDrv)
-target_include_directories(ceph_crypto_qat PRIVATE
-  ${EXTRA_LIBS}
-  ${QatDrv_INCLUDE_DIRS})
 
 add_dependencies(crypto_plugins ceph_crypto_qat)
 
-target_link_libraries(ceph_crypto_qat
-  ${QatDrv_LIBRARIES})
+target_link_libraries(ceph_crypto_qat PRIVATE
+                      QatDrv::qat_s
+                      QatDrv::usdm_drv_s)
+
 add_dependencies(crypto_plugins ceph_crypto_qat)
 set_target_properties(ceph_crypto_qat PROPERTIES VERSION 1.0.0 SOVERSION 1)
 install(TARGETS ceph_crypto_qat DESTINATION ${crypto_plugin_dir})
index 736f14706cc562ca7750591fe27fd96f44d7a99c..a8d4df7cb8f7e4796cc7fac2be0ba6bf3246cef4 100644 (file)
@@ -29,8 +29,7 @@ public:
   {}
   ~QccCryptoPlugin()
   {}
-  virtual int factory(CryptoAccelRef *cs,
-      ostream *ss)
+  virtual int factory(CryptoAccelRef *cs, std::ostream *ss)
   {
     std::lock_guard<std::mutex> l(qat_init);
     if (cryptoaccel == nullptr)
index 410727d3b61961480fa3013be6db75368289cfc8..a3f2537264348fcb79dec5ff2a0ec48785836b8f 100644 (file)
@@ -4,6 +4,8 @@
 #include <pthread.h>
 #include "common/debug.h"
 #include "include/scope_guard.h"
+#include "common/dout.h"
+#include "common/errno.h"
 
 // -----------------------------------------------------------------------------
 #define dout_context g_ceph_context
@@ -11,8 +13,7 @@
 #undef dout_prefix
 #define dout_prefix _prefix(_dout)
 
-static ostream&
-_prefix(std::ostream* _dout)
+static std::ostream& _prefix(std::ostream* _dout)
 {
   return *_dout << "QccCrypto: ";
 }
@@ -28,6 +29,7 @@ static std::atomic<bool> init_called = { false };
 void* QccCrypto::crypt_thread(void *args) {
   struct qcc_thread_args *thread_args = (struct qcc_thread_args *)args;
   thread_args->qccinstance->do_crypt(thread_args);
+  return thread_args;
 }
 
 void QccCrypto::QccFreeInstance(int entry) {