rpms/kernel/F-11 forcedeth-fix-napi-race.patch, NONE, 1.1 kernel.spec, 1.1754, 1.1755

Chuck Ebbert cebbert at fedoraproject.org
Tue Oct 6 12:37:23 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26928

Modified Files:
	kernel.spec 
Added Files:
	forcedeth-fix-napi-race.patch 
Log Message:
fix race in forcedeth network driver (#526546)

forcedeth-fix-napi-race.patch:
 forcedeth.c |   25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

--- NEW FILE forcedeth-fix-napi-race.patch ---
From: Eric Dumazet <eric.dumazet at gmail.com>
Date: Thu, 2 Jul 2009 04:04:45 +0000 (+0000)
Subject: forcedeth: Fix NAPI race.
X-Git-Tag: v2.6.31-rc3~40^2~17
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=78c29bd95bd8d2c3bcf7932cb3ab8ae01cd8f58f

forcedeth: Fix NAPI race.

Eric Dumazet a écrit :
> Ingo Molnar a écrit :
>>> The following changes since commit 52989765629e7d182b4f146050ebba0abf2cb0b7:
>>>   Linus Torvalds (1):
>>>         Merge git://git.kernel.org/.../davem/net-2.6
>>>
>>> are available in the git repository at:
>>>
>>>   master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master
>> Hm, something in this lot quickly wrecked networking here - see the
>> tx timeout dump below. It starts with:
>>
>> [  351.004596] WARNING: at net/sched/sch_generic.c:246 dev_watchdog+0x10b/0x19c()
>> [  351.011815] Hardware name: System Product Name
>> [  351.016220] NETDEV WATCHDOG: eth0 (forcedeth): transmit queue 0 timed out
>>
>> Config attached. Unfortunately i've got no time to do bisection
>> today.
>
>
>
> forcedeth might have a problem, in its netif_wake_queue() logic, but
> I could not see why a recent patch could make this problem visible now.
>
> CPU0/1: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ stepping 02
> is not a new cpu either :)
>
> forcedeth uses an internal tx_stop without appropriate barrier.
>
> Could you try following patch ?
>
> (random guess as I dont have much time right now)

We might have a race in napi_schedule(), leaving interrupts disabled forever.
I cannot test this patch, I dont have the hardware...

Tested-by: Ingo Molnar <mingo at elte.hu>

Signed-off-by: David S. Miller <davem at davemloft.net>
---

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 1094d29..3b4e076 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -3496,11 +3496,13 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
 	nv_msi_workaround(np);
 
 #ifdef CONFIG_FORCEDETH_NAPI
-	napi_schedule(&np->napi);
-
-	/* Disable furthur irq's
-	   (msix not enabled with napi) */
-	writel(0, base + NvRegIrqMask);
+	if (napi_schedule_prep(&np->napi)) {
+		/*
+		 * Disable further irq's (msix not enabled with napi)
+		 */
+		writel(0, base + NvRegIrqMask);
+		__napi_schedule(&np->napi);
+	}
 
 #else
 	do
@@ -3597,12 +3599,13 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
 	nv_msi_workaround(np);
 
 #ifdef CONFIG_FORCEDETH_NAPI
-	napi_schedule(&np->napi);
-
-	/* Disable furthur irq's
-	   (msix not enabled with napi) */
-	writel(0, base + NvRegIrqMask);
-
+	if (napi_schedule_prep(&np->napi)) {
+		/*
+		 * Disable further irq's (msix not enabled with napi)
+		 */
+		writel(0, base + NvRegIrqMask);
+		__napi_schedule(&np->napi);
+	}
 #else
 	do
 	{


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1754
retrieving revision 1.1755
diff -u -p -r1.1754 -r1.1755
--- kernel.spec	6 Oct 2009 12:23:53 -0000	1.1754
+++ kernel.spec	6 Oct 2009 12:37:23 -0000	1.1755
@@ -685,6 +685,9 @@ Patch1826: drm-i915-enable-mchbar.patch
 # kludge to make ich9 e1000 work
 Patch2000: linux-2.6-e1000-ich9.patch
 
+# fix forcedeth race (#526546)
+Patch2010: forcedeth-fix-napi-race.patch
+
 # linux1394 git patches
 Patch2200: linux-2.6-firewire-git-update.patch
 Patch2201: linux-2.6-firewire-git-pending.patch
@@ -1295,6 +1298,9 @@ ApplyPatch linux-2.6-neigh_-fix-state-tr
 # add ich9 lan
 ApplyPatch linux-2.6-e1000-ich9.patch
 
+# fix forcedeth race
+ApplyPatch forcedeth-fix-napi-race.patch
+
 # Virt Fixes
 # Xen Guest
 ApplyPatch linux-2.6-xen-fix-brkpoints-hw-watchpoints.patch
@@ -2026,6 +2032,9 @@ fi
 # and build.
 
 %changelog
+* Tue Oct 06 2009  Chuck Ebbert <cebbert at redhat.com>  2.6.30.9-76
+- fix race in forcedeth network driver (#526546)
+
 * Tue Oct 06 2009  Chuck Ebbert <cebbert at redhat.com>  2.6.30.9-75
 - x86: Don't leak 64-bit reg contents to 32-bit tasks.
 




More information about the fedora-extras-commits mailing list