@@ -419,7 +419,7 @@ qat_sym_build_op_auth_gen3(void *in_op, struct qat_sym_session *ctx,
rte_mov128((uint8_t *)req, (const uint8_t *)&(ctx->fw_req));
ofs.raw = qat_sym_convert_op_to_vec_auth(op, ctx, &in_sgl, &out_sgl,
- NULL, &auth_iv, &digest);
+ NULL, &auth_iv, &digest, op_cookie);
if (unlikely(ofs.raw == UINT64_MAX)) {
op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
return -EINVAL;
@@ -290,7 +290,8 @@ qat_sym_convert_op_to_vec_auth(struct rte_crypto_op *op,
struct rte_crypto_sgl *in_sgl, struct rte_crypto_sgl *out_sgl,
struct rte_crypto_va_iova_ptr *cipher_iv __rte_unused,
struct rte_crypto_va_iova_ptr *auth_iv,
- struct rte_crypto_va_iova_ptr *digest)
+ struct rte_crypto_va_iova_ptr *digest,
+ struct qat_sym_op_cookie *cookie)
{
uint32_t auth_ofs = 0, auth_len = 0;
int n_src, ret;
@@ -355,7 +356,11 @@ qat_sym_convert_op_to_vec_auth(struct rte_crypto_op *op,
out_sgl->num = 0;
digest->va = (void *)op->sym->auth.digest.data;
- digest->iova = op->sym->auth.digest.phys_addr;
+
+ if (ctx->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_NULL)
+ digest->iova = cookie->digest_null_phys_addr;
+ else
+ digest->iova = op->sym->auth.digest.phys_addr;
return 0;
}
@@ -366,7 +371,8 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op,
struct rte_crypto_sgl *in_sgl, struct rte_crypto_sgl *out_sgl,
struct rte_crypto_va_iova_ptr *cipher_iv,
struct rte_crypto_va_iova_ptr *auth_iv_or_aad,
- struct rte_crypto_va_iova_ptr *digest)
+ struct rte_crypto_va_iova_ptr *digest,
+ struct qat_sym_op_cookie *cookie)
{
union rte_crypto_sym_ofs ofs;
uint32_t max_len = 0;
@@ -390,7 +396,11 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op,
auth_iv_or_aad->iova = rte_crypto_op_ctophys_offset(op,
ctx->auth_iv.offset);
digest->va = (void *)op->sym->auth.digest.data;
- digest->iova = op->sym->auth.digest.phys_addr;
+
+ if (ctx->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_NULL)
+ digest->iova = cookie->digest_null_phys_addr;
+ else
+ digest->iova = op->sym->auth.digest.phys_addr;
ret = qat_cipher_is_len_in_bits(ctx, op);
switch (ret) {
@@ -274,7 +274,7 @@ qat_sym_build_op_auth_gen1(void *in_op, struct qat_sym_session *ctx,
rte_mov128((uint8_t *)req, (const uint8_t *)&(ctx->fw_req));
ofs.raw = qat_sym_convert_op_to_vec_auth(op, ctx, &in_sgl, &out_sgl,
- NULL, &auth_iv, &digest);
+ NULL, &auth_iv, &digest, op_cookie);
if (unlikely(ofs.raw == UINT64_MAX)) {
op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
return -EINVAL;
@@ -368,7 +368,7 @@ qat_sym_build_op_chain_gen1(void *in_op, struct qat_sym_session *ctx,
rte_mov128((uint8_t *)req, (const uint8_t *)&(ctx->fw_req));
ofs.raw = qat_sym_convert_op_to_vec_chain(op, ctx, &in_sgl, &out_sgl,
- &cipher_iv, &auth_iv, &digest);
+ &cipher_iv, &auth_iv, &digest, cookie);
if (unlikely(ofs.raw == UINT64_MAX)) {
op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
return -EINVAL;
@@ -51,6 +51,11 @@ qat_sym_init_op_cookie(void *op_cookie)
rte_mempool_virt2iova(cookie) +
offsetof(struct qat_sym_op_cookie,
opt.spc_gmac.cd_cipher);
+
+ cookie->digest_null_phys_addr =
+ rte_mempool_virt2iova(cookie) +
+ offsetof(struct qat_sym_op_cookie,
+ digest_null);
}
static __rte_always_inline int
@@ -117,6 +117,8 @@ struct qat_sym_op_cookie {
phys_addr_t cd_phys_addr;
} spc_gmac;
} opt;
+ uint8_t digest_null[4];
+ phys_addr_t digest_null_phys_addr;
};
struct qat_sym_dp_ctx {