-
-
Save FlorianHeigl/10627ede12497a3bd6105059712fc793 to your computer and use it in GitHub Desktop.
qzfs-fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 06cb8310a54a222437f5a84bbbe61111435a08bf Mon Sep 17 00:00:00 2001 | |
From: Yanfei Guo <[email protected]> | |
Date: Fri, 18 Apr 2025 19:48:19 +0000 | |
Subject: [PATCH] qat: wait for in-flight req to complete before remove session | |
reqs in session may be still in-flight after callback returns. | |
This results in session remove fail with message "There are %lu | |
requests pending". Adding a small loop to wait for the completion | |
of in-flight requests. | |
--- | |
module/os/linux/zfs/qat_crypt.c | 16 ++++++++++++++++ | |
1 file changed, 16 insertions(+) | |
diff --git a/module/os/linux/zfs/qat_crypt.c b/module/os/linux/zfs/qat_crypt.c | |
index 27965a36d..c55b33a94 100644 | |
--- a/module/os/linux/zfs/qat_crypt.c | |
+++ b/module/os/linux/zfs/qat_crypt.c | |
@@ -73,6 +73,18 @@ symcallback(void *p_callback, CpaStatus status, const CpaCySymOp operation, | |
} | |
} | |
+static void sym_session_wait_inflight_req(CpaCySymSessionCtx pSessionCtx) | |
+{ | |
+ CpaBoolean sessionInUse = CPA_FALSE; | |
+ | |
+ do | |
+ { | |
+ cpaCySymSessionInUse(pSessionCtx, &sessionInUse); | |
+ } while (sessionInUse); | |
+ | |
+ return; | |
+} | |
+ | |
boolean_t | |
qat_crypt_use_accel(size_t s_len) | |
{ | |
@@ -446,6 +458,8 @@ fail: | |
if (status != CPA_STATUS_SUCCESS) | |
QAT_STAT_BUMP(crypt_fails); | |
+ sym_session_wait_inflight_req(cy_session_ctx); | |
+ | |
for (i = 0; i < in_page_num; i++) | |
kunmap(in_pages[i]); | |
for (i = 0; i < out_page_num; i++) | |
@@ -564,6 +578,8 @@ fail: | |
if (status != CPA_STATUS_SUCCESS) | |
QAT_STAT_BUMP(cksum_fails); | |
+ sym_session_wait_inflight_req(cy_session_ctx); | |
+ | |
for (i = 0; i < page_num; i++) | |
kunmap(in_pages[i]); | |
-- | |
2.43.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment