crypto/qat: fix NULL authentication hang
authorArek Kusztal <arkadiuszx.kusztal@intel.com>
Fri, 21 Apr 2017 08:11:30 +0000 (09:11 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 19 Jul 2017 11:10:40 +0000 (14:10 +0300)
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 <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
drivers/crypto/qat/qat_adf/qat_algs_build_desc.c

index 596d856..cff8d12 100644 (file)
@@ -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(