Add cqe treatment of the cryptodev.

Signed-off-by: Hanxiao Li <li.hanx...@zte.com.cn>
---
 drivers/crypto/zsda/zsda_sym.c | 16 ++++++++++++++++
 drivers/crypto/zsda/zsda_sym.h |  2 ++
 2 files changed, 18 insertions(+)

diff --git a/drivers/crypto/zsda/zsda_sym.c b/drivers/crypto/zsda/zsda_sym.c
index c6eec63c43..a56b1f3e7b 100644
--- a/drivers/crypto/zsda/zsda_sym.c
+++ b/drivers/crypto/zsda/zsda_sym.c
@@ -255,3 +255,19 @@ zsda_build_hash_request(void *op_in, const struct 
zsda_queue *queue,
 
        return ret;
 }
+
+int
+zsda_crypto_callback(void *cookie_in, struct zsda_cqe *cqe)
+{
+       struct zsda_op_cookie *tmp_cookie = cookie_in;
+       struct rte_crypto_op *op = tmp_cookie->op;
+
+       if (!(CQE_ERR0(cqe->err0) || CQE_ERR1(cqe->err1)))
+               op->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
+       else {
+               op->status = RTE_CRYPTO_OP_STATUS_ERROR;
+               return ZSDA_FAILED;
+       }
+
+       return ZSDA_SUCCESS;
+}
diff --git a/drivers/crypto/zsda/zsda_sym.h b/drivers/crypto/zsda/zsda_sym.h
index be550e4850..cc01356219 100644
--- a/drivers/crypto/zsda/zsda_sym.h
+++ b/drivers/crypto/zsda/zsda_sym.h
@@ -44,4 +44,6 @@ int zsda_encry_match(const void *op_in);
 int zsda_decry_match(const void *op_in);
 int zsda_hash_match(const void *op_in);
 
+int zsda_crypto_callback(void *cookie_in, struct zsda_cqe *cqe);
+
 #endif /* _ZSDA_SYM_H_ */
-- 
2.27.0

Reply via email to