From: Yao guotao Date: Mon, 11 Dec 2023 09:55:22 +0000 (+0800) Subject: The compilation of ISAL compress in the current code depends on the macro HAVE_NASM_X... X-Git-Tag: v21.0.0~256^2~796^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b31fbab5bef3f5a18dfc7ab6a7f41ed78b5af1a8;p=ceph.git The compilation of ISAL compress in the current code depends on the macro HAVE_NASM_X64_AVX2. However, the macro HAVE_NASM_X64_AVX2 has been removed, resulting in the compression not using ISAL even if the compressor_zlib_isal parameter is set to true. fix: https://tracker.ceph.com/issues/63780 Signed-off-by: Yao guotao --- diff --git a/src/compressor/zlib/ZlibCompressor.cc b/src/compressor/zlib/ZlibCompressor.cc index f37edc70a0f7..b25eef488a30 100644 --- a/src/compressor/zlib/ZlibCompressor.cc +++ b/src/compressor/zlib/ZlibCompressor.cc @@ -63,6 +63,14 @@ QatAccel ZlibCompressor::qat_accel; ZlibCompressor::ZlibCompressor(CephContext *cct, bool isal) : Compressor(COMP_ALG_ZLIB, "zlib"), isal_enabled(isal), cct(cct) { + +#if !(__x86_64__ && defined(HAVE_NASM_X64_AVX2)) || defined(__aarch64__) + if (isal_enabled) { + derr << "WARN: ISA-L enabled (compressor_zlib_isal=true) but not supported" + << dendl; + } +#endif + #ifdef HAVE_QATZIP if (cct->_conf->qat_compressor_enabled && qat_accel.init("zlib")) qat_enabled = true; diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake index c983eff39637..91c64da5b838 100644 --- a/src/include/config-h.in.cmake +++ b/src/include/config-h.in.cmake @@ -250,6 +250,9 @@ /* we have a recent nasm and are x86_64 */ #cmakedefine HAVE_NASM_X64 +/* nasm can also build the isa-l:avx2 */ +#cmakedefine HAVE_NASM_X64_AVX2 + /* nasm can also build the isa-l:avx512 */ #cmakedefine HAVE_NASM_X64_AVX512