aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c40
-rw-r--r--drivers/scsi/lpfc/lpfc_sli4.h4
2 files changed, 22 insertions, 22 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 8a55a586dd65..12014eb528ea 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4947,7 +4947,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
4947 } 4947 }
4948 4948
4949 phba->sli4_hba.msix_entries = kzalloc((sizeof(struct msix_entry) * 4949 phba->sli4_hba.msix_entries = kzalloc((sizeof(struct msix_entry) *
4950 phba->sli4_hba.cfg_eqn), GFP_KERNEL); 4950 phba->cfg_fcp_io_channel), GFP_KERNEL);
4951 if (!phba->sli4_hba.msix_entries) { 4951 if (!phba->sli4_hba.msix_entries) {
4952 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 4952 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
4953 "2573 Failed allocate memory for msi-x " 4953 "2573 Failed allocate memory for msi-x "
@@ -6559,7 +6559,8 @@ lpfc_sli4_queue_verify(struct lpfc_hba *phba)
6559 i++; 6559 i++;
6560 } 6560 }
6561 if (i < cfg_fcp_io_channel) { 6561 if (i < cfg_fcp_io_channel) {
6562 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, 6562 lpfc_printf_log(phba,
6563 KERN_ERR, LOG_INIT,
6563 "3188 Reducing IO channels to match number of " 6564 "3188 Reducing IO channels to match number of "
6564 "CPUs: from %d to %d\n", cfg_fcp_io_channel, i); 6565 "CPUs: from %d to %d\n", cfg_fcp_io_channel, i);
6565 cfg_fcp_io_channel = i; 6566 cfg_fcp_io_channel = i;
@@ -6567,8 +6568,8 @@ lpfc_sli4_queue_verify(struct lpfc_hba *phba)
6567 6568
6568 if (cfg_fcp_io_channel > 6569 if (cfg_fcp_io_channel >
6569 phba->sli4_hba.max_cfg_param.max_eq) { 6570 phba->sli4_hba.max_cfg_param.max_eq) {
6570 cfg_fcp_io_channel = phba->sli4_hba.max_cfg_param.max_eq; 6571 if (phba->sli4_hba.max_cfg_param.max_eq <
6571 if (cfg_fcp_io_channel < LPFC_FCP_IO_CHAN_MIN) { 6572 LPFC_FCP_IO_CHAN_MIN) {
6572 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 6573 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6573 "2574 Not enough EQs (%d) from the " 6574 "2574 Not enough EQs (%d) from the "
6574 "pci function for supporting FCP " 6575 "pci function for supporting FCP "
@@ -6577,13 +6578,12 @@ lpfc_sli4_queue_verify(struct lpfc_hba *phba)
6577 phba->cfg_fcp_io_channel); 6578 phba->cfg_fcp_io_channel);
6578 goto out_error; 6579 goto out_error;
6579 } 6580 }
6580 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, 6581 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6581 "2575 Not enough EQs (%d) from the pci " 6582 "2575 Reducing IO channels to match number of "
6582 "function for supporting the requested " 6583 "available EQs: from %d to %d\n",
6583 "FCP EQs (%d), the actual FCP EQs can " 6584 cfg_fcp_io_channel,
6584 "be supported: %d\n", 6585 phba->sli4_hba.max_cfg_param.max_eq);
6585 phba->sli4_hba.max_cfg_param.max_eq, 6586 cfg_fcp_io_channel = phba->sli4_hba.max_cfg_param.max_eq;
6586 phba->cfg_fcp_io_channel, cfg_fcp_io_channel);
6587 } 6587 }
6588 6588
6589 /* Eventually cfg_fcp_eq_count / cfg_fcp_wq_count will be depricated */ 6589 /* Eventually cfg_fcp_eq_count / cfg_fcp_wq_count will be depricated */
@@ -6592,7 +6592,6 @@ lpfc_sli4_queue_verify(struct lpfc_hba *phba)
6592 phba->cfg_fcp_eq_count = cfg_fcp_io_channel; 6592 phba->cfg_fcp_eq_count = cfg_fcp_io_channel;
6593 phba->cfg_fcp_wq_count = cfg_fcp_io_channel; 6593 phba->cfg_fcp_wq_count = cfg_fcp_io_channel;
6594 phba->cfg_fcp_io_channel = cfg_fcp_io_channel; 6594 phba->cfg_fcp_io_channel = cfg_fcp_io_channel;
6595 phba->sli4_hba.cfg_eqn = cfg_fcp_io_channel;
6596 6595
6597 /* Get EQ depth from module parameter, fake the default for now */ 6596 /* Get EQ depth from module parameter, fake the default for now */
6598 phba->sli4_hba.eq_esize = LPFC_EQE_SIZE_4B; 6597 phba->sli4_hba.eq_esize = LPFC_EQE_SIZE_4B;
@@ -8095,11 +8094,11 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
8095 int vectors, rc, index; 8094 int vectors, rc, index;
8096 8095
8097 /* Set up MSI-X multi-message vectors */ 8096 /* Set up MSI-X multi-message vectors */
8098 for (index = 0; index < phba->sli4_hba.cfg_eqn; index++) 8097 for (index = 0; index < phba->cfg_fcp_io_channel; index++)
8099 phba->sli4_hba.msix_entries[index].entry = index; 8098 phba->sli4_hba.msix_entries[index].entry = index;
8100 8099
8101 /* Configure MSI-X capability structure */ 8100 /* Configure MSI-X capability structure */
8102 vectors = phba->sli4_hba.cfg_eqn; 8101 vectors = phba->cfg_fcp_io_channel;
8103enable_msix_vectors: 8102enable_msix_vectors:
8104 rc = pci_enable_msix(phba->pcidev, phba->sli4_hba.msix_entries, 8103 rc = pci_enable_msix(phba->pcidev, phba->sli4_hba.msix_entries,
8105 vectors); 8104 vectors);
@@ -8142,8 +8141,14 @@ enable_msix_vectors:
8142 goto cfg_fail_out; 8141 goto cfg_fail_out;
8143 } 8142 }
8144 } 8143 }
8145 phba->sli4_hba.msix_vec_nr = vectors;
8146 8144
8145 if (vectors != phba->cfg_fcp_io_channel) {
8146 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
8147 "3238 Reducing IO channels to match number of "
8148 "MSI-X vectors, requested %d got %d\n",
8149 phba->cfg_fcp_io_channel, vectors);
8150 phba->cfg_fcp_io_channel = vectors;
8151 }
8147 return rc; 8152 return rc;
8148 8153
8149cfg_fail_out: 8154cfg_fail_out:
@@ -8171,7 +8176,7 @@ lpfc_sli4_disable_msix(struct lpfc_hba *phba)
8171 int index; 8176 int index;
8172 8177
8173 /* Free up MSI-X multi-message vectors */ 8178 /* Free up MSI-X multi-message vectors */
8174 for (index = 0; index < phba->sli4_hba.msix_vec_nr; index++) 8179 for (index = 0; index < phba->cfg_fcp_io_channel; index++)
8175 free_irq(phba->sli4_hba.msix_entries[index].vector, 8180 free_irq(phba->sli4_hba.msix_entries[index].vector,
8176 &phba->sli4_hba.fcp_eq_hdl[index]); 8181 &phba->sli4_hba.fcp_eq_hdl[index]);
8177 8182
@@ -9525,9 +9530,6 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid)
9525 /* Default to single EQ for non-MSI-X */ 9530 /* Default to single EQ for non-MSI-X */
9526 if (phba->intr_type != MSIX) 9531 if (phba->intr_type != MSIX)
9527 adjusted_fcp_io_channel = 1; 9532 adjusted_fcp_io_channel = 1;
9528 else if (phba->sli4_hba.msix_vec_nr <
9529 phba->cfg_fcp_io_channel)
9530 adjusted_fcp_io_channel = phba->sli4_hba.msix_vec_nr;
9531 else 9533 else
9532 adjusted_fcp_io_channel = phba->cfg_fcp_io_channel; 9534 adjusted_fcp_io_channel = phba->cfg_fcp_io_channel;
9533 phba->cfg_fcp_io_channel = adjusted_fcp_io_channel; 9535 phba->cfg_fcp_io_channel = adjusted_fcp_io_channel;
diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h
index 61ff9aac918d..613f581faf94 100644
--- a/drivers/scsi/lpfc/lpfc_sli4.h
+++ b/drivers/scsi/lpfc/lpfc_sli4.h
@@ -37,7 +37,7 @@
37/* Multi-queue arrangement for FCP EQ/CQ/WQ tuples */ 37/* Multi-queue arrangement for FCP EQ/CQ/WQ tuples */
38#define LPFC_FCP_IO_CHAN_DEF 4 38#define LPFC_FCP_IO_CHAN_DEF 4
39#define LPFC_FCP_IO_CHAN_MIN 1 39#define LPFC_FCP_IO_CHAN_MIN 1
40#define LPFC_FCP_IO_CHAN_MAX 8 40#define LPFC_FCP_IO_CHAN_MAX 16
41 41
42/* 42/*
43 * Provide the default FCF Record attributes used by the driver 43 * Provide the default FCF Record attributes used by the driver
@@ -490,8 +490,6 @@ struct lpfc_sli4_hba {
490 struct lpfc_pc_sli4_params pc_sli4_params; 490 struct lpfc_pc_sli4_params pc_sli4_params;
491 struct msix_entry *msix_entries; 491 struct msix_entry *msix_entries;
492 uint8_t handler_name[LPFC_FCP_IO_CHAN_MAX][LPFC_SLI4_HANDLER_NAME_SZ]; 492 uint8_t handler_name[LPFC_FCP_IO_CHAN_MAX][LPFC_SLI4_HANDLER_NAME_SZ];
493 uint32_t cfg_eqn;
494 uint32_t msix_vec_nr;
495 struct lpfc_fcp_eq_hdl *fcp_eq_hdl; /* FCP per-WQ handle */ 493 struct lpfc_fcp_eq_hdl *fcp_eq_hdl; /* FCP per-WQ handle */
496 494
497 /* Pointers to the constructed SLI4 queues */ 495 /* Pointers to the constructed SLI4 queues */