Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: marvell/cesa - irq balance

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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Sven Auhagen and committed by
Herbert Xu
28ee8b09 c6720415

+11 -1
+10 -1
drivers/crypto/marvell/cesa/cesa.c
··· 438 438 struct mv_cesa_dev *cesa; 439 439 struct mv_cesa_engine *engines; 440 440 struct resource *res; 441 - int irq, ret, i; 441 + int irq, ret, i, cpu; 442 442 u32 sram_size; 443 443 444 444 if (cesa_dev) { ··· 505 505 goto err_cleanup; 506 506 } 507 507 508 + engine->irq = irq; 509 + 508 510 /* 509 511 * Not all platforms can gate the CESA clocks: do not complain 510 512 * if the clock does not exist. ··· 550 548 if (ret) 551 549 goto err_cleanup; 552 550 551 + /* Set affinity */ 552 + cpu = cpumask_local_spread(engine->id, NUMA_NO_NODE); 553 + irq_set_affinity_hint(irq, get_cpu_mask(cpu)); 554 + 553 555 crypto_init_queue(&engine->queue, CESA_CRYPTO_DEFAULT_MAX_QLEN); 554 556 atomic_set(&engine->load, 0); 555 557 INIT_LIST_HEAD(&engine->complete_queue); ··· 576 570 clk_disable_unprepare(cesa->engines[i].zclk); 577 571 clk_disable_unprepare(cesa->engines[i].clk); 578 572 mv_cesa_put_sram(pdev, i); 573 + if (cesa->engines[i].irq > 0) 574 + irq_set_affinity_hint(cesa->engines[i].irq, NULL); 579 575 } 580 576 581 577 return ret; ··· 594 586 clk_disable_unprepare(cesa->engines[i].zclk); 595 587 clk_disable_unprepare(cesa->engines[i].clk); 596 588 mv_cesa_put_sram(pdev, i); 589 + irq_set_affinity_hint(cesa->engines[i].irq, NULL); 597 590 } 598 591 599 592 return 0;
+1
drivers/crypto/marvell/cesa/cesa.h
··· 457 457 atomic_t load; 458 458 struct mv_cesa_tdma_chain chain; 459 459 struct list_head complete_queue; 460 + int irq; 460 461 }; 461 462 462 463 /**