aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_sli.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2012-06-12 13:54:50 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 03:58:29 -0400
commit173edbb2c326ce4839bae8caa868fe83ce46dda3 (patch)
tree5d307e89546f9745346b04978ab9821e2d2aaab9 /drivers/scsi/lpfc/lpfc_sli.c
parent3a70730aa06c37d46086ecdbca7107531fe2d2c5 (diff)
[SCSI] lpfc 8.3.32: Fix ability to change FCP EQ delay multiplier
Fix fcp_imax module parameter to dynamically change FCP EQ delay multiplier Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 3333e64703a3..9cbd20b1328b 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -12048,6 +12048,83 @@ out_fail:
12048} 12048}
12049 12049
12050/** 12050/**
12051 * lpfc_modify_fcp_eq_delay - Modify Delay Multiplier on FCP EQs
12052 * @phba: HBA structure that indicates port to create a queue on.
12053 * @startq: The starting FCP EQ to modify
12054 *
12055 * This function sends an MODIFY_EQ_DELAY mailbox command to the HBA.
12056 *
12057 * The @phba struct is used to send mailbox command to HBA. The @startq
12058 * is used to get the starting FCP EQ to change.
12059 * This function is asynchronous and will wait for the mailbox
12060 * command to finish before continuing.
12061 *
12062 * On success this function will return a zero. If unable to allocate enough
12063 * memory this function will return -ENOMEM. If the queue create mailbox command
12064 * fails this function will return -ENXIO.
12065 **/
12066uint32_t
12067lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq)
12068{
12069 struct lpfc_mbx_modify_eq_delay *eq_delay;
12070 LPFC_MBOXQ_t *mbox;
12071 struct lpfc_queue *eq;
12072 int cnt, rc, length, status = 0;
12073 uint32_t shdr_status, shdr_add_status;
12074 int fcp_eqidx;
12075 union lpfc_sli4_cfg_shdr *shdr;
12076 uint16_t dmult;
12077
12078 if (startq >= phba->cfg_fcp_eq_count)
12079 return 0;
12080
12081 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
12082 if (!mbox)
12083 return -ENOMEM;
12084 length = (sizeof(struct lpfc_mbx_modify_eq_delay) -
12085 sizeof(struct lpfc_sli4_cfg_mhdr));
12086 lpfc_sli4_config(phba, mbox, LPFC_MBOX_SUBSYSTEM_COMMON,
12087 LPFC_MBOX_OPCODE_MODIFY_EQ_DELAY,
12088 length, LPFC_SLI4_MBX_EMBED);
12089 eq_delay = &mbox->u.mqe.un.eq_delay;
12090
12091 /* Calculate delay multiper from maximum interrupt per second */
12092 dmult = LPFC_DMULT_CONST/phba->cfg_fcp_imax - 1;
12093
12094 cnt = 0;
12095 for (fcp_eqidx = startq; fcp_eqidx < phba->cfg_fcp_eq_count;
12096 fcp_eqidx++) {
12097 eq = phba->sli4_hba.fp_eq[fcp_eqidx];
12098 if (!eq)
12099 continue;
12100 eq_delay->u.request.eq[cnt].eq_id = eq->queue_id;
12101 eq_delay->u.request.eq[cnt].phase = 0;
12102 eq_delay->u.request.eq[cnt].delay_multi = dmult;
12103 cnt++;
12104 if (cnt >= LPFC_MAX_EQ_DELAY)
12105 break;
12106 }
12107 eq_delay->u.request.num_eq = cnt;
12108
12109 mbox->vport = phba->pport;
12110 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
12111 mbox->context1 = NULL;
12112 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL);
12113 shdr = (union lpfc_sli4_cfg_shdr *) &eq_delay->header.cfg_shdr;
12114 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
12115 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
12116 if (shdr_status || shdr_add_status || rc) {
12117 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12118 "2512 MODIFY_EQ_DELAY mailbox failed with "
12119 "status x%x add_status x%x, mbx status x%x\n",
12120 shdr_status, shdr_add_status, rc);
12121 status = -ENXIO;
12122 }
12123 mempool_free(mbox, phba->mbox_mem_pool);
12124 return status;
12125}
12126
12127/**
12051 * lpfc_eq_create - Create an Event Queue on the HBA 12128 * lpfc_eq_create - Create an Event Queue on the HBA
12052 * @phba: HBA structure that indicates port to create a queue on. 12129 * @phba: HBA structure that indicates port to create a queue on.
12053 * @eq: The queue structure to use to create the event queue. 12130 * @eq: The queue structure to use to create the event queue.