aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2006-12-02 13:34:56 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-12-03 10:31:04 -0500
commit4ff43246e45943200ae3233732adf8708c2faef6 (patch)
tree28204d5a11c4ca0de54c36a9e0bca9cfd3317f1c /drivers/scsi
parentc7743956f8cb7b496c05d8444050eba908662a14 (diff)
[SCSI] lpfc 8.1.11 : Add MSI (Message Signalled Interrupts) support
Add MSI (Message Signalled Interrupts) support Actual use must be enabled via the new module parameter "lpfc_use_msi" Defaults to no use Many thanks to Frederic Temporelli who implemented the initial patch. Signed-off-by: Frederic Temporelli <frederic.temporelli@ext.bull.net> Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/lpfc/lpfc.h1
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c11
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c10
3 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index e94190e83fc3..1ec9cf0e374a 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -303,6 +303,7 @@ struct lpfc_hba {
303 uint32_t cfg_max_luns; 303 uint32_t cfg_max_luns;
304 uint32_t cfg_poll; 304 uint32_t cfg_poll;
305 uint32_t cfg_poll_tmo; 305 uint32_t cfg_poll_tmo;
306 uint32_t cfg_use_msi;
306 uint32_t cfg_sg_seg_cnt; 307 uint32_t cfg_sg_seg_cnt;
307 uint32_t cfg_sg_dma_buf_size; 308 uint32_t cfg_sg_dma_buf_size;
308 uint64_t cfg_soft_wwpn; 309 uint64_t cfg_soft_wwpn;
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 73d3afc72de2..e2ac7ba3d8ad 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -961,6 +961,15 @@ LPFC_ATTR_R(max_luns, 255, 0, 65535,
961LPFC_ATTR_RW(poll_tmo, 10, 1, 255, 961LPFC_ATTR_RW(poll_tmo, 10, 1, 255,
962 "Milliseconds driver will wait between polling FCP ring"); 962 "Milliseconds driver will wait between polling FCP ring");
963 963
964/*
965# lpfc_use_msi: Use MSI (Message Signaled Interrupts) in systems that
966# support this feature
967# 0 = MSI disabled (default)
968# 1 = MSI enabled
969# Value range is [0,1]. Default value is 0.
970*/
971LPFC_ATTR_R(use_msi, 0, 0, 1, "Use Message Signaled Interrupts, if possible");
972
964 973
965struct class_device_attribute *lpfc_host_attrs[] = { 974struct class_device_attribute *lpfc_host_attrs[] = {
966 &class_device_attr_info, 975 &class_device_attr_info,
@@ -999,6 +1008,7 @@ struct class_device_attribute *lpfc_host_attrs[] = {
999 &class_device_attr_issue_reset, 1008 &class_device_attr_issue_reset,
1000 &class_device_attr_lpfc_poll, 1009 &class_device_attr_lpfc_poll,
1001 &class_device_attr_lpfc_poll_tmo, 1010 &class_device_attr_lpfc_poll_tmo,
1011 &class_device_attr_lpfc_use_msi,
1002 &class_device_attr_lpfc_soft_wwpn, 1012 &class_device_attr_lpfc_soft_wwpn,
1003 &class_device_attr_lpfc_soft_wwpn_enable, 1013 &class_device_attr_lpfc_soft_wwpn_enable,
1004 NULL, 1014 NULL,
@@ -1801,6 +1811,7 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
1801 lpfc_discovery_threads_init(phba, lpfc_discovery_threads); 1811 lpfc_discovery_threads_init(phba, lpfc_discovery_threads);
1802 lpfc_max_luns_init(phba, lpfc_max_luns); 1812 lpfc_max_luns_init(phba, lpfc_max_luns);
1803 lpfc_poll_tmo_init(phba, lpfc_poll_tmo); 1813 lpfc_poll_tmo_init(phba, lpfc_poll_tmo);
1814 lpfc_use_msi_init(phba, lpfc_use_msi);
1804 lpfc_devloss_tmo_init(phba, lpfc_devloss_tmo); 1815 lpfc_devloss_tmo_init(phba, lpfc_devloss_tmo);
1805 lpfc_nodev_tmo_init(phba, lpfc_nodev_tmo); 1816 lpfc_nodev_tmo_init(phba, lpfc_nodev_tmo);
1806 phba->cfg_poll = lpfc_poll; 1817 phba->cfg_poll = lpfc_poll;
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 6b0718573ac5..71ee0cd32216 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1653,6 +1653,14 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1653 if (error) 1653 if (error)
1654 goto out_remove_host; 1654 goto out_remove_host;
1655 1655
1656 if (phba->cfg_use_msi) {
1657 error = pci_enable_msi(phba->pcidev);
1658 if (error)
1659 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, "%d:0452 "
1660 "Enable MSI failed, continuing with "
1661 "IRQ\n", phba->brd_no);
1662 }
1663
1656 error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED, 1664 error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED,
1657 LPFC_DRIVER_NAME, phba); 1665 LPFC_DRIVER_NAME, phba);
1658 if (error) { 1666 if (error) {
@@ -1732,6 +1740,7 @@ out_free_irq:
1732 lpfc_stop_timer(phba); 1740 lpfc_stop_timer(phba);
1733 phba->work_hba_events = 0; 1741 phba->work_hba_events = 0;
1734 free_irq(phba->pcidev->irq, phba); 1742 free_irq(phba->pcidev->irq, phba);
1743 pci_disable_msi(phba->pcidev);
1735out_free_sysfs_attr: 1744out_free_sysfs_attr:
1736 lpfc_free_sysfs_attr(phba); 1745 lpfc_free_sysfs_attr(phba);
1737out_remove_host: 1746out_remove_host:
@@ -1798,6 +1807,7 @@ lpfc_pci_remove_one(struct pci_dev *pdev)
1798 1807
1799 /* Release the irq reservation */ 1808 /* Release the irq reservation */
1800 free_irq(phba->pcidev->irq, phba); 1809 free_irq(phba->pcidev->irq, phba);
1810 pci_disable_msi(phba->pcidev);
1801 1811
1802 lpfc_cleanup(phba, 0); 1812 lpfc_cleanup(phba, 0);
1803 lpfc_stop_timer(phba); 1813 lpfc_stop_timer(phba);