LKML Archive on lore.kernel.org
 help / Atom feed
* [PATCH net-next] net: mvneta: fix mvneta_config_rss on armada 3700
@ 2018-08-10  3:36 Jisheng Zhang
  2018-08-10 13:36 ` Andrew Lunn
  2018-08-10 21:40 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Jisheng Zhang @ 2018-08-10  3:36 UTC (permalink / raw)
  To: Thomas Petazzoni, David S. Miller, Andrew Lunn
  Cc: linux-arm-kernel, netdev, linux-kernel

The mvneta Ethernet driver is used on a few different Marvell SoCs.
Some SoCs have per cpu interrupts for Ethernet events, the driver uses
a per CPU napi structure for this case. Some SoCs such as armada 3700
have a single interrupt for Ethernet events, the driver uses a global
napi structure for this case.

Current mvneta_config_rss() always operates the per cpu napi structure.
Fix it by operating a global napi for "single interrupt" case, and per
cpu napi structure for remaining cases.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Fixes: 2636ac3cc2b4 ("net: mvneta: Add network support for Armada 3700 SoC")
---
 drivers/net/ethernet/marvell/mvneta.c | 31 +++++++++++++++++----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 55c2a56c5dae..bc80a678abc3 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4107,13 +4107,18 @@ static int  mvneta_config_rss(struct mvneta_port *pp)
 
 	on_each_cpu(mvneta_percpu_mask_interrupt, pp, true);
 
-	/* We have to synchronise on the napi of each CPU */
-	for_each_online_cpu(cpu) {
-		struct mvneta_pcpu_port *pcpu_port =
-			per_cpu_ptr(pp->ports, cpu);
+	if (!pp->neta_armada3700) {
+		/* We have to synchronise on the napi of each CPU */
+		for_each_online_cpu(cpu) {
+			struct mvneta_pcpu_port *pcpu_port =
+				per_cpu_ptr(pp->ports, cpu);
 
-		napi_synchronize(&pcpu_port->napi);
-		napi_disable(&pcpu_port->napi);
+			napi_synchronize(&pcpu_port->napi);
+			napi_disable(&pcpu_port->napi);
+		}
+	} else {
+		napi_synchronize(&pp->napi);
+		napi_disable(&pp->napi);
 	}
 
 	pp->rxq_def = pp->indir[0];
@@ -4130,12 +4135,16 @@ static int  mvneta_config_rss(struct mvneta_port *pp)
 	mvneta_percpu_elect(pp);
 	spin_unlock(&pp->lock);
 
-	/* We have to synchronise on the napi of each CPU */
-	for_each_online_cpu(cpu) {
-		struct mvneta_pcpu_port *pcpu_port =
-			per_cpu_ptr(pp->ports, cpu);
+	if (!pp->neta_armada3700) {
+		/* We have to synchronise on the napi of each CPU */
+		for_each_online_cpu(cpu) {
+			struct mvneta_pcpu_port *pcpu_port =
+				per_cpu_ptr(pp->ports, cpu);
 
-		napi_enable(&pcpu_port->napi);
+			napi_enable(&pcpu_port->napi);
+		}
+	} else {
+		napi_enable(&pp->napi);
 	}
 
 	netif_tx_start_all_queues(pp->dev);
-- 
2.18.0


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

* Re: [PATCH net-next] net: mvneta: fix mvneta_config_rss on armada 3700
  2018-08-10  3:36 [PATCH net-next] net: mvneta: fix mvneta_config_rss on armada 3700 Jisheng Zhang
@ 2018-08-10 13:36 ` Andrew Lunn
  2018-08-10 21:40 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2018-08-10 13:36 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Thomas Petazzoni, David S. Miller, linux-arm-kernel, netdev,
	linux-kernel

On Fri, Aug 10, 2018 at 11:36:27AM +0800, Jisheng Zhang wrote:
> The mvneta Ethernet driver is used on a few different Marvell SoCs.
> Some SoCs have per cpu interrupts for Ethernet events, the driver uses
> a per CPU napi structure for this case. Some SoCs such as armada 3700
> have a single interrupt for Ethernet events, the driver uses a global
> napi structure for this case.
> 
> Current mvneta_config_rss() always operates the per cpu napi structure.
> Fix it by operating a global napi for "single interrupt" case, and per
> cpu napi structure for remaining cases.
> 
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> Fixes: 2636ac3cc2b4 ("net: mvneta: Add network support for Armada 3700 SoC")

Looks reasonable.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net-next] net: mvneta: fix mvneta_config_rss on armada 3700
  2018-08-10  3:36 [PATCH net-next] net: mvneta: fix mvneta_config_rss on armada 3700 Jisheng Zhang
  2018-08-10 13:36 ` Andrew Lunn
@ 2018-08-10 21:40 ` David Miller
  2018-08-10 22:23   ` Andrew Lunn
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2018-08-10 21:40 UTC (permalink / raw)
  To: Jisheng.Zhang
  Cc: thomas.petazzoni, andrew, linux-arm-kernel, netdev, linux-kernel

From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Date: Fri, 10 Aug 2018 11:36:27 +0800

> The mvneta Ethernet driver is used on a few different Marvell SoCs.
> Some SoCs have per cpu interrupts for Ethernet events, the driver uses
> a per CPU napi structure for this case. Some SoCs such as armada 3700
> have a single interrupt for Ethernet events, the driver uses a global
> napi structure for this case.
> 
> Current mvneta_config_rss() always operates the per cpu napi structure.
> Fix it by operating a global napi for "single interrupt" case, and per
> cpu napi structure for remaining cases.
> 
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> Fixes: 2636ac3cc2b4 ("net: mvneta: Add network support for Armada 3700 SoC")

Applied, thanks.

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

* Re: [PATCH net-next] net: mvneta: fix mvneta_config_rss on armada 3700
  2018-08-10 21:40 ` David Miller
