DPDK patches and discussions
 help / color / mirror / Atom feed
From: Fiona Trahe <fiona.trahe@intel.com>
To: dev@dpdk.org
Cc: Declan.doherty@intel.com, Arek Kusztal <arkadiuszx.kusztal@intel.com>
Subject: [dpdk-dev] [PATCH v2 1/2] driver/crypto: out-of-place symmetric operations
Date: Tue, 29 Mar 2016 15:14:41 +0100	[thread overview]
Message-ID: <1459260882-6956-2-git-send-email-fiona.trahe@intel.com> (raw)
In-Reply-To: <1459244349-20476-1-git-send-email-fiona.trahe@intel.com>

From: Arek Kusztal <arkadiuszx.kusztal@intel.com>

This patch adds out-of-place operations to qat symmetric crypto PMD,
i.e. the result of the operation can be written to the destination buffer
instead of overwriting the source buffer as done in "in-place" operation.
Both buffers can be of different sizes.
Previously the qat PMD assumed that m_src and m_dst in rte_crypto_sym_op 
were identical.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 doc/guides/cryptodevs/qat.rst   |    1 -
 drivers/crypto/qat/qat_crypto.c |   22 +++++++++++++---------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/doc/guides/cryptodevs/qat.rst b/doc/guides/cryptodevs/qat.rst
index af90b46..4b8f782 100644
--- a/doc/guides/cryptodevs/qat.rst
+++ b/doc/guides/cryptodevs/qat.rst
@@ -62,7 +62,6 @@ Limitations
 * Chained mbufs are not supported.
 * Hash only is not supported except Snow3G UIA2.
 * Cipher only is not supported except Snow3G UEA2.
-* Only in-place is currently supported (destination address is the same as source address).
 * Only supports the session-oriented API implementation (session-less APIs are not supported).
 * Not performance tuned.
 * Snow3g(UEA2) supported only if cipher length, cipher offset fields are byte-aligned.
diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index 29c1fe5..55884d6 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -689,17 +689,21 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg)
 	*qat_req = ctx->fw_req;
 	qat_req->comn_mid.opaque_data = (uint64_t)(uintptr_t)op;
 
-	/*
-	 * The following code assumes:
-	 * - single entry buffer.
-	 * - always in place.
-	 */
 	qat_req->comn_mid.dst_length =
-			qat_req->comn_mid.src_length =
-					rte_pktmbuf_data_len(op->sym->m_src);
+		qat_req->comn_mid.src_length =
+				rte_pktmbuf_data_len(op->sym->m_src);
+
 	qat_req->comn_mid.dest_data_addr =
-			qat_req->comn_mid.src_data_addr =
-					rte_pktmbuf_mtophys(op->sym->m_src);
+		qat_req->comn_mid.src_data_addr =
+			    rte_pktmbuf_mtophys(op->sym->m_src);
+
+	if (unlikely(op->sym->m_dst != NULL)) {
+		qat_req->comn_mid.dest_data_addr =
+				rte_pktmbuf_mtophys(op->sym->m_dst);
+		qat_req->comn_mid.dst_length =
+				rte_pktmbuf_data_len(op->sym->m_dst);
+	}
+
 	cipher_param = (void *)&qat_req->serv_specif_rqpars;
 	auth_param = (void *)((uint8_t *)cipher_param + sizeof(*cipher_param));
 
-- 
1.7.0.7

  parent reply	other threads:[~2016-03-29 14:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29  9:39 [dpdk-dev] [PATCH 0/2] Out of place operations for symmetric crypto Fiona Trahe
2016-03-29  9:39 ` [dpdk-dev] [PATCH 1/2] driver/crypto: out-of-place symmetric operations Fiona Trahe
2016-03-29 12:02   ` Thomas Monjalon
2016-03-29 12:14     ` Jain, Deepak K
2016-03-29  9:39 ` [dpdk-dev] [PATCH 2/2] app/test: added test for " Fiona Trahe
2016-03-29 14:14 ` [dpdk-dev] [PATCH v2 0/2] Out of place operations for symmetric crypto Fiona Trahe
2016-03-30 15:52   ` John Griffin
2016-03-31 19:45     ` Thomas Monjalon
2016-03-29 14:14 ` Fiona Trahe [this message]
2016-03-29 14:14 ` [dpdk-dev] [PATCH v2 2/2] app/test: added test for out-of-place symmetric operations Fiona Trahe

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=1459260882-6956-2-git-send-email-fiona.trahe@intel.com \
    --to=fiona.trahe@intel.com \
    --cc=Declan.doherty@intel.com \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=dev@dpdk.org \
    /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).