diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-12-01 19:36:20 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 00:24:50 -0500 |
commit | 325dde48914e8ec1614d79ffacdbf9c0b8d24f42 (patch) | |
tree | 7409d3503cd7dbf9b57e6974388a9b386d804be0 /drivers/net/chelsio | |
parent | 57834ca152d5979f3f84f4e25f29f423e19d38fa (diff) |
[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/net/chelsio')
-rw-r--r-- | drivers/net/chelsio/common.h | 1 | ||||
-rw-r--r-- | drivers/net/chelsio/cxgb2.c | 20 |
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 { | |||
228 | unsigned short chip_revision; | 228 | unsigned short chip_revision; |
229 | unsigned char chip_version; | 229 | unsigned char chip_version; |
230 | unsigned char is_asic; | 230 | unsigned char is_asic; |
231 | unsigned char has_msi; | ||
231 | }; | 232 | }; |
232 | 233 | ||
233 | struct link_config { | 234 | 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. */ | |||
107 | module_param(t1powersave, int, 0); | 107 | module_param(t1powersave, int, 0); |
108 | MODULE_PARM_DESC(t1powersave, "Enable/Disable T1 powersaving mode"); | 108 | MODULE_PARM_DESC(t1powersave, "Enable/Disable T1 powersaving mode"); |
109 | 109 | ||
110 | static int disable_msi = 0; | ||
111 | module_param(disable_msi, int, 0); | ||
112 | MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); | ||
113 | |||
110 | static const char pci_speed[][4] = { | 114 | static const char pci_speed[][4] = { |
111 | "33", "66", "100", "133" | 115 | "33", "66", "100", "133" |
112 | }; | 116 | }; |
@@ -215,11 +219,19 @@ static int cxgb_up(struct adapter *adapter) | |||
215 | } | 219 | } |
216 | 220 | ||
217 | t1_interrupts_clear(adapter); | 221 | t1_interrupts_clear(adapter); |
218 | if ((err = request_irq(adapter->pdev->irq, | 222 | |
219 | t1_select_intr_handler(adapter), IRQF_SHARED, | 223 | adapter->params.has_msi = !disable_msi && pci_enable_msi(adapter->pdev) == 0; |
220 | adapter->name, adapter))) { | 224 | err = request_irq(adapter->pdev->irq, |
225 | t1_select_intr_handler(adapter), | ||
226 | adapter->params.has_msi ? 0 : IRQF_SHARED, | ||
227 | adapter->name, adapter); | ||
228 | if (err) { | ||
229 | if (adapter->params.has_msi) | ||
230 | pci_disable_msi(adapter->pdev); | ||
231 | |||
221 | goto out_err; | 232 | goto out_err; |
222 | } | 233 | } |
234 | |||
223 | t1_sge_start(adapter->sge); | 235 | t1_sge_start(adapter->sge); |
224 | t1_interrupts_enable(adapter); | 236 | t1_interrupts_enable(adapter); |
225 | out_err: | 237 | out_err: |
@@ -234,6 +246,8 @@ static void cxgb_down(struct adapter *adapter) | |||
234 | t1_sge_stop(adapter->sge); | 246 | t1_sge_stop(adapter->sge); |
235 | t1_interrupts_disable(adapter); | 247 | t1_interrupts_disable(adapter); |
236 | free_irq(adapter->pdev->irq, adapter); | 248 | free_irq(adapter->pdev->irq, adapter); |
249 | if (adapter->params.has_msi) | ||
250 | pci_disable_msi(adapter->pdev); | ||
237 | } | 251 | } |
238 | 252 | ||
239 | static int cxgb_open(struct net_device *dev) | 253 | static int cxgb_open(struct net_device *dev) |