From patchwork Fri Aug 10 03:36:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 10562229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9D321390 for ; Fri, 10 Aug 2018 03:39:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA0582B42E for ; Fri, 10 Aug 2018 03:39:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE6152B4A5; Fri, 10 Aug 2018 03:39:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 486EF2B42E for ; Fri, 10 Aug 2018 03:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6iK2H/diLlsjy/AvOP8jCalwzBHJs39ePbac8814uzQ=; b=cmBNN8yds0+2ME UJ+bWVALSP8FvmiA54aEMmesiW/q7nQVtpd9qO18mmFXcs/lurr8C2cy+iBru1NiEzbyH2QuZPM3L Urs+ajqeop9/nh1PhrZvLN4afmaVXH6T3+lC9UB4gCotjQ91GOgMAOX+rInmetCRtpVifoYlYKxHI sCKmZgPV372P30MxfM1VqBlkX+H3BP7XmQFiSZAVmHF1WN+sTAfHKGaEs5HPKl8MO3UopTWhsYl8e ACPhNE/ZBbpCsTze4I+94tT6ybOzdr6jThU7q5CDJlcj4rUAeX+V7CdniUSFqLOv4UrSIj14u1Orc 6nINp5RviDIq5gA8oqqQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fnyGq-00015h-0D; Fri, 10 Aug 2018 03:39:24 +0000 Received: from mail-sn1nam02on0067.outbound.protection.outlook.com ([104.47.36.67] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fnyGn-00014n-00 for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 03:39:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-synaptics-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iSGXHF03AVBo8ArFvEyNfjCzk4U749SHbdaL1oTZ9rA=; b=BJrPJ+olfiQV2y6R/GOqu2t4nFDHdC7kLojZHYHj/jaOp0rTAaur7bP8U3tDVo9cEXkjTAfUTQziWr03VZm74bGGSRCAyOyknScx+zs42RQtROyRrce383B5s5MSWSZC2SPqH0MBR3ExZWdHrl4RvEcXkGfQtiiM6LKdQOiNjuY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by SN1PR0301MB1583.namprd03.prod.outlook.com (2a01:111:e400:5232::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.18; Fri, 10 Aug 2018 03:39:06 +0000 Date: Fri, 10 Aug 2018 11:36:27 +0800 From: Jisheng Zhang To: Thomas Petazzoni , "David S. Miller" , Andrew Lunn Subject: [PATCH net-next] net: mvneta: fix mvneta_config_rss on armada 3700 Message-ID: <20180810113627.5dec5d40@xhacker.debian> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: HK0PR03CA0014.apcprd03.prod.outlook.com (2603:1096:203:2e::26) To SN1PR0301MB1583.namprd03.prod.outlook.com (2a01:111:e400:5232::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01390791-ba1e-4542-42b2-08d5fe72d3d3 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:SN1PR0301MB1583; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1583; 3:flyOSZnMS6fGx60F1qzJKYjlFcS207h8osGZLqPij/URSnI3sqMratwkFe7gBrDn4/fr/3OzhF2sIijxDYd2YSU54s6+ycOiSInLTjBYhiWaGfmoLCojt65W2SsBvKyzXUpDteryT/K/TZZjSWOE9rlQ/LE8K335t92sbBoO3w11LJMGbZVSDrgTcGk1Qem0yNgeIUZYePPbJLX5xjWruCdLgUsWpreYuiec3ffeHtFVtYGBVM+924yB5bwxo3eP; 25:poog1EB2+8idIc4bMVimrIJx0mvpEHf9oKF9Pw5BWt2NMTgCiNXmb8wkk0jtngSPiB0C1r+NuataGyF1PLNl7eamPRyJBSHQvUAUSQpgu6RJD0Mcndo6MQDCdscdBE7pHVstERRDQBRIkcIjQUb12k7U877fBykOQthAvkedCAx7/28ialTxjG5UQVd/NXPJoQQoNLksG/6x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4NxH/6VBYvDo6PhgJ9NAdiCxKC9oawZiNgRnkQ1ixGMkNUYo8p6EWlREvZ9gDpl71Z0Iu8Whmq3rbS3MROj7Ib7jxpxO/D3+Xfmxa/gn9AERTvsezlFyt+NhlQrLpDLZSm3nWRGZWGX1W6DZTSBl3pGPlbE/gHHtNavPawwFJdIAO6KzqQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:SN1PR0301MB1583; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0301MB1583; X-Forefront-PRVS: 07607ED19A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39850400004)(376002)(346002)(396003)(189003)(199004)(1076002)(8936002)(6116002)(68736007)(478600001)(97736004)(50226002)(14444005)(2906002)(47776003)(6666003)(72206003)(66066001)(23726003)(53936002)(5660300001)(230700001)(3846002)(6506007)(386003)(7736002)(305945005)(8676002)(81156014)(106356001)(105586002)(81166006)(55016002)(86362001)(26005)(7696005)(4326008)(52116002)(186003)(16526019)(25786009)(486006)(9686003)(50466002)(956004)(476003)(33896004)(110136005)(316002)(39210200001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1583; H:xhacker.debian; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0301MB1583; 23:LcNB3KvM+q/eWp191xLVpn50xvBCKY+8k70YIHa?= VRC0cUlfDMi3vpFuOdHfVUAt6C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NTV8i8+h5dmeWDHjWnWrNfff6V1o0wnjS5gsMn1z9jA= X-Microsoft-Antispam-Message-Info: i0yc+rN5iveDQektSDOmW/WqkELTyFn5ZIY0cGanOHsEU/K6SoVKQMXVlhxaA5CFSCQk+gjv8VFR/+1rBdhjS8ojM35KkM3Ne4roczNKMq8kS+dcTz6KhSo3OQJp4KYQQCAUjO5raRBNiRzl3COoe6Rlwf4sI+c21jetrFHvIPe8MKgD6Wju1ieGYRNflHhiuRDdT/3uNasnpwlgz6VzYZtr02aOGH6t1ficm4Sks7SQmB7ju884hu788B+zmOqkacttRtmQsjzn3GI+6P9l69AJr0k7dCR2CzHzdfk7UY1cDQQaNK7sKvQTDX6stzMSfNpUJr+JklL+uqZFg6sY0Gt9RnhyVXW3Q6LBnhvw6go= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1583; 6:XkpEOQOwEjLDtELg1brJYuQf3bNLBVZvfHHERmXyJI0r2+Yo/mnevVbcU0kyPnPrz4SjkkFzIHabO6s7hydVx4R1w2ZaLJH1VN2BqCi08U1RIMx/OiQnPMqrPwNTvIUGfj2yHn8FrN50HImpI+25HJLmN9pdJD97DtJf2yOWmlf30QbIXK5DIEKaPOCohUfY0OzDhz/ndEzSk1G58LH1j9eIqnLh8D3E356DSt2S07tZ9Qr8POttUlQmE9fCgG3kO/yhU6/yQtnIgwr1HFwyaKkMTqEztyeuEeikuHrSVpwQPUbOTphuThJszCWC4CCIldTPvGstgKanudWoHMavSAM1GIy9gQLNz9cMJRJgbX9TTDHhAC5ewl/T0VSgNR93SjlIr+8PaDXqfOg9/iBQW8hCDPWXDietefX6W345bTEcR8ZIct3bMfyBmf2qB3ulLoCkpSoXk+RhawIoWXAOJQ==; 5:VEGppER2SkmkC7GVCdwVSezBLuytzAnsBpqW/Kl/MAUGzosymkuNrtCjbhHhxuk/8p0HevJ9urMg8lCPx5lUSJ9P9MC4JakoAXDyKubjIfRYrRArTF20dpmbfSuY3GCkE587joN1iAo8G3BQwuUHILXOYG3Jj/D1dgibC8/8Ax4=; 7:jGxV8DVbz0EL5EVBKaN0MPmZrlz34hh/yLu8c2Df3vOk1Llye+Afmc8Ibbyg+D0nhopz+wOn689GNNRHdvfyQE5SsctbnVHn95eSxRUMNUvbR0dYMlkMtJ2aoIGgDYnSrnyG0ovI7C2gckMJ1p9W85Lasp5JC7kCyjw6I3/ufnl2WDK0aDQzL6XzF1IT0ehtqJgJn873veJhgoGFyh3SpxZQGRD1u6EVkvdAWQcj7+Bngg3hzkmhq3DnXXfkZkB0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2018 03:39:06.0263 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 01390791-ba1e-4542-42b2-08d5fe72d3d3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1583 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180809_203921_086348_84E20DE5 X-CRM114-Status: GOOD ( 10.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Fixes: 2636ac3cc2b4 ("net: mvneta: Add network support for Armada 3700 SoC") Reviewed-by: Andrew Lunn --- 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);