From patchwork Fri Apr 1 13:21:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 8724511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D2AD19F38C for ; Fri, 1 Apr 2016 13:20:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 711C2203AE for ; Fri, 1 Apr 2016 13:20:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95D7920251 for ; Fri, 1 Apr 2016 13:20:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1alyz8-0007wn-J8; Fri, 01 Apr 2016 13:19:34 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1alyz5-0007PC-SG for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2016 13:19:32 +0000 Received: by mail-wm0-x22a.google.com with SMTP id 20so22843363wmh.1 for ; Fri, 01 Apr 2016 06:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=8sQzmwvdaFxQTj/x8E22lxE2PBfRdrVJKf63BAXW1Eg=; b=ED8ce0ngr3qAtemBYdgxAJH303wdGRX6I4TQdzhFwPpcO2NotLzD1x4JIDTj+UY6Y0 5R8l8uuNa7FnNVa1DZqiu+1rfzufKwzY0PPBsLca8MEmVkmYcCWpFk6Tjxo2WWZ5QCWJ SV8OnahU8On42wLAsFpEqfNmRceBw8zrt1VMlbpn8PqFXsvwdhlskgpI6K22gmMxhE+2 kG3AqyZl1DH7ksjZKe+Emhde0nKDmITUQo/Mt0b6wXOOsr+vMZy5kG+O2bY6frrnH01A g55CDL5cLo0E4PkjAD+vS8mKntSxdUxmlpWQS4JEalgfkwoKuJiTqZPELgxvSlJACfFd K4WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8sQzmwvdaFxQTj/x8E22lxE2PBfRdrVJKf63BAXW1Eg=; b=ZLYzchvnAQ+XYkUvyBh7vdFF/YAhZhp/6ZdTt+ZqQlt/P91BnbuPpYkg74++i1+xOu /5t3yeK14AHEmIWDJ6OfuwysRYWV0BHucxX07bOFjaXq56iwB7up6sSyzxeB2CuunIw+ 4K8MFWslLGGk5LsdI6HZvsxq5pfmxVEWACy+zZH2zkl9Kt/UkkMBuKYOrB0WkKAJfZux sdZnrTlysaGY+5cm3gBFXcNq4VYzlf56KwodKCqnAP8SAFdvccf5s7npvX/2I3p1tTwm xkM86pfpdbCrtHpvmprQPjNJ56DsUYTj6BxBkA2MVZZZfVOxNPE6rrGkztM79DIKNUUE omFg== X-Gm-Message-State: AD7BkJKFZ+OXytiOfuygT+5w5SyJh0ZkZvBoOhdA5YevCWUaZYMaxEdTIjn4OscOSMlEYA== X-Received: by 10.28.150.195 with SMTP id y186mr3769926wmd.43.1459516749702; Fri, 01 Apr 2016 06:19:09 -0700 (PDT) Received: from enkidu.semihalf.local ([80.82.22.190]) by smtp.gmail.com with ESMTPSA id by7sm13982020wjc.18.2016.04.01.06.19.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Apr 2016 06:19:09 -0700 (PDT) From: Marcin Wojtas To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH] net: mvneta: fix changing MTU when using per-cpu processing Date: Fri, 1 Apr 2016 15:21:18 +0200 Message-Id: <1459516878-2802-1-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160401_061932_090444_5520BF1E X-CRM114-Status: GOOD ( 11.82 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thomas.petazzoni@free-electrons.com, andrew@lunn.ch, linux@arm.linux.org.uk, jason@lakedaemon.net, jaz@semihalf.com, nadavh@marvell.com, alior@marvell.com, gregory.clement@free-electrons.com, nitroshift@yahoo.com, mw@semihalf.com, davem@davemloft.net, sebastian.hesselbarth@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After enabling per-cpu processing it appeared that under heavy load changing MTU can result in blocking all port's interrupts and transmitting data is not possible after the change. This commit fixes above issue by disabling percpu interrupts for the time, when TXQs and RXQs are reconfigured. Signed-off-by: Marcin Wojtas --- drivers/net/ethernet/marvell/mvneta.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index fee6a91..a433de9 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -3083,6 +3083,20 @@ static int mvneta_check_mtu_valid(struct net_device *dev, int mtu) return mtu; } +static void mvneta_percpu_enable(void *arg) +{ + struct mvneta_port *pp = arg; + + enable_percpu_irq(pp->dev->irq, IRQ_TYPE_NONE); +} + +static void mvneta_percpu_disable(void *arg) +{ + struct mvneta_port *pp = arg; + + disable_percpu_irq(pp->dev->irq); +} + /* Change the device mtu */ static int mvneta_change_mtu(struct net_device *dev, int mtu) { @@ -3107,6 +3121,7 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu) * reallocation of the queues */ mvneta_stop_dev(pp); + on_each_cpu(mvneta_percpu_disable, pp, true); mvneta_cleanup_txqs(pp); mvneta_cleanup_rxqs(pp); @@ -3130,6 +3145,7 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu) return ret; } + on_each_cpu(mvneta_percpu_enable, pp, true); mvneta_start_dev(pp); mvneta_port_up(pp); @@ -3283,20 +3299,6 @@ static void mvneta_mdio_remove(struct mvneta_port *pp) pp->phy_dev = NULL; } -static void mvneta_percpu_enable(void *arg) -{ - struct mvneta_port *pp = arg; - - enable_percpu_irq(pp->dev->irq, IRQ_TYPE_NONE); -} - -static void mvneta_percpu_disable(void *arg) -{ - struct mvneta_port *pp = arg; - - disable_percpu_irq(pp->dev->irq); -} - /* Electing a CPU must be done in an atomic way: it should be done * after or before the removal/insertion of a CPU and this function is * not reentrant.