summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDick Kennedy <dick.kennedy@broadcom.com>2017-08-23 16:55:39 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2017-08-24 22:29:39 -0400
commit991f0c0e33e2a57120970d28c08384c77505bfca (patch)
tree8bb2ecaf481c2366af03c8248c149f35f0358bd9
parent4b40d02b8b2bd549c7751a3c4629077ea5f9a1fd (diff)
scsi: lpfc: Fix NVME PRLI handling during RSCN
A race condition was found whereby the initiator would receive the RSCN for a new NVME device before it had a chance to register its FC4 support with the fabric. Thus, when queried by the initiator, it would see that the target supported FC-NVME. Corrected by making the assumption that the target always supports FC-NVME thus a PRLI is sent. It's ok for the target to reject it. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index ffbd3eddeabb..6de470e158ef 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -2177,6 +2177,16 @@ lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
uint16_t cmdsize;
u32 local_nlp_type, elscmd;
+ /*
+ * If we are in RSCN mode, the FC4 types supported from a
+ * previous GFT_ID command may not be accurate. So, if we
+ * are a NVME Initiator, always look for the possibility of
+ * the remote NPort beng a NVME Target.
+ */
+ if (phba->sli_rev == LPFC_SLI_REV4 &&
+ vport->fc_flag & FC_RSCN_MODE &&
+ vport->nvmei_support)
+ ndlp->nlp_fc4_type |= NLP_FC4_NVME;
local_nlp_type = ndlp->nlp_fc4_type;
send_next_prli: