* [dpdk-stable] [PATCH] crypto/qat: fix to small sgl oop min offset
@ 2021-03-18 13:16 Arek Kusztal
2021-04-14 8:51 ` Doherty, Declan
0 siblings, 1 reply; 3+ messages in thread
From: Arek Kusztal @ 2021-03-18 13:16 UTC (permalink / raw)
To: dev; +Cc: gakhil, fiona.trahe, declan.doherty, Arek Kusztal, stable
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 <arkadiuszx.kusztal@intel.com>
---
drivers/crypto/qat/qat_sym.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 4b7676deb..a6cd33be3 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -162,6 +162,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;
@@ -472,6 +473,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
@@ -532,7 +534,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);
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH] crypto/qat: fix to small sgl oop min offset
2021-03-18 13:16 [dpdk-stable] [PATCH] crypto/qat: fix to small sgl oop min offset Arek Kusztal
@ 2021-04-14 8:51 ` Doherty, Declan
2021-04-14 19:29 ` [dpdk-stable] [EXT] " Akhil Goyal
0 siblings, 1 reply; 3+ messages in thread
From: Doherty, Declan @ 2021-04-14 8:51 UTC (permalink / raw)
To: Arek Kusztal, dev; +Cc: gakhil, fiona.trahe, stable
On 18/03/2021 1:16 PM, Arek Kusztal wrote:
> 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 <arkadiuszx.kusztal@intel.com>
> ---
> drivers/crypto/qat/qat_sym.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
> index 4b7676deb..a6cd33be3 100644
> --- a/drivers/crypto/qat/qat_sym.c
> +++ b/drivers/crypto/qat/qat_sym.c
> @@ -162,6 +162,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;
> @@ -472,6 +473,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
> @@ -532,7 +534,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);
>
Acked-by: Declan Doherty <declan.doherty@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [EXT] Re: [PATCH] crypto/qat: fix to small sgl oop min offset
2021-04-14 8:51 ` Doherty, Declan
@ 2021-04-14 19:29 ` Akhil Goyal
0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2021-04-14 19:29 UTC (permalink / raw)
To: Doherty, Declan, Arek Kusztal, dev; +Cc: fiona.trahe, stable
> On 18/03/2021 1:16 PM, Arek Kusztal wrote:
> > 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 <arkadiuszx.kusztal@intel.com>
> > ---
>
> Acked-by: Declan Doherty <declan.doherty@intel.com>
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-14 19:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 13:16 [dpdk-stable] [PATCH] crypto/qat: fix to small sgl oop min offset Arek Kusztal
2021-04-14 8:51 ` Doherty, Declan
2021-04-14 19:29 ` [dpdk-stable] [EXT] " Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).