From: Arek Kusztal Date: Fri, 21 Apr 2017 08:11:30 +0000 (+0100) Subject: crypto/qat: fix NULL authentication hang X-Git-Tag: spdx-start~2412 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=426dc9e3018dcdb0db9b2c58405d9ee5f28b0b00;p=dpdk.git crypto/qat: fix NULL authentication hang To avoid a possible HW problem when dealing with NULL authentication case, the state sizes in the request descriptor are set. Fixes: db0e952a5c01 ("crypto/qat: add NULL capability") Cc: stable@dpdk.org Signed-off-by: Arek Kusztal Acked-by: Fiona Trahe --- diff --git a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c index 596d8563b3..cff8d12eff 100644 --- a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c +++ b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c @@ -121,6 +121,9 @@ static int qat_hash_get_state1_size(enum icp_qat_hw_auth_algo qat_hash_alg) case ICP_QAT_HW_AUTH_ALGO_KASUMI_F9: return QAT_HW_ROUND_UP(ICP_QAT_HW_KASUMI_F9_STATE1_SZ, QAT_HW_DEFAULT_ALIGNMENT); + case ICP_QAT_HW_AUTH_ALGO_NULL: + return QAT_HW_ROUND_UP(ICP_QAT_HW_NULL_STATE1_SZ, + QAT_HW_DEFAULT_ALIGNMENT); case ICP_QAT_HW_AUTH_ALGO_DELIMITER: /* return maximum state1 size in this case */ return QAT_HW_ROUND_UP(ICP_QAT_HW_SHA512_STATE1_SZ, @@ -867,6 +870,9 @@ int qat_alg_aead_session_create_content_desc_auth(struct qat_session *cdesc, state2_size = ICP_QAT_HW_MD5_STATE2_SZ; break; case ICP_QAT_HW_AUTH_ALGO_NULL: + state1_size = qat_hash_get_state1_size( + ICP_QAT_HW_AUTH_ALGO_NULL); + state2_size = ICP_QAT_HW_NULL_STATE2_SZ; break; case ICP_QAT_HW_AUTH_ALGO_KASUMI_F9: state1_size = qat_hash_get_state1_size(