All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] inside-secure irq balance
@ 2020-07-08 15:08 Sven Auhagen
  2020-07-16  7:21 ` Herbert Xu
  0 siblings, 1 reply; 13+ messages in thread
From: Sven Auhagen @ 2020-07-08 15:08 UTC (permalink / raw)
  To: linux-crypto

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

From my testing with IPSec AES-GCM 256
on my MCbin with 4 Cores I get a 50% speed increase:

Before the patch: 99.73 Kpps
With the patch: 151.25 Kpps

Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
---
 drivers/crypto/inside-secure/safexcel.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c
index 2cb53fbae841..f206084be08e 100644
--- a/drivers/crypto/inside-secure/safexcel.c
+++ b/drivers/crypto/inside-secure/safexcel.c
@@ -1135,11 +1135,12 @@ static irqreturn_t safexcel_irq_ring_thread(int irq, void *data)
 
 static int safexcel_request_ring_irq(void *pdev, int irqid,
 				     int is_pci_dev,
+				     int ring_id,
 				     irq_handler_t handler,
 				     irq_handler_t threaded_handler,
 				     struct safexcel_ring_irq_data *ring_irq_priv)
 {
-	int ret, irq;
+	int ret, irq, cpu;
 	struct device *dev;
 
 	if (IS_ENABLED(CONFIG_PCI) && is_pci_dev) {
@@ -1177,6 +1178,10 @@ static int safexcel_request_ring_irq(void *pdev, int irqid,
 		return ret;
 	}
 
+	// Set affinity
+	cpu = ring_id % num_online_cpus();
+	irq_set_affinity_hint(irq, get_cpu_mask(cpu));
+
 	return irq;
 }
 
@@ -1611,6 +1616,7 @@ static int safexcel_probe_generic(void *pdev,
 		irq = safexcel_request_ring_irq(pdev,
 						EIP197_IRQ_NUMBER(i, is_pci_dev),
 						is_pci_dev,
+						i,
 						safexcel_irq_ring,
 						safexcel_irq_ring_thread,
 						ring_irq);
-- 
2.20.1


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

end of thread, other threads:[~2020-07-17 13:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 15:08 [PATCH 1/1] inside-secure irq balance Sven Auhagen
2020-07-16  7:21 ` Herbert Xu
2020-07-16  8:44   ` Van Leeuwen, Pascal
2020-07-16  9:21     ` Sven Auhagen
2020-07-16 12:04       ` Herbert Xu
2020-07-17  5:01         ` Sven Auhagen
2020-07-17  5:20           ` Herbert Xu
2020-07-17  6:35             ` Sven Auhagen
2020-07-17  6:57               ` Herbert Xu
2020-07-17  7:53                 ` Sven Auhagen
2020-07-17  8:56                   ` Van Leeuwen, Pascal
2020-07-17 13:50                   ` Herbert Xu
2020-07-16 10:31     ` Sven Auhagen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.