netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: mvpp2: Prevent userspace from changing TX affinities
@ 2017-11-04 12:33 Marc Zyngier
  2017-11-08  1:31 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Zyngier @ 2017-11-04 12:33 UTC (permalink / raw)
  To: Thomas Petazzoni, Antoine Tenart; +Cc: netdev, David S. Miller, stable

The mvpp2 driver can't cope at all with the TX affinities being
changed from userspace, and spit an endless stream of

[   91.779920] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
[   91.779930] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
[   91.780402] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
[   91.780406] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
[   91.780415] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
[   91.780418] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing

rendering the box completely useless (I've measured around 600k
interrupts/s on a 8040 box) once irqbalance kicks in and start
doing its job.

Obviously, the driver was never designed with this in mind. So let's
work around the problem by preventing userspace from interacting
with these interrupts altogether.

Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index a37af5813f33..fcf9ba5eb8d1 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -6747,6 +6747,9 @@ static int mvpp2_irqs_init(struct mvpp2_port *port)
 	for (i = 0; i < port->nqvecs; i++) {
 		struct mvpp2_queue_vector *qv = port->qvecs + i;
 
+		if (qv->type == MVPP2_QUEUE_VECTOR_PRIVATE)
+			irq_set_status_flags(qv->irq, IRQ_NO_BALANCING);
+
 		err = request_irq(qv->irq, mvpp2_isr, 0, port->dev->name, qv);
 		if (err)
 			goto err;
@@ -6776,6 +6779,7 @@ static void mvpp2_irqs_deinit(struct mvpp2_port *port)
 		struct mvpp2_queue_vector *qv = port->qvecs + i;
 
 		irq_set_affinity_hint(qv->irq, NULL);
+		irq_clear_status_flags(qv->irq, IRQ_NO_BALANCING);
 		free_irq(qv->irq, qv);
 	}
 }
-- 
2.11.0

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

* Re: [PATCH] net: mvpp2: Prevent userspace from changing TX affinities
  2017-11-04 12:33 [PATCH] net: mvpp2: Prevent userspace from changing TX affinities Marc Zyngier
@ 2017-11-08  1:31 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-11-08  1:31 UTC (permalink / raw)
  To: marc.zyngier; +Cc: thomas.petazzoni, antoine.tenart, netdev, stable

From: Marc Zyngier <marc.zyngier@arm.com>
Date: Sat,  4 Nov 2017 12:33:47 +0000

> The mvpp2 driver can't cope at all with the TX affinities being
> changed from userspace, and spit an endless stream of
> 
> [   91.779920] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
> [   91.779930] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
> [   91.780402] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
> [   91.780406] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
> [   91.780415] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
> [   91.780418] mvpp2 f4000000.ethernet eth2: wrong cpu on the end of Tx processing
> 
> rendering the box completely useless (I've measured around 600k
> interrupts/s on a 8040 box) once irqbalance kicks in and start
> doing its job.
> 
> Obviously, the driver was never designed with this in mind. So let's
> work around the problem by preventing userspace from interacting
> with these interrupts altogether.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2017-11-08  1:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-04 12:33 [PATCH] net: mvpp2: Prevent userspace from changing TX affinities Marc Zyngier
2017-11-08  1:31 ` David Miller

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