linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] marvell cesa irq balance
@ 2020-07-09  8:53 Sven Auhagen
  2020-07-16  7:23 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Auhagen @ 2020-07-09  8:53 UTC (permalink / raw)
  To: linux-crypto; +Cc: boris.brezillon, arno

Balance the irqs of the marvell cesa driver over all
available cpus.
Currently all interrupts are handled by the first CPU.

From my testing with IPSec AES 256 SHA256
on my clearfog base with 2 Cores I get a 2x speed increase:

Before the patch: 26.74 Kpps
With the patch: 56.11 Kpps

Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
---
 drivers/crypto/marvell/cesa/cesa.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c
index 8a5f0b0bdf77..bf1bda2e904a 100644
--- a/drivers/crypto/marvell/cesa/cesa.c
+++ b/drivers/crypto/marvell/cesa/cesa.c
@@ -438,7 +438,7 @@ static int mv_cesa_probe(struct platform_device *pdev)
 	struct mv_cesa_dev *cesa;
 	struct mv_cesa_engine *engines;
 	struct resource *res;
-	int irq, ret, i;
+	int irq, ret, i, cpu;
 	u32 sram_size;
 
 	if (cesa_dev) {
@@ -548,6 +548,10 @@ static int mv_cesa_probe(struct platform_device *pdev)
 		if (ret)
 			goto err_cleanup;
 
+		// Set affinity
+		cpu = engine->id % num_online_cpus();
+		irq_set_affinity_hint(irq, get_cpu_mask(cpu));
+
 		crypto_init_queue(&engine->queue, CESA_CRYPTO_DEFAULT_MAX_QLEN);
 		atomic_set(&engine->load, 0);
 		INIT_LIST_HEAD(&engine->complete_queue);
-- 
2.20.1


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

* Re: [PATCH 1/1] marvell cesa irq balance
  2020-07-09  8:53 [PATCH 1/1] marvell cesa irq balance Sven Auhagen
@ 2020-07-16  7:23 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2020-07-16  7:23 UTC (permalink / raw)
  To: Sven Auhagen; +Cc: linux-crypto, boris.brezillon, arno

Sven Auhagen <sven.auhagen@voleatech.de> wrote:
> Balance the irqs of the marvell cesa driver over all
> available cpus.
> Currently all interrupts are handled by the first CPU.
> 
> From my testing with IPSec AES 256 SHA256
> on my clearfog base with 2 Cores I get a 2x speed increase:
> 
> Before the patch: 26.74 Kpps
> With the patch: 56.11 Kpps
> 
> Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
> ---
> drivers/crypto/marvell/cesa/cesa.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c
> index 8a5f0b0bdf77..bf1bda2e904a 100644
> --- a/drivers/crypto/marvell/cesa/cesa.c
> +++ b/drivers/crypto/marvell/cesa/cesa.c
> @@ -438,7 +438,7 @@ static int mv_cesa_probe(struct platform_device *pdev)
>        struct mv_cesa_dev *cesa;
>        struct mv_cesa_engine *engines;
>        struct resource *res;
> -       int irq, ret, i;
> +       int irq, ret, i, cpu;
>        u32 sram_size;
> 
>        if (cesa_dev) {
> @@ -548,6 +548,10 @@ static int mv_cesa_probe(struct platform_device *pdev)
>                if (ret)
>                        goto err_cleanup;
> 
> +               // Set affinity
> +               cpu = engine->id % num_online_cpus();
> +               irq_set_affinity_hint(irq, get_cpu_mask(cpu));
> +

Same issue as the inside-secure patch.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2020-07-16  7:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09  8:53 [PATCH 1/1] marvell cesa irq balance Sven Auhagen
2020-07-16  7:23 ` Herbert Xu

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).