提交 ee02006b 编写于 作者: J James Smart 提交者: James Bottomley

[SCSI] lpfc 8.3.35: Fix interrupt delay multipler conversion for eq_create

Signed-off-by: NJames Smart <james.smart@emulex.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 33cb82dc
...@@ -12099,6 +12099,7 @@ lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq) ...@@ -12099,6 +12099,7 @@ lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq)
struct lpfc_queue *eq; struct lpfc_queue *eq;
int cnt, rc, length, status = 0; int cnt, rc, length, status = 0;
uint32_t shdr_status, shdr_add_status; uint32_t shdr_status, shdr_add_status;
uint32_t result;
int fcp_eqidx; int fcp_eqidx;
union lpfc_sli4_cfg_shdr *shdr; union lpfc_sli4_cfg_shdr *shdr;
uint16_t dmult; uint16_t dmult;
...@@ -12117,8 +12118,11 @@ lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq) ...@@ -12117,8 +12118,11 @@ lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq)
eq_delay = &mbox->u.mqe.un.eq_delay; eq_delay = &mbox->u.mqe.un.eq_delay;
/* Calculate delay multiper from maximum interrupt per second */ /* Calculate delay multiper from maximum interrupt per second */
dmult = phba->cfg_fcp_imax / phba->cfg_fcp_io_channel; result = phba->cfg_fcp_imax / phba->cfg_fcp_io_channel;
dmult = LPFC_DMULT_CONST/dmult - 1; if (result > LPFC_DMULT_CONST)
dmult = 0;
else
dmult = LPFC_DMULT_CONST/result - 1;
cnt = 0; cnt = 0;
for (fcp_eqidx = startq; fcp_eqidx < phba->cfg_fcp_io_channel; for (fcp_eqidx = startq; fcp_eqidx < phba->cfg_fcp_io_channel;
...@@ -12174,7 +12178,7 @@ lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq) ...@@ -12174,7 +12178,7 @@ lpfc_modify_fcp_eq_delay(struct lpfc_hba *phba, uint16_t startq)
* fails this function will return -ENXIO. * fails this function will return -ENXIO.
**/ **/
uint32_t uint32_t
lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint16_t imax) lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax)
{ {
struct lpfc_mbx_eq_create *eq_create; struct lpfc_mbx_eq_create *eq_create;
LPFC_MBOXQ_t *mbox; LPFC_MBOXQ_t *mbox;
...@@ -12206,7 +12210,10 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint16_t imax) ...@@ -12206,7 +12210,10 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint16_t imax)
LPFC_EQE_SIZE); LPFC_EQE_SIZE);
bf_set(lpfc_eq_context_valid, &eq_create->u.request.context, 1); bf_set(lpfc_eq_context_valid, &eq_create->u.request.context, 1);
/* Calculate delay multiper from maximum interrupt per second */ /* Calculate delay multiper from maximum interrupt per second */
dmult = LPFC_DMULT_CONST/imax - 1; if (imax > LPFC_DMULT_CONST)
dmult = 0;
else
dmult = LPFC_DMULT_CONST/imax - 1;
bf_set(lpfc_eq_context_delay_multi, &eq_create->u.request.context, bf_set(lpfc_eq_context_delay_multi, &eq_create->u.request.context,
dmult); dmult);
switch (eq->entry_count) { switch (eq->entry_count) {
......
...@@ -626,7 +626,7 @@ void lpfc_sli4_hba_reset(struct lpfc_hba *); ...@@ -626,7 +626,7 @@ void lpfc_sli4_hba_reset(struct lpfc_hba *);
struct lpfc_queue *lpfc_sli4_queue_alloc(struct lpfc_hba *, uint32_t, struct lpfc_queue *lpfc_sli4_queue_alloc(struct lpfc_hba *, uint32_t,
uint32_t); uint32_t);
void lpfc_sli4_queue_free(struct lpfc_queue *); void lpfc_sli4_queue_free(struct lpfc_queue *);
uint32_t lpfc_eq_create(struct lpfc_hba *, struct lpfc_queue *, uint16_t); uint32_t lpfc_eq_create(struct lpfc_hba *, struct lpfc_queue *, uint32_t);
uint32_t lpfc_modify_fcp_eq_delay(struct lpfc_hba *, uint16_t); uint32_t lpfc_modify_fcp_eq_delay(struct lpfc_hba *, uint16_t);
uint32_t lpfc_cq_create(struct lpfc_hba *, struct lpfc_queue *, uint32_t lpfc_cq_create(struct lpfc_hba *, struct lpfc_queue *,
struct lpfc_queue *, uint32_t, uint32_t); struct lpfc_queue *, uint32_t, uint32_t);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册