lkml.org 
[lkml]   [2018]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.18 34/35] net: mvneta: fix mvneta_config_rss on armada 3700
    Date
    4.18-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>

    [ Upstream commit 0f5c6c30a0f8c629b92ecdaef61b315c43fde10a ]

    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/ethernet/marvell/mvneta.c | 35 +++++++++++++++++++++-------------
    1 file changed, 22 insertions(+), 13 deletions(-)

    --- a/drivers/net/ethernet/marvell/mvneta.c
    +++ b/drivers/net/ethernet/marvell/mvneta.c
    @@ -4020,13 +4020,18 @@ static int mvneta_config_rss(struct mvn

    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);
    -
    - napi_synchronize(&pcpu_port->napi);
    - napi_disable(&pcpu_port->napi);
    + 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);
    + }
    + } else {
    + napi_synchronize(&pp->napi);
    + napi_disable(&pp->napi);
    }

    pp->rxq_def = pp->indir[0];
    @@ -4043,12 +4048,16 @@ static int mvneta_config_rss(struct mvn
    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);
    -
    - napi_enable(&pcpu_port->napi);
    + 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);
    + }
    + } else {
    + napi_enable(&pp->napi);
    }

    netif_tx_start_all_queues(pp->dev);

    \
     
     \ /
      Last update: 2018-08-21 08:31    [W:3.817 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site