From: Adam Dybkowski <adamx.dybkowski@intel.com>
To: dev@dpdk.org, fiona.trahe@intel.com, akhil.goyal@nxp.com,
adamx.dybkowski@intel.com
Subject: [dpdk-dev] [PATCH 1/3] crypto/qat: improve out-of-place conditional check
Date: Wed, 11 Mar 2020 13:26:06 +0100 [thread overview]
Message-ID: <20200311122608.1262-1-adamx.dybkowski@intel.com> (raw)
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
next reply other threads:[~2020-03-11 12:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 12:26 Adam Dybkowski [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200311122608.1262-1-adamx.dybkowski@intel.com \
--to=adamx.dybkowski@intel.com \
--cc=akhil.goyal@nxp.com \
--cc=dev@dpdk.org \
--cc=fiona.trahe@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).