diff options
author | James Smart <jsmart2021@gmail.com> | 2017-02-12 22:52:36 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-02-23 00:41:43 +0100 |
commit | 8c258641e01cfcc5620c4fb191300bea224bcc99 (patch) | |
tree | 624fe23d85243c2c8c891fed355901a1c5a532cd /drivers/scsi/lpfc/lpfc_hbadisc.c | |
parent | scsi: lpfc: NVME Target: Receive buffer updates (diff) | |
download | linux-8c258641e01cfcc5620c4fb191300bea224bcc99.tar.xz linux-8c258641e01cfcc5620c4fb191300bea224bcc99.zip |
scsi: lpfc: NVME Target: Merge into FC discovery
NVME Target: Merge into FC discovery
Adds NVME PRLI handling and Nameserver registrations for NVME
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>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 8936f5d91c87..6bbb988dd8da 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -910,8 +910,11 @@ lpfc_linkdown(struct lpfc_hba *phba) vports[i]->fc_myDID = 0; if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || - (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) - lpfc_nvme_update_localport(vports[i]); + (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { + if (!phba->nvmet_support) + lpfc_nvme_update_localport(vports[i]); + /* todo: tgt: update targetport attributes */ + } } } lpfc_destroy_vport_work_array(phba, vports); @@ -3583,8 +3586,11 @@ lpfc_mbx_cmpl_reg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) vport->fc_myDID = 0; if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || - (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) - lpfc_nvme_update_localport(vport); + (phba->cfg_enable_fc4_type == LPFC_ENABLE_NVME)) { + if (!phba->nvmet_support) + lpfc_nvme_update_localport(vport); + /* todo: update targetport attributes */ + } goto out; } @@ -4175,6 +4181,11 @@ lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, */ vport->phba->nport_event_cnt++; lpfc_nvme_register_port(vport, ndlp); + } else { + /* Just take an NDLP ref count since the + * target does not register rports. + */ + lpfc_nlp_get(ndlp); } } } @@ -5096,6 +5107,8 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) return NULL; lpfc_nlp_init(vport, ndlp, did); lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); + if (vport->phba->nvmet_support) + return ndlp; spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NPR_2B_DISC; spin_unlock_irq(shost->host_lock); @@ -5104,6 +5117,8 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_NPR_NODE); if (!ndlp) return NULL; + if (vport->phba->nvmet_support) + return ndlp; spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NPR_2B_DISC; spin_unlock_irq(shost->host_lock); @@ -5123,6 +5138,8 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) * delay timeout is not needed. */ lpfc_cancel_retry_delay_tmo(vport, ndlp); + if (vport->phba->nvmet_support) + return ndlp; spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NPR_2B_DISC; spin_unlock_irq(shost->host_lock); @@ -5138,6 +5155,8 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) ndlp->nlp_flag & NLP_RCV_PLOGI) return NULL; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); + if (vport->phba->nvmet_support) + return ndlp; spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NPR_2B_DISC; spin_unlock_irq(shost->host_lock); |