@ 2018-08-10 22:23   ` Andrew Lunn
  2018-08-11  2:11     ` David Miller
  2018-08-19 17:49     ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Lunn @ 2018-08-10 22:23 UTC (permalink / raw)
  To: David Miller
  Cc: Jisheng.Zhang, thomas.petazzoni, linux-arm-kernel, netdev, linux-kernel

On Fri, Aug 10, 2018 at 02:40:31PM -0700, David Miller wrote:
> From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> Date: Fri, 10 Aug 2018 11:36:27 +0800
> 
> > The mvneta Ethernet driver is used on a few different Marvell SoCs.
> > Some SoCs have per cpu interrupts for Ethernet events, the driver uses
> > a per CPU napi structure for this case. Some SoCs such as armada 3700
> > have a single interrupt for Ethernet events, the driver uses a global
> > napi structure for this case.
> > 
> > Current mvneta_config_rss() always operates the per cpu napi structure.
> > Fix it by operating a global napi for "single interrupt" case, and per
> > cpu napi structure for remaining cases.
> > 
> > Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> > Fixes: 2636ac3cc2b4 ("net: mvneta: Add network support for Armada 3700 SoC")
> 
> Applied, thanks.

Hi David

Please can you queue up:

Fixes: 7a86f05faf11 ("net: ethernet: mvneta: Fix napi structure mixup on armada 3700")

and this patch for stable.

Thanks
	Andrew

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

* Re: [PATCH net-next] net: mvneta: fix mvneta_config_rss on armada 3700
  2018-08-10 22:23   ` Andrew Lunn
@ 2018-08-11  2:11     ` David Miller
  2018-08-19 17:49     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2018-08-11  2:11 UTC (permalink / raw)
  To: andrew
  Cc: Jisheng.Zhang, thomas.petazzoni, linux-arm-kernel, netdev, linux-kernel

From: Andrew Lunn <andrew@lunn.ch>
Date: Sat, 11 Aug 2018 00:23:35 +0200

> On Fri, Aug 10, 2018 at 02:40:31PM -0700, David Miller wrote:
>> From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
>> Date: Fri, 10 Aug 2018 11:36:27 +0800
>> 
>> > The mvneta Ethernet driver is used on a few different Marvell SoCs.
>> > Some SoCs have per cpu interrupts for Ethernet events, the driver uses
>> > a per CPU napi structure for this case. Some SoCs such as armada 3700
>> > have a single interrupt for Ethernet events, the driver uses a global
>> > napi structure for this case.
>> > 
>> > Current mvneta_config_rss() always operates the per cpu napi structure.
>> > Fix it by operating a global napi for "single interrupt" case, and per
>> > cpu napi structure for remaining cases.
>> > 
>> > Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
>> > Fixes: 2636ac3cc2b4 ("net: mvneta: Add network support for Armada 3700 SoC")
>> 
>> Applied, thanks.
> 
> Hi David
> 
> Please can you queue up:
> 
> Fixes: 7a86f05faf11 ("net: ethernet: mvneta: Fix napi structure mixup on armada 3700")
> 
> and this patch for stable.

If you want things to go to -stable, don't mark them for net-next as this
patch was.

If it isn't appropriate for 'net' it isn't appropriate for -stable either.

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

* Re: [PATCH net-next] net: mvneta: fix mvneta_config_rss on armada 3700
  2018-08-10 22:23   ` Andrew Lunn
  2018-08-11  2:11     ` David Miller
@ 2018-08-19 17:49     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2018-08-19 17:49 UTC (permalink / raw)
  To: andrew
  Cc: Jisheng.Zhang, thomas.petazzoni, linux-arm-kernel, netdev, linux-kernel

From: Andrew Lunn <andrew@lunn.ch>
Date: Sat, 11 Aug 2018 00:23:35 +0200

> Please can you queue up:
> 
> Fixes: 7a86f05faf11 ("net: ethernet: mvneta: Fix napi structure mixup on armada 3700")
> 
> and this patch for stable.

Since these are now both in Linus's tree, done.

But, if one thinks the change belongs in -stable, target 'net' always.

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

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10  3:36 [PATCH net-next] net: mvneta: fix mvneta_config_rss on armada 3700 Jisheng Zhang
2018-08-10 13:36 ` Andrew Lunn
2018-08-10 21:40 ` David Miller
2018-08-10 22:23   ` Andrew Lunn
2018-08-11  2:11     ` David Miller
2018-08-19 17:49     ` David Miller

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox