]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Fix discovery problem when in pt2pt (CR 126887)
authorVaios Papadimitriou <vaios.papadimitriou@emulex.com>
Tue, 8 May 2012 22:01:25 +0000 (17:01 -0500)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 9 May 2012 00:01:25 +0000 (17:01 -0700)
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 <maxim.uvarov@oracle.com>
drivers/scsi/lpfc/lpfc_els.c

index 7afc757338de2de3137ed2643e5c4a1ac8701af1..6b743b03828532c60ba3034ed64f41305f7e8007 100644 (file)
@@ -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) {