diff mbox series

[2/3] crypto/qat: optimise check for chained mbufs

Message ID 20200311122608.1262-2-adamx.dybkowski@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers show
Series [1/3] crypto/qat: improve out-of-place conditional check | expand

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Dybkowski, AdamX March 11, 2020, 12:26 p.m. UTC
From: Fiona Trahe <fiona.trahe@intel.com>

To detect if sgl, use nb_segs > 1, instead of checking for next pointer,
as nb_segs is in first cache-line while next is in second cache-line.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 drivers/crypto/qat/qat_sym.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Kusztal, ArkadiuszX March 11, 2020, 3:44 p.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Adam Dybkowski
> Sent: Wednesday, March 11, 2020 1:26 PM
> To: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>;
> akhil.goyal@nxp.com; Dybkowski, AdamX <adamx.dybkowski@intel.com>
> Subject: [dpdk-dev] [PATCH 2/3] crypto/qat: optimise check for chained
> mbufs
> 
> From: Fiona Trahe <fiona.trahe@intel.com>
> 
> To detect if sgl, use nb_segs > 1, instead of checking for next pointer, as
> nb_segs is in first cache-line while next is in second cache-line.
> 
> Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
> ---
>  drivers/crypto/qat/qat_sym.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 2.17.1
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
diff mbox series

Patch

diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index cecced66d..25b6dd5f4 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -428,7 +428,8 @@  qat_sym_build_request(void *in_op, uint8_t *out_msg,
 		min_ofs = op->sym->aead.data.offset;
 	}
 
-	if (op->sym->m_src->next || (op->sym->m_dst && op->sym->m_dst->next))
+	if (op->sym->m_src->nb_segs > 1 ||
+			(op->sym->m_dst && op->sym->m_dst->nb_segs > 1))
 		do_sgl = 1;
 
 	/* adjust for chain case */