Skip to content

Commit dc53a61

Browse files
jsmart-ghmartinkpetersen
authored andcommitted
scsi: lpfc: Fix NVMEI's handling of NVMET's PRLI response attributes
Code review of NVMEI's FC_PORT_ROLE_NVME_DISCOVERY looked wrong. Discussions with storage architecture team clarified NVMEI's audit of the PRLI response port roles. Following up discussion with code review showed a few minor corrections were required - especially in anticipation of NVME auto discovery. During PRLI, NVMEI should sent prli_init - which it it does. NVMET should send prli_tgt and prli_disc - which it does. When NVMEI receives a PRLI Response now, it audits the incoming target bits and stores the attributes in the corresponding NDLP. Later, when NVMEI registers the NVME rport, it uses the stored ndlp attributes to set the rport port_roles correctly. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 64eb4dc commit dc53a61

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

drivers/scsi/lpfc/lpfc_disc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct lpfc_nodelist {
9090
#define NLP_FCP_INITIATOR 0x10 /* entry is an FCP Initiator */
9191
#define NLP_NVME_TARGET 0x20 /* entry is a NVME Target */
9292
#define NLP_NVME_INITIATOR 0x40 /* entry is a NVME Initiator */
93+
#define NLP_NVME_DISCOVERY 0x80 /* entry has NVME disc srvc */
9394

9495
uint16_t nlp_fc4_type; /* FC types node supports. */
9596
/* Assigned from GID_FF, only

drivers/scsi/lpfc/lpfc_nportdisc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,13 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
19441944

19451945
/* Target driver cannot solicit NVME FB. */
19461946
if (bf_get_be32(prli_tgt, nvpr)) {
1947+
/* Complete the nvme target roles. The transport
1948+
* needs to know if the rport is capable of
1949+
* discovery in addition to its role.
1950+
*/
19471951
ndlp->nlp_type |= NLP_NVME_TARGET;
1952+
if (bf_get_be32(prli_disc, nvpr))
1953+
ndlp->nlp_type |= NLP_NVME_DISCOVERY;
19481954
if ((bf_get_be32(prli_fba, nvpr) == 1) &&
19491955
(bf_get_be32(prli_fb_sz, nvpr) > 0) &&
19501956
(phba->cfg_nvme_enable_fb) &&

0 commit comments

Comments
 (0)