Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2388

kernel-2.6.18-238.el5.src.rpm

From: Neil Horman <nhorman@redhat.com>
Date: Mon, 17 Nov 2008 14:49:10 -0500
Subject: [net] bnx2: fix oops on call to poll_controller
Message-id: 20081117194910.GB5561@hmsendeavour.rdu.redhat.com
O-Subject: [RHEL 5.3 PATCH] fix oops in bnx2 on call to poll_controller (bz 470625)
Bugzilla: 470625
RH-Acked-by: David Miller <davem@redhat.com>
RH-Acked-by: Thomas Graf <tgraf@redhat.com>
RH-Acked-by: Andy Gospodarek <gospo@redhat.com>

Hey-
	This is a backport of a recent fix I sent upstream to fix an oops on
bnx2.  Theres a  mismatch on the data strcuture we pass to bnx2_interrupt from
the poll_controller method (a net_device) and what bnx2_interrupt expects (a
bnx2_napi).  This fix also includes a a fix to poll every rx queue in the bnx2
driver instance, since we never receive on the 'real' interface.  It won't do
anything at the moment, since the netpoll infrastructure doesn't walk the entire
poll_list for a given cpu, but thats ok because we currently don't have any
netpoll clients that need to receive frames anyway :).  Its just inluded here
for completeness, as Andy and I are planning on getting around to having RHEL5
netpoll support multiqueue in a release or two.

Neil

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 00acdd3..87e7e77 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -7261,10 +7261,13 @@ static void
 poll_bnx2(struct net_device *dev)
 {
 	struct bnx2 *bp = netdev_priv(dev);
+	int i;
 
-	disable_irq(bp->pdev->irq);
-	bnx2_interrupt(bp->pdev->irq, dev, NULL);
-	enable_irq(bp->pdev->irq);
+	for (i = 0; i < bp->irq_nvecs; i++) {
+		disable_irq(bp->irq_tbl[i].vector);
+		bnx2_interrupt(bp->irq_tbl[i].vector, &bp->bnx2_napi[i], NULL);
+		enable_irq(bp->irq_tbl[i].vector);
+	}
 }
 #endif