提交 0709263a 编写于 作者: J James Smart 提交者: Martin K. Petersen

scsi: lpfc: Fix NVME Initiator FirstBurst

First Burst support was not properly indicated in NVMe PRLI.

Correct the bit position and the logic to check and set first burst support.
Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: NJames Smart <james.smart@broadcom.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 917d59ac
...@@ -1998,8 +1998,14 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -1998,8 +1998,14 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
ndlp->nlp_type |= NLP_NVME_TARGET; ndlp->nlp_type |= NLP_NVME_TARGET;
if (bf_get_be32(prli_disc, nvpr)) if (bf_get_be32(prli_disc, nvpr))
ndlp->nlp_type |= NLP_NVME_DISCOVERY; ndlp->nlp_type |= NLP_NVME_DISCOVERY;
/*
* If prli_fba is set, the Target supports FirstBurst.
* If prli_fb_sz is 0, the FirstBurst size is unlimited,
* otherwise it defines the actual size supported by
* the NVME Target.
*/
if ((bf_get_be32(prli_fba, nvpr) == 1) && if ((bf_get_be32(prli_fba, nvpr) == 1) &&
(bf_get_be32(prli_fb_sz, nvpr) > 0) &&
(phba->cfg_nvme_enable_fb) && (phba->cfg_nvme_enable_fb) &&
(!phba->nvmet_support)) { (!phba->nvmet_support)) {
/* Both sides support FB. The target's first /* Both sides support FB. The target's first
...@@ -2008,6 +2014,13 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -2008,6 +2014,13 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
ndlp->nlp_flag |= NLP_FIRSTBURST; ndlp->nlp_flag |= NLP_FIRSTBURST;
ndlp->nvme_fb_size = bf_get_be32(prli_fb_sz, ndlp->nvme_fb_size = bf_get_be32(prli_fb_sz,
nvpr); nvpr);
/* Expressed in units of 512 bytes */
if (ndlp->nvme_fb_size)
ndlp->nvme_fb_size <<=
LPFC_NVME_FB_SHIFT;
else
ndlp->nvme_fb_size = LPFC_NVME_MAX_FB;
} }
} }
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#define LPFC_NVME_WAIT_TMO 10 #define LPFC_NVME_WAIT_TMO 10
#define LPFC_NVME_EXPEDITE_XRICNT 8 #define LPFC_NVME_EXPEDITE_XRICNT 8
#define LPFC_NVME_FB_SHIFT 9
#define LPFC_NVME_MAX_FB (1 << 20) /* 1M */
struct lpfc_nvme_qhandle { struct lpfc_nvme_qhandle {
uint32_t index; /* WQ index to use */ uint32_t index; /* WQ index to use */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册