Skip to content

Commit 6f81582

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Ensure unregistration of rpis for received PLOGIs
Unregistration of an rpi object should be done when a PLOGI is received as PLOGI receipt implies an implicit LOGO. Previously, the driver would continue using the same, already registered, rpi and ACC the received PLOGI. Replace the ACC and early return statement with break to execute the rest of the lpfc_rcv_plogi logic outside the switch case statement. This ensures unregistration and reregistration of an rpi after PLOGI_ACC completion. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20251106224639.139176-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 3c22806 commit 6f81582

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3263,7 +3263,7 @@ lpfc_reg_fab_ctrl_node(struct lpfc_vport *vport, struct lpfc_nodelist *fc_ndlp)
32633263
return -ENOMEM;
32643264
}
32653265
rc = lpfc_reg_rpi(phba, vport->vpi, fc_ndlp->nlp_DID,
3266-
(u8 *)&vport->fc_sparam, mbox, fc_ndlp->nlp_rpi);
3266+
(u8 *)&ns_ndlp->fc_sparam, mbox, fc_ndlp->nlp_rpi);
32673267
if (rc) {
32683268
rc = -EACCES;
32693269
goto out;

drivers/scsi/lpfc/lpfc_nportdisc.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -452,18 +452,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
452452
*/
453453
if (!(ndlp->nlp_type & NLP_FABRIC) &&
454454
!(phba->nvmet_support)) {
455-
/* Clear ndlp info, since follow up PRLI may have
456-
* updated ndlp information
457-
*/
458-
ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR);
459-
ndlp->nlp_type &= ~(NLP_NVME_TARGET | NLP_NVME_INITIATOR);
460-
ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE;
461-
ndlp->nlp_nvme_info &= ~NLP_NVME_NSLER;
462-
clear_bit(NLP_FIRSTBURST, &ndlp->nlp_flag);
463-
464-
lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb,
465-
ndlp, NULL);
466-
return 1;
455+
break;
467456
}
468457
if (nlp_portwwn != 0 &&
469458
nlp_portwwn != wwn_to_u64(sp->portName.u.wwn))
@@ -485,7 +474,9 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
485474
lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
486475
break;
487476
}
488-
477+
/* Clear ndlp info, since follow up processes may have
478+
* updated ndlp information
479+
*/
489480
ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR);
490481
ndlp->nlp_type &= ~(NLP_NVME_TARGET | NLP_NVME_INITIATOR);
491482
ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE;

0 commit comments

Comments
 (0)