|
|
94ec42f |
Bugzilla: 1022733
|
|
|
94ec42f |
Upstream: Submitted for 3.13 and 3.12.y stable
|
|
|
94ec42f |
Delivered-To: jwboyer@gmail.com
|
|
|
94ec42f |
Received: by 10.76.104.107 with SMTP id gd11csp116929oab;
|
|
|
94ec42f |
Mon, 25 Nov 2013 15:45:36 -0800 (PST)
|
|
|
94ec42f |
X-Received: by 10.68.254.105 with SMTP id ah9mr20726084pbd.87.1385423136297;
|
|
|
94ec42f |
Mon, 25 Nov 2013 15:45:36 -0800 (PST)
|
|
|
94ec42f |
Return-Path: <netdev-owner@vger.kernel.org>
|
|
|
94ec42f |
Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67])
|
|
|
94ec42f |
by mx.google.com with ESMTP id am2si28999873pad.96.2013.11.25.15.44.53
|
|
|
94ec42f |
for <multiple recipients>;
|
|
|
94ec42f |
Mon, 25 Nov 2013 15:45:36 -0800 (PST)
|
|
|
94ec42f |
Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67;
|
|
|
94ec42f |
Authentication-Results: mx.google.com;
|
|
|
94ec42f |
spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mail=netdev-owner@vger.kernel.org
|
|
|
94ec42f |
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
|
|
94ec42f |
id S1753536Ab3KYXl6 (ORCPT <rfc822;lnxuff@gmail.com> + 99 others);
|
|
|
94ec42f |
Mon, 25 Nov 2013 18:41:58 -0500
|
|
|
94ec42f |
Received: from violet.fr.zoreil.com ([92.243.8.30]:57806 "EHLO
|
|
|
94ec42f |
violet.fr.zoreil.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
|
|
|
94ec42f |
with ESMTP id S1751913Ab3KYXlz (ORCPT
|
|
|
94ec42f |
<rfc822;netdev@vger.kernel.org>); Mon, 25 Nov 2013 18:41:55 -0500
|
|
|
94ec42f |
Received: from violet.fr.zoreil.com (localhost [127.0.0.1])
|
|
|
94ec42f |
by violet.fr.zoreil.com (8.14.5/8.14.5) with ESMTP id rAPNewrt012676;
|
|
|
94ec42f |
Tue, 26 Nov 2013 00:40:58 +0100
|
|
|
94ec42f |
Received: (from romieu@localhost)
|
|
|
94ec42f |
by violet.fr.zoreil.com (8.14.5/8.14.5/Submit) id rAPNewbX012675;
|
|
|
94ec42f |
Tue, 26 Nov 2013 00:40:58 +0100
|
|
|
94ec42f |
Date: Tue, 26 Nov 2013 00:40:58 +0100
|
|
|
94ec42f |
From: Francois Romieu <romieu@fr.zoreil.com>
|
|
|
94ec42f |
To: netdev@vger.kernel.org
|
|
|
94ec42f |
Cc: David Miller <davem@davemloft.net>,
|
|
|
94ec42f |
"Alex A. Schmidt" <aaschmidt1@gmail.com>,
|
|
|
94ec42f |
Michele Baldessari <michele@acksyn.org>,
|
|
|
94ec42f |
Jamie Heilman <jamie@audible.transient.net>,
|
|
|
94ec42f |
Julia Lawall <Julia.Lawall@lip6.fr>
|
|
|
94ec42f |
Subject: [PATCH net 1/1] via-velocity: fix netif_receive_skb use in irq
|
|
|
94ec42f |
disabled section.
|
|
|
94ec42f |
Message-ID: <20131125234058.GA12566@electric-eye.fr.zoreil.com>
|
|
|
94ec42f |
MIME-Version: 1.0
|
|
|
94ec42f |
Content-Type: text/plain; charset=us-ascii
|
|
|
94ec42f |
Content-Disposition: inline
|
|
|
94ec42f |
X-Organisation: Land of Sunshine Inc.
|
|
|
94ec42f |
User-Agent: Mutt/1.5.21 (2010-09-15)
|
|
|
94ec42f |
Sender: netdev-owner@vger.kernel.org
|
|
|
94ec42f |
Precedence: bulk
|
|
|
94ec42f |
List-ID: <netdev.vger.kernel.org>
|
|
|
94ec42f |
X-Mailing-List: netdev@vger.kernel.org
|
|
|
94ec42f |
|
|
|
94ec42f |
2fdac010bdcf10a30711b6924612dfc40daf19b8 ("via-velocity.c: update napi
|
|
|
94ec42f |
implementation") overlooked an irq disabling spinlock when the Rx part
|
|
|
94ec42f |
of the NAPI poll handler was converted from netif_rx to netif_receive_skb.
|
|
|
94ec42f |
|
|
|
94ec42f |
NAPI Rx processing can be taken out of the locked section with a pair of
|
|
|
94ec42f |
napi_{disable / enable} since it only races with the MTU change function.
|
|
|
94ec42f |
|
|
|
94ec42f |
An heavier rework of the NAPI locking would be able to perform NAPI Tx
|
|
|
94ec42f |
before Rx where I simply removed one of velocity_tx_srv calls.
|
|
|
94ec42f |
|
|
|
94ec42f |
References: https://bugzilla.redhat.com/show_bug.cgi?id=1022733
|
|
|
94ec42f |
Fixes: 2fdac010bdcf (via-velocity.c: update napi implementation)
|
|
|
94ec42f |
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
|
|
|
94ec42f |
Tested-by: Alex A. Schmidt <aaschmidt1@gmail.com>
|
|
|
94ec42f |
Cc: Jamie Heilman <jamie@audible.transient.net>
|
|
|
94ec42f |
Cc: Michele Baldessari <michele@acksyn.org>
|
|
|
94ec42f |
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
|
|
|
94ec42f |
---
|
|
|
94ec42f |
|
|
|
94ec42f |
It is relevant for stable 3.11.x and 3.12.y.
|
|
|
94ec42f |
|
|
|
94ec42f |
drivers/net/ethernet/via/via-velocity.c | 11 ++++++-----
|
|
|
94ec42f |
1 file changed, 6 insertions(+), 5 deletions(-)
|
|
|
94ec42f |
|
|
|
94ec42f |
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
|
|
|
94ec42f |
index d022bf9..ad61d26 100644
|
|
|
94ec42f |
--- a/drivers/net/ethernet/via/via-velocity.c
|
|
|
94ec42f |
+++ b/drivers/net/ethernet/via/via-velocity.c
|
|
|
94ec42f |
@@ -2172,16 +2172,13 @@ static int velocity_poll(struct napi_struct *napi, int budget)
|
|
|
94ec42f |
unsigned int rx_done;
|
|
|
94ec42f |
unsigned long flags;
|
|
|
94ec42f |
|
|
|
94ec42f |
- spin_lock_irqsave(&vptr->lock, flags);
|
|
|
94ec42f |
/*
|
|
|
94ec42f |
* Do rx and tx twice for performance (taken from the VIA
|
|
|
94ec42f |
* out-of-tree driver).
|
|
|
94ec42f |
*/
|
|
|
94ec42f |
- rx_done = velocity_rx_srv(vptr, budget / 2);
|
|
|
94ec42f |
- velocity_tx_srv(vptr);
|
|
|
94ec42f |
- rx_done += velocity_rx_srv(vptr, budget - rx_done);
|
|
|
94ec42f |
+ rx_done = velocity_rx_srv(vptr, budget);
|
|
|
94ec42f |
+ spin_lock_irqsave(&vptr->lock, flags);
|
|
|
94ec42f |
velocity_tx_srv(vptr);
|
|
|
94ec42f |
-
|
|
|
94ec42f |
/* If budget not fully consumed, exit the polling mode */
|
|
|
94ec42f |
if (rx_done < budget) {
|
|
|
94ec42f |
napi_complete(napi);
|
|
|
94ec42f |
@@ -2342,6 +2339,8 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu)
|
|
|
94ec42f |
if (ret < 0)
|
|
|
94ec42f |
goto out_free_tmp_vptr_1;
|
|
|
94ec42f |
|
|
|
94ec42f |
+ napi_disable(&vptr->napi);
|
|
|
94ec42f |
+
|
|
|
94ec42f |
spin_lock_irqsave(&vptr->lock, flags);
|
|
|
94ec42f |
|
|
|
94ec42f |
netif_stop_queue(dev);
|
|
|
94ec42f |
@@ -2362,6 +2361,8 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu)
|
|
|
94ec42f |
|
|
|
94ec42f |
velocity_give_many_rx_descs(vptr);
|
|
|
94ec42f |
|
|
|
94ec42f |
+ napi_enable(&vptr->napi);
|
|
|
94ec42f |
+
|
|
|
94ec42f |
mac_enable_int(vptr->mac_regs);
|
|
|
94ec42f |
netif_start_queue(dev);
|
|
|
94ec42f |
|
|
|
94ec42f |
--
|
|
|
94ec42f |
1.8.3.1
|
|
|
94ec42f |
|
|
|
94ec42f |
--
|
|
|
94ec42f |
To unsubscribe from this list: send the line "unsubscribe netdev" in
|
|
|
94ec42f |
the body of a message to majordomo@vger.kernel.org
|
|
|
94ec42f |
More majordomo info at http://vger.kernel.org/majordomo-info.html
|