linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: boris.brezillon@free-electrons.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 08/10] crypto: marvell: Add load balancing between engines
Date: Fri, 17 Jun 2016 15:22:21 +0200	[thread overview]
Message-ID: <20160617152221.636efa28@bbrezillon> (raw)
In-Reply-To: <1466162649-29911-9-git-send-email-romain.perier@free-electrons.com>

On Fri, 17 Jun 2016 13:24:07 +0200
Romain Perier <romain.perier@free-electrons.com> wrote:

> This commits adds support for fine grained load balancing on
> multi-engine IPs. The engine is pre-selected based on its current load
> and on the weight of the crypto request that is about to be processed.
> The global crypto queue is also moved to each engine. These changes are
> required to allow chaining crypto requests at the DMA level. By using
> a crypto queue per engine, we make sure that we keep the state of the
> tdma chain synchronized with the crypto queue. We also reduce contention
> on 'cesa_dev->lock' and improve parallelism.
> 
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
> ---
> 
> Changes in v2:
> 
>   - Reworded the commit message
>   - Moved the code about SRAM I/O operations from this commit to
>     a separated commit (see PATCH 07/10).
> 
>  drivers/crypto/marvell/cesa.c   | 30 ++++++++++------------
>  drivers/crypto/marvell/cesa.h   | 29 +++++++++++++++++----
>  drivers/crypto/marvell/cipher.c | 57 ++++++++++++++++++-----------------------
>  drivers/crypto/marvell/hash.c   | 50 ++++++++++++++----------------------
>  4 files changed, 82 insertions(+), 84 deletions(-)
> 
> diff --git a/drivers/crypto/marvell/cesa.c b/drivers/crypto/marvell/cesa.c
> index af96426..f9e6688 100644
> --- a/drivers/crypto/marvell/cesa.c
> +++ b/drivers/crypto/marvell/cesa.c
> @@ -45,11 +45,9 @@ static void mv_cesa_dequeue_req_unlocked(struct mv_cesa_engine *engine)

This function should be renamed mv_cesa_dequeue_req_locked(). I see
you're doing it in patch 9, but it should be done here.

>  	struct crypto_async_request *req, *backlog;
>  	struct mv_cesa_ctx *ctx;
>  
> -	spin_lock_bh(&cesa_dev->lock);
> -	backlog = crypto_get_backlog(&cesa_dev->queue);
> -	req = crypto_dequeue_request(&cesa_dev->queue);
> +	backlog = crypto_get_backlog(&engine->queue);
> +	req = crypto_dequeue_request(&engine->queue);
>  	engine->req = req;
> -	spin_unlock_bh(&cesa_dev->lock);
>  
>  	if (!req)
>  		return;

  reply	other threads:[~2016-06-17 13:22 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
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 [this message]
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=20160617152221.636efa28@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).