From: Mark Kogan Date: Tue, 20 Aug 2024 11:34:52 +0000 (+0000) Subject: warn when QAT switches to software [de]compression X-Git-Tag: testing/wip-rishabh-testing-20240930.143059~66^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4722fe742c60d68a98acf9b94d028bbd5794b022;p=ceph-ci.git warn when QAT switches to software [de]compression Fixes: https://tracker.ceph.com/issues/67631 Signed-off-by: Mark Kogan --- diff --git a/src/compressor/QatAccel.cc b/src/compressor/QatAccel.cc index c1c374a6836..0c378729bba 100644 --- a/src/compressor/QatAccel.cc +++ b/src/compressor/QatAccel.cc @@ -150,6 +150,7 @@ bool QatAccel::init(const std::string &alg) { } int QatAccel::compress(const bufferlist &in, bufferlist &out, std::optional &compressor_message) { + dout(20) << "QAT compress" << dendl; auto s = get_session(); // get a session from the pool if (!s) { return -1; // session initialization failed @@ -165,7 +166,15 @@ int QatAccel::compress(const bufferlist &in, bufferlist &out, std::optionalhw_session_stat != QZ_OK) { + if(sess->hw_session_stat == QZ_NO_HW) { + dout(1) << "QAT compressor NOT OK - Using SW: No QAT HW detected" << dendl; + } else { + dout(1) << "QAT compressor NOT OK - session state=" << sess->hw_session_stat << dendl; + } + } if (rc != QZ_OK) return -1; if (begin) { @@ -190,6 +199,7 @@ int QatAccel::decompress(bufferlist::const_iterator &p, size_t compressed_len, bufferlist &dst, std::optional compressor_message) { + dout(20) << "QAT decompress" << dendl; auto s = get_session(); // get a session from the pool if (!s) { return -1; // session initialization failed @@ -219,7 +229,15 @@ int QatAccel::decompress(bufferlist::const_iterator &p, } ptr = buffer::create_small_page_aligned(out_len); - rc = qzDecompress(session.get(), (const unsigned char*)c_in, &len_current, (unsigned char*)ptr.c_str(), &out_len); + QzSession_T *sess = session.get(); + rc = qzDecompress(sess, (const unsigned char*)c_in, &len_current, (unsigned char*)ptr.c_str(), &out_len); + if(sess->hw_session_stat != QZ_OK) { + if(sess->hw_session_stat == QZ_NO_HW) { + dout(1) << "QAT decompress NOT OK - Using SW: No QAT HW detected" << dendl; + } else { + dout(1) << "QAT decompress NOT OK - session state=" << sess->hw_session_stat << dendl; + } + } ratio_idx++; } while (rc == QZ_BUF_ERROR && ratio_idx < std::size(expansion_ratio)); c_in += len_current;