From: Arek Kusztal Date: Thu, 18 Mar 2021 13:16:17 +0000 (+0000) Subject: crypto/qat: fix offset for out-of-place scatter-gather X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=935da450b414610a3aa2855fb9bb0c6f105e59ba;p=dpdk.git crypto/qat: fix offset for out-of-place scatter-gather This commit fixes problem with to small offset when both offsets (auth, cipher) are non zero in digest encrypt case, when using out-of-place and sgl. Fixes: 40002f6c2a24 ("crypto/qat: extend support for digest-encrypted auth-cipher") Cc: stable@dpdk.org Signed-off-by: Arek Kusztal Acked-by: Declan Doherty --- diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c index 2c0f5cd925..a1f5676c04 100644 --- a/drivers/crypto/qat/qat_sym.c +++ b/drivers/crypto/qat/qat_sym.c @@ -228,6 +228,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg, uint8_t do_sgl = 0; uint8_t in_place = 1; int alignment_adjustment = 0; + int oop_shift = 0; struct rte_crypto_op *op = (struct rte_crypto_op *)in_op; struct qat_sym_op_cookie *cookie = (struct qat_sym_op_cookie *)op_cookie; @@ -538,6 +539,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg, rte_pktmbuf_iova_offset(op->sym->m_src, min_ofs); dst_buf_start = rte_pktmbuf_iova_offset(op->sym->m_dst, min_ofs); + oop_shift = min_ofs; } else { /* In-place operation @@ -598,7 +600,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg, /* First find the end of the data */ if (do_sgl) { uint32_t remaining_off = auth_param->auth_off + - auth_param->auth_len + alignment_adjustment; + auth_param->auth_len + alignment_adjustment + oop_shift; struct rte_mbuf *sgl_buf = (in_place ? op->sym->m_src : op->sym->m_dst);