From: boris.brezillon@free-electrons.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 04/10] crypto: marvell: Copy IV vectors by DMA transfers for acipher requests
Date: Fri, 17 Jun 2016 14:49:13 +0200 [thread overview]
Message-ID: <20160617144913.1f70ed75@bbrezillon> (raw)
In-Reply-To: <1466162649-29911-5-git-send-email-romain.perier@free-electrons.com>
On Fri, 17 Jun 2016 13:24:03 +0200
Romain Perier <romain.perier@free-electrons.com> wrote:
> Add a TDMA descriptor at the end of the request for copying the
> output IV vector via a DMA transfer. This is a good way for offloading
> as much as processing as possible to the DMA and the crypto engine.
> This is also required for processing multiple cipher requests
> in chained mode, otherwise the content of the IV vector would be
> overwritten by the last processed request.
>
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
After fixing the coding style issue,
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
>
> Changes in v2:
> - Reworded the commit message, the term 'asynchronously' was
> ambigous
> - Changed the value of CESA_TDMA_IV from 4 to 3
> - Adding missing blank lines
> - Rewrote the function mv_cesa_ablkcipher_process to something more
> readable.
> - Fixed a bug about how the type of a TDMA operation was tested in
> mv_cesa_dma_cleanup and mv_cesa_dma_prepare, I created a separated
> commit for that (see PATCH 03/10)
> - Renamed variables in mv_cesa_dma_add_iv_op
> - Removed the flag CESA_TDMA_DATA from mv_cesa_dma_add_iv_op (not
> needed)
>
> drivers/crypto/marvell/cesa.c | 4 ++++
> drivers/crypto/marvell/cesa.h | 5 +++++
> drivers/crypto/marvell/cipher.c | 32 +++++++++++++++++++++++---------
> drivers/crypto/marvell/tdma.c | 29 +++++++++++++++++++++++++++++
> 4 files changed, 61 insertions(+), 9 deletions(-)
>
[...]
> @@ -135,21 +140,21 @@ static int mv_cesa_ablkcipher_process(struct
> crypto_async_request *req, {
> struct ablkcipher_request *ablkreq =
> ablkcipher_request_cast(req); struct mv_cesa_ablkcipher_req *creq =
> ablkcipher_request_ctx(ablkreq);
> - struct mv_cesa_ablkcipher_std_req *sreq = &creq->req.std;
> - struct mv_cesa_engine *engine = sreq->base.engine;
> + struct mv_cesa_tdma_req *dreq;
> + unsigned int ivsize;
> int ret;
>
> - if (creq->req.base.type == CESA_DMA_REQ)
> - ret = mv_cesa_dma_process(&creq->req.dma, status);
> - else
> - ret = mv_cesa_ablkcipher_std_process(ablkreq,
> status);
> + if (creq->req.base.type == CESA_STD_REQ)
> + return mv_cesa_ablkcipher_std_process(ablkreq,
> status);
> + ret = mv_cesa_dma_process(&creq->req.dma, status);
> if (ret)
> return ret;
>
> - memcpy_fromio(ablkreq->info,
> - engine->sram + CESA_SA_CRYPT_IV_SRAM_OFFSET,
> -
> crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(ablkreq)));
> + dreq = &creq->req.dma;
> + ivsize =
> + crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(ablkreq));
My bad, my mailer wrapped the line: please put the assignment on the
same line and use a temporary variable if it exceeds 80 chars.
> + memcpy_fromio(ablkreq->info, dreq->chain.last->data, ivsize);
>
> return 0;
> }
next prev parent reply other threads:[~2016-06-17 12:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-17 11:23 [PATCH v2 00/10] Chain crypto requests together at the DMA level Romain Perier
2016-06-17 11:24 ` [PATCH v2 01/10] crypto: marvell: Add a macro constant for the size of the crypto queue Romain Perier
2016-06-17 12:37 ` Boris Brezillon
2016-06-17 11:24 ` [PATCH v2 02/10] crypto: marvell: Check engine is not already running when enabling a req Romain Perier
2016-06-17 12:38 ` Boris Brezillon
2016-06-17 11:24 ` [PATCH v2 03/10] crypto: marvell: Fix wrong type check in dma functions Romain Perier
2016-06-17 12:41 ` Boris Brezillon
2016-06-17 11:24 ` [PATCH v2 04/10] crypto: marvell: Copy IV vectors by DMA transfers for acipher requests Romain Perier
2016-06-17 12:49 ` Boris Brezillon [this message]
2016-06-17 11:24 ` [PATCH v2 05/10] crypto: marvell: Move tdma chain out of mv_cesa_tdma_req and remove it Romain Perier
2016-06-17 13:02 ` Boris Brezillon
2016-06-17 11:24 ` [PATCH v2 06/10] crypto: marvell: Add a complete operation for async requests Romain Perier
2016-06-17 13:08 ` Boris Brezillon
2016-06-17 11:24 ` [PATCH v2 07/10] crypto: marvell: Move SRAM I/O operations to step functions Romain Perier
2016-06-17 13:16 ` Boris Brezillon
2016-06-17 11:24 ` [PATCH v2 08/10] crypto: marvell: Add load balancing between engines Romain Perier
2016-06-17 13:22 ` Boris Brezillon
2016-06-17 11:24 ` [PATCH v2 09/10] crypto: marvell: Add support for chaining crypto requests in TDMA mode Romain Perier
2016-06-17 13:27 ` Boris Brezillon
2016-06-17 11:24 ` [PATCH v2 10/10] crypto: marvell: Increase the size of the crypto queue Romain Perier
2016-06-17 13:28 ` Boris Brezillon
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=20160617144913.1f70ed75@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.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).