From: Qiaowei Ren Date: Fri, 29 Dec 2017 04:50:20 +0000 (+0800) Subject: compressor: add QAT support X-Git-Tag: v14.0.0~222^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9f3965aef3f1ddf706119d7b2f5540c799f2da0e;p=ceph.git compressor: add QAT support This patch adds new QATzip plugin to support QAT for compression. QATZip is a user space library which builds on top of the Intel QAT (QuickAssist Technology) user space library, to provide extended accelerated compression and decompression services by offloading the actual compression and decompression request(s) to the hardware QAT accelerators, which are more efficient in terms of cost and power than general purpose CPUs for those specific compute-intensive workloads. Based on QAT accelerators, QATZip can support several compression algorithm, including deflate, snappy, lz4, etc.. Signed-off-by: Qiaowei Ren --- diff --git a/CMakeLists.txt b/CMakeLists.txt index bc4cb19bce0c..d86acfd68b61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,6 +258,12 @@ endif() option(WITH_BLUEFS "libbluefs library" OFF) +option(WITH_QATZIP "Enable QATZIP" OFF) +if(WITH_QATZIP) + find_package(qatzip REQUIRED) + set(HAVE_QATZIP ${QATZIP_FOUND}) +endif(WITH_QATZIP) + # needs mds and? XXX option(WITH_LIBCEPHFS "libcephfs client library" ON) diff --git a/cmake/modules/Findqatzip.cmake b/cmake/modules/Findqatzip.cmake new file mode 100644 index 000000000000..3a593228dd01 --- /dev/null +++ b/cmake/modules/Findqatzip.cmake @@ -0,0 +1,17 @@ +# - Find Qatzip +# Find the qatzip compression library and includes +# +# QATZIP_INCLUDE_DIR - where to find qatzip.h, etc. +# QATZIP_LIBRARIES - List of libraries when using qatzip. +# QATZIP_FOUND - True if qatzip found. + +find_path(QATZIP_INCLUDE_DIR NAMES qatzip.h) + +find_library(QATZIP_LIBRARIES NAMES qatzip) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(qatzip DEFAULT_MSG QATZIP_LIBRARIES QATZIP_INCLUDE_DIR) + +mark_as_advanced( + QATZIP_LIBRARIES + QATZIP_INCLUDE_DIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 874e7f3ae12d..a5b975e66a0e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -648,6 +648,9 @@ endif() if(NOT WITH_SYSTEM_BOOST) list(APPEND ceph_common_deps ${ZLIB_LIBRARIES}) endif() +if(HAVE_QATZIP) + list(APPEND ceph_common_deps ${QATZIP_LIBRARIES}) +endif() set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ceph_ver.c ${CMAKE_SOURCE_DIR}/src/common/version.cc diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 69fbc51c1935..981bd2019728 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -94,6 +94,8 @@ OPTION(xio_max_send_inline, OPT_INT) // xio maximum threshold to send inline OPTION(compressor_zlib_isal, OPT_BOOL) OPTION(compressor_zlib_level, OPT_INT) //regular zlib compression level, not applicable to isa-l optimized version +OPTION(qat_compressor_enabled, OPT_BOOL) + OPTION(plugin_crypto_accelerator, OPT_STR) OPTION(mempool_debug, OPT_BOOL) diff --git a/src/common/options.cc b/src/common/options.cc index e5b3d2de839f..8ad7db20fb88 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -776,6 +776,10 @@ std::vector