From: Marcus Barrow <mbarrow@redhat.com> Date: Fri, 6 Nov 2009 13:13:03 -0500 Subject: [scsi] qla2xxx: enable msi-x correctly on qlogic 2xxx series Message-id: <20091106131303.7878.56038.sendpatchset@file.bos.redhat.com> Patchwork-id: 21321 O-Subject: [rhel 5.5 patch] [V2] qla2xxx - Enable MSI-X and make that code readable.. Bugzilla: 531593 RH-Acked-by: Tomas Henzl <thenzl@redhat.com> RH-Acked-by: Rob Evers <revers@redhat.com> BZ 531593 This is version 2 of this patch. It replaces a line in the module paramter description that was dropped by mistake. In a previous patch we failed to enable MSI-X and also to correctly and cleanly handle the module parameter to control this behaviour. This is an important fix which is requested to be back ported for z-stream by IBM. This patch has been tested by IBM and produces the expected behaviour, which is about a 3x improvement in performance on their PPC blades. It applies and builds cleanly with 2.6.18-165. diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 5021c27..46eb081 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1967,26 +1967,11 @@ qla2x00_request_irqs(scsi_qla_host_t *ha) { int ret; - /* If possible, enable MSI-X. */ - if (!IS_QLA2432(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) - && !IS_QLA8001(ha)) + /* If possible, enable MSI-X, MSI. */ + if ( ql2xenablemsix == 0 || (!IS_QLA2432(ha) && !IS_QLA2532(ha) + && !IS_QLA8432(ha) && !IS_QLA8001(ha))) goto skip_msi; - if (ql2xenablemsix == 2) - goto skip_msix; - - if (ql2xenablemsix != 1) - goto skip_msi; - - if (IS_QLA2432(ha) && (ha->chip_revision < QLA_MSIX_CHIP_REV_24XX || - !QLA_MSIX_FW_MODE_1(ha->fw_attributes))) { - DEBUG2(qla_printk(KERN_WARNING, ha, - "MSI-X: Unsupported ISP2432 (0x%X, 0x%X).\n", - ha->chip_revision, ha->fw_attributes)); - - goto skip_msix; - } - if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_HP && (ha->pdev->subsystem_device == 0x7040 || ha->pdev->subsystem_device == 0x7041 || @@ -1998,6 +1983,17 @@ qla2x00_request_irqs(scsi_qla_host_t *ha) goto skip_msi; } + if (ql2xenablemsix == 2) + goto skip_msix; + + if (IS_QLA2432(ha) && (ha->chip_revision < QLA_MSIX_CHIP_REV_24XX || + !QLA_MSIX_FW_MODE_1(ha->fw_attributes))) { + DEBUG2(qla_printk(KERN_WARNING, ha, + "MSI-X: Unsupported ISP2432 (0x%X, 0x%X).\n", + ha->chip_revision, ha->fw_attributes)); + goto skip_msix; + } + ret = qla24xx_enable_msix(ha); if (!ret) { DEBUG2(qla_printk(KERN_INFO, ha, diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index b1aa938..6d2349e 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -105,11 +105,12 @@ MODULE_PARM_DESC(ql2xqfullrampup, "depth for a device after a queue-full condition has been " "detected. Default is 120 seconds."); -int ql2xenablemsix = 0; +int ql2xenablemsix = 1; module_param(ql2xenablemsix, int, S_IRUGO|S_IRUSR); MODULE_PARM_DESC(ql2xenablemsix, "Set to enable MSI or MSI-X interrupt mechanism." - " Default is 0, enable traditional pin-based interrupt mechanism." + " Default is 1, enable MSI-X interrupt mechanism." + " 0 = enable traditional pin-based mechanism." " 1 = enable MSI-X interrupt mechanism." " 2 = enable MSI interrupt mechanism."); diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index ed31feb..7494018 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION "8.03.01.02.05.05-k" +#define QLA2XXX_VERSION "8.03.01.03.05.05-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 3