Thread (13 messages) 13 messages, 4 authors, 2015-07-08

Re: [PATCH 6/6] net: mvneta: Statically assign queues to CPUs

flat view

From: Thomas Petazzoni <hidden>
Date: 2015-07-03 14:46:38
Also in: lkml

Maxime,

On Fri,  3 Jul 2015 16:25:51 +0200, Maxime Ripard wrote:
quoted hunk ↗ jump to hunk
+static void mvneta_percpu_enable(void *arg)
+{
+	struct mvneta_port *pp = arg;
+
+	enable_percpu_irq(pp->dev->irq, IRQ_TYPE_NONE);
+}
+
 static int mvneta_open(struct net_device *dev)
 {
 	struct mvneta_port *pp = netdev_priv(dev);
@@ -2655,6 +2662,19 @@ static int mvneta_open(struct net_device *dev)
 		goto err_cleanup_txqs;
 	}
 
+	/*
+	 * Even though the documentation says that request_percpu_irq
+	 * doesn't enable the interrupts automatically, it actually
+	 * does so on the local CPU.
+	 *
+	 * Make sure it's disabled.
+	 */
+	disable_percpu_irq(pp->dev->irq);
+
+	/* Enable per-CPU interrupt on the one CPU we care about */
+	smp_call_function_single(rxq_def % num_online_cpus(),
+				 mvneta_percpu_enable, pp, true);
What happens if that CPU goes offline through CPU hotplug?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help