diff options
author | Jisheng Zhang <Jisheng.Zhang@synaptics.com> | 2018-08-09 23:36:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-10 17:40:11 -0400 |
commit | 0f5c6c30a0f8c629b92ecdaef61b315c43fde10a (patch) | |
tree | e6debed9c9fff9a4a50c4bee26d8d3037e99d385 | |
parent | 0d86caff06363151df21603eb1f4e3207ea91bd2 (diff) |
net: mvneta: fix mvneta_config_rss on armada 3700
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")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/marvell/mvneta.c | 31 |
1 files 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) | |||
4107 | 4107 | ||
4108 | on_each_cpu(mvneta_percpu_mask_interrupt, pp, true); | 4108 | on_each_cpu(mvneta_percpu_mask_interrupt, pp, true); |
4109 | 4109 | ||
4110 | /* We have to synchronise on the napi of each CPU */ | 4110 | if (!pp->neta_armada3700) { |
4111 | for_each_online_cpu(cpu) { | 4111 | /* We have to synchronise on the napi of each CPU */ |
4112 | struct mvneta_pcpu_port *pcpu_port = | 4112 | for_each_online_cpu(cpu) { |
4113 | per_cpu_ptr(pp->ports, cpu); | 4113 | struct mvneta_pcpu_port *pcpu_port = |
4114 | per_cpu_ptr(pp->ports, cpu); | ||
4114 | 4115 | ||
4115 | napi_synchronize(&pcpu_port->napi); | 4116 | napi_synchronize(&pcpu_port->napi); |
4116 | napi_disable(&pcpu_port->napi); | 4117 | napi_disable(&pcpu_port->napi); |
4118 | } | ||
4119 | } else { | ||
4120 | napi_synchronize(&pp->napi); | ||
4121 | napi_disable(&pp->napi); | ||
4117 | } | 4122 | } |
4118 | 4123 | ||
4119 | pp->rxq_def = pp->indir[0]; | 4124 | pp->rxq_def = pp->indir[0]; |
@@ -4130,12 +4135,16 @@ static int mvneta_config_rss(struct mvneta_port *pp) | |||
4130 | mvneta_percpu_elect(pp); | 4135 | mvneta_percpu_elect(pp); |
4131 | spin_unlock(&pp->lock); | 4136 | spin_unlock(&pp->lock); |
4132 | 4137 | ||
4133 | /* We have to synchronise on the napi of each CPU */ | 4138 | if (!pp->neta_armada3700) { |
4134 | for_each_online_cpu(cpu) { | 4139 | /* We have to synchronise on the napi of each CPU */ |
4135 | struct mvneta_pcpu_port *pcpu_port = | 4140 | for_each_online_cpu(cpu) { |
4136 | per_cpu_ptr(pp->ports, cpu); | 4141 | struct mvneta_pcpu_port *pcpu_port = |
4142 | per_cpu_ptr(pp->ports, cpu); | ||
4137 | 4143 | ||
4138 | napi_enable(&pcpu_port->napi); | 4144 | napi_enable(&pcpu_port->napi); |
4145 | } | ||
4146 | } else { | ||
4147 | napi_enable(&pp->napi); | ||
4139 | } | 4148 | } |
4140 | 4149 | ||
4141 | netif_tx_start_all_queues(pp->dev); | 4150 | netif_tx_start_all_queues(pp->dev); |