scsi: lpfc: correct port registrations with nvme_fc
The driver currently registers any remote port that has NVME support. It should only be registering target ports. Register only target ports. 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>
This commit is contained in:
parent
4938250ebd
commit
3b5bde69bc
|
@ -4176,12 +4176,14 @@ lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
|
||||||
|
|
||||||
if (ndlp->nlp_fc4_type & NLP_FC4_NVME) {
|
if (ndlp->nlp_fc4_type & NLP_FC4_NVME) {
|
||||||
vport->phba->nport_event_cnt++;
|
vport->phba->nport_event_cnt++;
|
||||||
if (vport->phba->nvmet_support == 0)
|
if (vport->phba->nvmet_support == 0) {
|
||||||
/* Start devloss */
|
/* Start devloss if target. */
|
||||||
lpfc_nvme_unregister_port(vport, ndlp);
|
if (ndlp->nlp_type & NLP_NVME_TARGET)
|
||||||
else
|
lpfc_nvme_unregister_port(vport, ndlp);
|
||||||
|
} else {
|
||||||
/* NVMET has no upcall. */
|
/* NVMET has no upcall. */
|
||||||
lpfc_nlp_put(ndlp);
|
lpfc_nlp_put(ndlp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4205,11 +4207,13 @@ lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
|
||||||
ndlp->nlp_fc4_type & NLP_FC4_NVME) {
|
ndlp->nlp_fc4_type & NLP_FC4_NVME) {
|
||||||
if (vport->phba->nvmet_support == 0) {
|
if (vport->phba->nvmet_support == 0) {
|
||||||
/* Register this rport with the transport.
|
/* Register this rport with the transport.
|
||||||
* Initiators take the NDLP ref count in
|
* Only NVME Target Rports are registered with
|
||||||
* the register.
|
* the transport.
|
||||||
*/
|
*/
|
||||||
vport->phba->nport_event_cnt++;
|
if (ndlp->nlp_type & NLP_NVME_TARGET) {
|
||||||
lpfc_nvme_register_port(vport, ndlp);
|
vport->phba->nport_event_cnt++;
|
||||||
|
lpfc_nvme_register_port(vport, ndlp);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Just take an NDLP ref count since the
|
/* Just take an NDLP ref count since the
|
||||||
* target does not register rports.
|
* target does not register rports.
|
||||||
|
|
|
@ -2473,7 +2473,8 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
|
||||||
/* Sanity check ndlp type. Only call for NVME ports. Don't
|
/* Sanity check ndlp type. Only call for NVME ports. Don't
|
||||||
* clear any rport state until the transport calls back.
|
* clear any rport state until the transport calls back.
|
||||||
*/
|
*/
|
||||||
if (ndlp->nlp_type & (NLP_NVME_TARGET | NLP_NVME_INITIATOR)) {
|
|
||||||
|
if (ndlp->nlp_type & NLP_NVME_TARGET) {
|
||||||
init_completion(&rport->rport_unreg_done);
|
init_completion(&rport->rport_unreg_done);
|
||||||
|
|
||||||
/* No concern about the role change on the nvme remoteport.
|
/* No concern about the role change on the nvme remoteport.
|
||||||
|
|
Loading…
Reference in New Issue