[openib-general] ip over ib throughtput
Grant Grundler
iod00d at hp.com
Mon Jan 10 22:44:35 PST 2005
On Tue, Jan 04, 2005 at 05:11:11PM -0800, Roland Dreier wrote:
> My previous patch seems like it won't work (need MSGINT_MODE_ENABLE
> set too, according to http://www.ussg.iu.edu/hypermail/linux/kernel/0301.3/0123.html)
>
> Index: linux-bk/drivers/net/tg3.c
> ===================================================================
> --- linux-bk.orig/drivers/net/tg3.c 2004-12-29 22:05:41.000000000 -0800
> +++ linux-bk/drivers/net/tg3.c 2005-01-04 17:09:23.930140627 -0800
> @@ -8218,6 +8218,11 @@
> pci_using_dac = 0;
> }
>
> + if (pci_enable_msi(pdev))
> + printk(KERN_WARNING PFX "Couldn't enable MSI.\n");
> + else
> + tw32(MSGINT_MODE, MSGINT_MODE_ENABLE);
> +
Roland,
This bit is right, but in the wrong place.
My bad: concluding the ia64 linux MSI broken was premature.
I didn't figure out why, but moving this chunk to immediately
before request_irq() worked fine. Normally I expect _probe_one to get
called before _open... but maybe something else needed to happen
before pci_enable_msi() could be called.
I also added pci_disable_msi() *after* each free_irq() call.
The appended patch is not ready for prime time yet but
certainly worth reviewing/testing. I'll post it to
linux-net once I've added a "msi=1" driver parameter.
Now to benchmark the difference...and then I can poke at
OpenIB again (once I get the right firmware on the cards...)
thanks,
grant
Log: preliminary patch to enable MSI in tg3.
Needs "msi" driver flag so MSI is only used when specified.
Signed-off-by: Grant Grundler <grant.grundler at hp.com>
===== drivers/net/tg3.c 1.222 vs edited =====
--- 1.222/drivers/net/tg3.c 2004-11-15 15:53:08 -08:00
+++ edited/drivers/net/tg3.c 2005-01-10 22:21:34 -08:00
@@ -60,8 +60,8 @@
#define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": "
-#define DRV_MODULE_VERSION "3.14"
-#define DRV_MODULE_RELDATE "November 15, 2004"
+#define DRV_MODULE_VERSION "3.14-msi"
+#define DRV_MODULE_RELDATE "Jan 10, 2005"
#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
@@ -5679,10 +5679,18 @@
if (err)
return err;
+ if (pci_enable_msi(tp->pdev))
+ printk(KERN_WARNING PFX "Couldn't enable MSI.\n");
+ else {
+ tw32(MSGINT_MODE, MSGINT_MODE_ENABLE);
+ printk(PFX "MSI enabled.\n");
+ }
+
err = request_irq(dev->irq, tg3_interrupt,
SA_SHIRQ, dev->name, dev);
if (err) {
+ pci_disable_msi(tp->pdev);
tg3_free_consistent(tp);
return err;
}
@@ -5713,6 +5721,7 @@
if (err) {
free_irq(dev->irq, dev);
+ pci_disable_msi(tp->pdev);
tg3_free_consistent(tp);
return err;
}
@@ -5988,6 +5997,7 @@
spin_unlock_irq(&tp->lock);
free_irq(dev->irq, dev);
+ pci_disable_msi(tp->pdev);
memcpy(&tp->net_stats_prev, tg3_get_stats(tp->dev),
sizeof(tp->net_stats_prev));
More information about the general
mailing list