aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 9efe5f82a6a1..176302f0e02c 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4551,6 +4551,13 @@ lpfc_sli_driver_resource_setup(struct lpfc_hba *phba)
4551 phba->cfg_sg_seg_cnt = LPFC_DEFAULT_MENLO_SG_SEG_CNT; 4551 phba->cfg_sg_seg_cnt = LPFC_DEFAULT_MENLO_SG_SEG_CNT;
4552 } 4552 }
4553 4553
4554 if (!phba->sli.ring)
4555 phba->sli.ring = (struct lpfc_sli_ring *)
4556 kzalloc(LPFC_SLI3_MAX_RING *
4557 sizeof(struct lpfc_sli_ring), GFP_KERNEL);
4558 if (!phba->sli.ring)
4559 return -ENOMEM;
4560
4554 /* 4561 /*
4555 * Since the sg_tablesize is module parameter, the sg_dma_buf_size 4562 * Since the sg_tablesize is module parameter, the sg_dma_buf_size
4556 * used to create the sg_dma_buf_pool must be dynamically calculated. 4563 * used to create the sg_dma_buf_pool must be dynamically calculated.
@@ -4710,6 +4717,16 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
4710 sges_per_segment = 2; 4717 sges_per_segment = 2;
4711 4718
4712 /* 4719 /*
4720 * For SLI4, instead of using ring 0 (LPFC_FCP_RING) for FCP commands
4721 * we will associate a new ring, for each FCP fastpath EQ/CQ/WQ tuple.
4722 */
4723 if (!phba->sli.ring)
4724 phba->sli.ring = kzalloc(
4725 (LPFC_SLI3_MAX_RING + phba->cfg_fcp_eq_count) *
4726 sizeof(struct lpfc_sli_ring), GFP_KERNEL);
4727 if (!phba->sli.ring)
4728 return -ENOMEM;
4729 /*
4713 * Since the sg_tablesize is module parameter, the sg_dma_buf_size 4730 * Since the sg_tablesize is module parameter, the sg_dma_buf_size
4714 * used to create the sg_dma_buf_pool must be dynamically calculated. 4731 * used to create the sg_dma_buf_pool must be dynamically calculated.
4715 * 2 segments are added since the IOCB needs a command and response bde. 4732 * 2 segments are added since the IOCB needs a command and response bde.
@@ -5555,6 +5572,10 @@ lpfc_hba_free(struct lpfc_hba *phba)
5555 /* Release the driver assigned board number */ 5572 /* Release the driver assigned board number */
5556 idr_remove(&lpfc_hba_index, phba->brd_no); 5573 idr_remove(&lpfc_hba_index, phba->brd_no);
5557 5574
5575 /* Free memory allocated with sli rings */
5576 kfree(phba->sli.ring);
5577 phba->sli.ring = NULL;
5578
5558 kfree(phba); 5579 kfree(phba);
5559 return; 5580 return;
5560} 5581}
@@ -6924,6 +6945,8 @@ lpfc_sli4_queue_destroy(struct lpfc_hba *phba)
6924int 6945int
6925lpfc_sli4_queue_setup(struct lpfc_hba *phba) 6946lpfc_sli4_queue_setup(struct lpfc_hba *phba)
6926{ 6947{
6948 struct lpfc_sli *psli = &phba->sli;
6949 struct lpfc_sli_ring *pring;
6927 int rc = -ENOMEM; 6950 int rc = -ENOMEM;
6928 int fcp_eqidx, fcp_cqidx, fcp_wqidx; 6951 int fcp_eqidx, fcp_cqidx, fcp_wqidx;
6929 int fcp_cq_index = 0; 6952 int fcp_cq_index = 0;
@@ -7107,6 +7130,12 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba)
7107 "rc = 0x%x\n", rc); 7130 "rc = 0x%x\n", rc);
7108 goto out_destroy_mbx_wq; 7131 goto out_destroy_mbx_wq;
7109 } 7132 }
7133
7134 /* Bind this WQ to the ELS ring */
7135 pring = &psli->ring[LPFC_ELS_RING];
7136 pring->sli.sli4.wqp = (void *)phba->sli4_hba.els_wq;
7137 phba->sli4_hba.els_cq->pring = pring;
7138
7110 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 7139 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
7111 "2590 ELS WQ setup: wq-id=%d, parent cq-id=%d\n", 7140 "2590 ELS WQ setup: wq-id=%d, parent cq-id=%d\n",
7112 phba->sli4_hba.els_wq->queue_id, 7141 phba->sli4_hba.els_wq->queue_id,
@@ -7137,6 +7166,12 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba)
7137 "WQ (%d), rc = 0x%x\n", fcp_wqidx, rc); 7166 "WQ (%d), rc = 0x%x\n", fcp_wqidx, rc);
7138 goto out_destroy_fcp_wq; 7167 goto out_destroy_fcp_wq;
7139 } 7168 }
7169
7170 /* Bind this WQ to the next FCP ring */
7171 pring = &psli->ring[MAX_SLI3_CONFIGURED_RINGS + fcp_wqidx];
7172 pring->sli.sli4.wqp = (void *)phba->sli4_hba.fcp_wq[fcp_wqidx];
7173 phba->sli4_hba.fcp_cq[fcp_cq_index]->pring = pring;
7174
7140 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 7175 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
7141 "2591 FCP WQ setup: wq[%d]-id=%d, " 7176 "2591 FCP WQ setup: wq[%d]-id=%d, "
7142 "parent cq[%d]-id=%d\n", 7177 "parent cq[%d]-id=%d\n",