From 603ad3ae915efff712d19875c8c7eb33fb71f0df Mon Sep 17 00:00:00 2001 From: Fiona Trahe Date: Wed, 11 Mar 2020 13:26:07 +0100 Subject: [PATCH] crypto/qat: optimise check for chained mbufs 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 Acked-by: Arek Kusztal --- drivers/crypto/qat/qat_sym.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c index cecced66d1..25b6dd5f47 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 */ -- 2.20.1