From: Vaios Papadimitriou Date: Tue, 8 May 2012 22:01:25 +0000 (-0500) Subject: Fix discovery problem when in pt2pt (CR 126887) X-Git-Tag: v2.6.39-400.9.0~423^2~123^2~19 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ead4e74485349376cc3c9727a429e99901390836;p=users%2Fjedix%2Flinux-maple.git Fix discovery problem when in pt2pt (CR 126887) When a target is direct connected in pt2pt topology it is not discovered by the driver. The confirm nport routine is called during plogi completion. It will look up the ndlp using the service parameter wwpn in the target response. If the ndlp that is returned in the lookup does not match the ndlp that the plogi was sent with confirm_nport updates the new ndlp with old ndlp's information. Confirm nport has to make sure that only one ndlp with that wwpn is active before returning so it sets the old ndlp's state to NPR. It set the state before it copied the state to the new ndlp so both ndlp's end up in NPR. When the plogi completion routine calls the state machine with the plogi complete event and the ndlp in NPR the ndlp'd state stays in NPR. The state machine is stopped for this ndlp. Because it was the only target discovery is completed. The old ndlp state is now copied to the new ndlp before setting the old one to NPR commit id: eff4a01b6e9f8cee3c541ab7f2ad18b5bbffd124 Signed-off-by: Maxim Uvarov --- diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 7afc757338de..6b743b038285 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -1526,7 +1526,6 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, memcpy(&ndlp->active_rrqs.xri_bitmap, &rrq.xri_bitmap, sizeof(ndlp->active_rrqs.xri_bitmap)); - lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); /* Since we are swapping the ndlp passed in with the new one * and the did has already been swapped, copy over the * state and names. @@ -1536,6 +1535,7 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, memcpy(&new_ndlp->nlp_nodename, &ndlp->nlp_nodename, sizeof(struct lpfc_name)); new_ndlp->nlp_state = ndlp->nlp_state; + lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); /* Fix up the rport accordingly */ rport = ndlp->rport; if (rport) {