Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3da825b authored by James Smart's avatar James Smart Committed by Martin K. Petersen
Browse files

scsi: lpfc: Fix SCSI lun discovery when port configured for both SCSI and NVME



When a port is configured for NVME and SCSI Initiator support and it probes
a target supporting both SCSI and NVME, NVME devices are discovered, but
SCSI devices are not.

The nlp_fc4_type for all NPorts should be cleared on Link Up or just before
GID_FTs get issued, as opposed to just during GID_FT cmpl.  RSCN activity as
well as Link Up can trigger GID_FT.  One GID_FT may complete before the next
one is issued.

Fix by clearng nlp_fc4_type on link up and just before both GID_FTs are
issued.  During port swapping, copy nlp_fc4_type to the new ndlp

Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent bd3061ba
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -471,7 +471,6 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)
				"Parse GID_FTrsp: did:x%x flg:x%x x%x",
				"Parse GID_FTrsp: did:x%x flg:x%x x%x",
				Did, ndlp->nlp_flag, vport->fc_flag);
				Did, ndlp->nlp_flag, vport->fc_flag);


			ndlp->nlp_fc4_type &= ~(NLP_FC4_FCP | NLP_FC4_NVME);
			/* By default, the driver expects to support FCP FC4 */
			/* By default, the driver expects to support FCP FC4 */
			if (fc4_type == FC_TYPE_FCP)
			if (fc4_type == FC_TYPE_FCP)
				ndlp->nlp_fc4_type |= NLP_FC4_FCP;
				ndlp->nlp_fc4_type |= NLP_FC4_FCP;
+1 −0
Original line number Original line Diff line number Diff line
@@ -1661,6 +1661,7 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
		if (ndlp->nrport) {
		if (ndlp->nrport) {
			ndlp->nrport = NULL;
			ndlp->nrport = NULL;
			lpfc_nlp_put(ndlp);
			lpfc_nlp_put(ndlp);
			new_ndlp->nlp_fc4_type = ndlp->nlp_fc4_type;
		}
		}


		/* We shall actually free the ndlp with both nlp_DID and
		/* We shall actually free the ndlp with both nlp_DID and
+5 −0
Original line number Original line Diff line number Diff line
@@ -959,6 +959,7 @@ lpfc_linkup_cleanup_nodes(struct lpfc_vport *vport)
	struct lpfc_nodelist *ndlp;
	struct lpfc_nodelist *ndlp;


	list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) {
	list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) {
		ndlp->nlp_fc4_type &= ~(NLP_FC4_FCP | NLP_FC4_NVME);
		if (!NLP_CHK_NODE_ACT(ndlp))
		if (!NLP_CHK_NODE_ACT(ndlp))
			continue;
			continue;
		if (ndlp->nlp_state == NLP_STE_UNUSED_NODE)
		if (ndlp->nlp_state == NLP_STE_UNUSED_NODE)
@@ -3875,6 +3876,10 @@ int
lpfc_issue_gidft(struct lpfc_vport *vport)
lpfc_issue_gidft(struct lpfc_vport *vport)
{
{
	struct lpfc_hba *phba = vport->phba;
	struct lpfc_hba *phba = vport->phba;
	struct lpfc_nodelist *ndlp;

	list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp)
		ndlp->nlp_fc4_type &= ~(NLP_FC4_FCP | NLP_FC4_NVME);


	/* Good status, issue CT Request to NameServer */
	/* Good status, issue CT Request to NameServer */
	if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||
	if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) ||