DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/3] crypto/qat: improve out-of-place conditional check
@ 2020-03-11 12:26 Adam Dybkowski
  2020-03-11 12:26 ` [dpdk-dev] [PATCH 2/3] crypto/qat: optimise check for chained mbufs Adam Dybkowski
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Adam Dybkowski @ 2020-03-11 12:26 UTC (permalink / raw)
  To: dev, fiona.trahe, akhil.goyal, adamx.dybkowski

From: Fiona Trahe <fiona.trahe@intel.com>

Improve case where application set m_dst to same as m_src
so really an in-place operation, though would have been treated
as out-of-place. No functional change but this path can now benefit
from DMA alignment.

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

diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 5c9904cbf..cecced66d 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -62,7 +62,8 @@ qat_bpicipher_preprocess(struct qat_sym_session *ctx,
 		last_block = (uint8_t *) rte_pktmbuf_mtod_offset(sym_op->m_src,
 				uint8_t *, last_block_offset);
 
-		if (unlikely(sym_op->m_dst != NULL))
+		if (unlikely((sym_op->m_dst != NULL)
+				&& (sym_op->m_dst != sym_op->m_src)))
 			/* out-of-place operation (OOP) */
 			dst = (uint8_t *) rte_pktmbuf_mtod_offset(sym_op->m_dst,
 						uint8_t *, last_block_offset);
@@ -437,7 +438,8 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 	if (unlikely(min_ofs >= rte_pktmbuf_data_len(op->sym->m_src) && do_sgl))
 		min_ofs = 0;
 
-	if (unlikely(op->sym->m_dst != NULL)) {
+	if (unlikely((op->sym->m_dst != NULL) &&
+			(op->sym->m_dst != op->sym->m_src))) {
 		/* Out-of-place operation (OOP)
 		 * Don't align DMA start. DMA the minimum data-set
 		 * so as not to overwrite data in dest buffer
@@ -565,7 +567,7 @@ qat_sym_build_request(void *in_op, uint8_t *out_msg,
 			return ret;
 		}
 
-		if (likely(op->sym->m_dst == NULL))
+		if (in_place)
 			qat_req->comn_mid.dest_data_addr =
 				qat_req->comn_mid.src_data_addr =
 				cookie->qat_sgl_src_phys_addr;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-25 19:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 12:26 [dpdk-dev] [PATCH 1/3] crypto/qat: improve out-of-place conditional check Adam Dybkowski
2020-03-11 12:26 ` [dpdk-dev] [PATCH 2/3] crypto/qat: optimise check for chained mbufs Adam Dybkowski
2020-03-11 15:44   ` Kusztal, ArkadiuszX
2020-03-11 12:26 ` [dpdk-dev] [PATCH 3/3] common/qat: optimise calculation of cookie index Adam Dybkowski
2020-03-11 15:44   ` Kusztal, ArkadiuszX
2020-03-11 15:45 ` [dpdk-dev] [PATCH 1/3] crypto/qat: improve out-of-place conditional check Kusztal, ArkadiuszX
2020-03-25 19:06   ` 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).