summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-12-01 16:36:20 -0800
committerJeff Garzik <jeff@garzik.org>2006-12-02 00:24:50 -0500
commit325dde48914e8ec1614d79ffacdbf9c0b8d24f42 (patch)
tree7409d3503cd7dbf9b57e6974388a9b386d804be0 /drivers
parent57834ca152d5979f3f84f4e25f29f423e19d38fa (diff)
downloadlinux-stable-325dde48914e8ec1614d79ffacdbf9c0b8d24f42.tar.gz
linux-stable-325dde48914e8ec1614d79ffacdbf9c0b8d24f42.tar.bz2
linux-stable-325dde48914e8ec1614d79ffacdbf9c0b8d24f42.zip
[PATCH] chelsio: add MSI support
Using MSI can avoid sharing IRQ and associated overhead. Tested on PCI-X. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/chelsio/common.h1
-rw-r--r--drivers/net/chelsio/cxgb2.c20
2 files changed, 18 insertions, 3 deletions
diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h
index 55f1eaad115c..b265941e1372 100644
--- a/drivers/net/chelsio/common.h
+++ b/drivers/net/chelsio/common.h
@@ -228,6 +228,7 @@ struct adapter_params {
unsigned short chip_revision;
unsigned char chip_version;
unsigned char is_asic;
+ unsigned char has_msi;
};
struct link_config {
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 571aa06ddfd4..0ca5b07c1a6b 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -107,6 +107,10 @@ static int t1powersave = 1; /* HW default is powersave mode. */
module_param(t1powersave, int, 0);
MODULE_PARM_DESC(t1powersave, "Enable/Disable T1 powersaving mode");
+static int disable_msi = 0;
+module_param(disable_msi, int, 0);
+MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
+
static const char pci_speed[][4] = {
"33", "66", "100", "133"
};
@@ -215,11 +219,19 @@ static int cxgb_up(struct adapter *adapter)
}
t1_interrupts_clear(adapter);
- if ((err = request_irq(adapter->pdev->irq,
- t1_select_intr_handler(adapter), IRQF_SHARED,
- adapter->name, adapter))) {
+
+ adapter->params.has_msi = !disable_msi && pci_enable_msi(adapter->pdev) == 0;
+ err = request_irq(adapter->pdev->irq,
+ t1_select_intr_handler(adapter),
+ adapter->params.has_msi ? 0 : IRQF_SHARED,
+ adapter->name, adapter);
+ if (err) {
+ if (adapter->params.has_msi)
+ pci_disable_msi(adapter->pdev);
+
goto out_err;
}
+
t1_sge_start(adapter->sge);
t1_interrupts_enable(adapter);
out_err:
@@ -234,6 +246,8 @@ static void cxgb_down(struct adapter *adapter)
t1_sge_stop(adapter->sge);
t1_interrupts_disable(adapter);
free_irq(adapter->pdev->irq, adapter);
+ if (adapter->params.has_msi)
+ pci_disable_msi(adapter->pdev);
}
static int cxgb_open(struct net_device *dev)