scsi: lpfc: Fix PRLI handling when topology type changes
authorJames Smart <[email protected]>
Tue, 30 Jan 2018 23:58:50 +0000 (15:58 -0800)
committerMartin K. Petersen <[email protected]>
Mon, 12 Feb 2018 16:43:23 +0000 (11:43 -0500)
The lpfc driver does not discover a target when the topology changes
from switched-fabric to direct-connect. The target rejects the PRLI from
the initiator in direct-connect as the driver is using the old S_ID from
the switched topology.

The driver was inappropriately clearing the VP bit to register the VPI,
which is what is associated with the S_ID.

Fix by leaving the VP bit set (it was set earlier) and as the VFI is
being re-registered, set the UPDT bit.

Signed-off-by: Dick Kennedy <[email protected]>
Signed-off-by: James Smart <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
drivers/scsi/lpfc/lpfc_mbox.c

index 81fb92967b113dccb2d11d47caf1229e85bdacb7..c32d4a323db26017b147afa373dd6465fa1f8eae 100644 (file)
@@ -2170,10 +2170,8 @@ lpfc_reg_vfi(struct lpfcMboxq *mbox, struct lpfc_vport *vport, dma_addr_t phys)
        /* Only FC supports upd bit */
        if ((phba->sli4_hba.lnk_info.lnk_tp == LPFC_LNK_TYPE_FC) &&
            (vport->fc_flag & FC_VFI_REGISTERED) &&
-           (!phba->fc_topology_changed)) {
-               bf_set(lpfc_reg_vfi_vp, reg_vfi, 0);
+           (!phba->fc_topology_changed))
                bf_set(lpfc_reg_vfi_upd, reg_vfi, 1);
-       }
 
        bf_set(lpfc_reg_vfi_bbcr, reg_vfi, 0);
        bf_set(lpfc_reg_vfi_bbscn, reg_vfi, 0);