diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
| -rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 74 |
1 files changed, 59 insertions, 15 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 5452f1f4220e..2500f15d437f 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************* | 1 | /******************************************************************* |
| 2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | * Copyright (C) 2004-2014 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2015 Emulex. All rights reserved. * |
| 5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | * www.emulex.com * | 6 | * www.emulex.com * |
| 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
| @@ -3439,6 +3439,11 @@ lpfc_mbx_cmpl_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
| 3439 | pmb->context1 = NULL; | 3439 | pmb->context1 = NULL; |
| 3440 | pmb->context2 = NULL; | 3440 | pmb->context2 = NULL; |
| 3441 | 3441 | ||
| 3442 | lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, | ||
| 3443 | "0002 rpi:%x DID:%x flg:%x %d map:%x %p\n", | ||
| 3444 | ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, | ||
| 3445 | atomic_read(&ndlp->kref.refcount), | ||
| 3446 | ndlp->nlp_usg_map, ndlp); | ||
| 3442 | if (ndlp->nlp_flag & NLP_REG_LOGIN_SEND) | 3447 | if (ndlp->nlp_flag & NLP_REG_LOGIN_SEND) |
| 3443 | ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; | 3448 | ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; |
| 3444 | 3449 | ||
| @@ -3855,6 +3860,11 @@ out: | |||
| 3855 | ndlp->nlp_flag |= NLP_RPI_REGISTERED; | 3860 | ndlp->nlp_flag |= NLP_RPI_REGISTERED; |
| 3856 | ndlp->nlp_type |= NLP_FABRIC; | 3861 | ndlp->nlp_type |= NLP_FABRIC; |
| 3857 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); | 3862 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); |
| 3863 | lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, | ||
| 3864 | "0003 rpi:%x DID:%x flg:%x %d map%x %p\n", | ||
| 3865 | ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, | ||
| 3866 | atomic_read(&ndlp->kref.refcount), | ||
| 3867 | ndlp->nlp_usg_map, ndlp); | ||
| 3858 | 3868 | ||
| 3859 | if (vport->port_state < LPFC_VPORT_READY) { | 3869 | if (vport->port_state < LPFC_VPORT_READY) { |
| 3860 | /* Link up discovery requires Fabric registration. */ | 3870 | /* Link up discovery requires Fabric registration. */ |
| @@ -4250,8 +4260,15 @@ lpfc_enable_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
| 4250 | ndlp->active_rrqs_xri_bitmap = active_rrqs_xri_bitmap; | 4260 | ndlp->active_rrqs_xri_bitmap = active_rrqs_xri_bitmap; |
| 4251 | 4261 | ||
| 4252 | spin_unlock_irqrestore(&phba->ndlp_lock, flags); | 4262 | spin_unlock_irqrestore(&phba->ndlp_lock, flags); |
| 4253 | if (vport->phba->sli_rev == LPFC_SLI_REV4) | 4263 | if (vport->phba->sli_rev == LPFC_SLI_REV4) { |
| 4254 | ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); | 4264 | ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); |
| 4265 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, | ||
| 4266 | "0008 rpi:%x DID:%x flg:%x refcnt:%d " | ||
| 4267 | "map:%x %p\n", ndlp->nlp_rpi, ndlp->nlp_DID, | ||
| 4268 | ndlp->nlp_flag, | ||
| 4269 | atomic_read(&ndlp->kref.refcount), | ||
| 4270 | ndlp->nlp_usg_map, ndlp); | ||
| 4271 | } | ||
| 4255 | 4272 | ||
| 4256 | 4273 | ||
| 4257 | if (state != NLP_STE_UNUSED_NODE) | 4274 | if (state != NLP_STE_UNUSED_NODE) |
| @@ -4276,9 +4293,12 @@ lpfc_drop_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) | |||
| 4276 | if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) | 4293 | if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) |
| 4277 | return; | 4294 | return; |
| 4278 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE); | 4295 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE); |
| 4279 | if (vport->phba->sli_rev == LPFC_SLI_REV4) | 4296 | if (vport->phba->sli_rev == LPFC_SLI_REV4) { |
| 4280 | lpfc_cleanup_vports_rrqs(vport, ndlp); | 4297 | lpfc_cleanup_vports_rrqs(vport, ndlp); |
| 4281 | lpfc_nlp_put(ndlp); | 4298 | lpfc_unreg_rpi(vport, ndlp); |
| 4299 | } else { | ||
| 4300 | lpfc_nlp_put(ndlp); | ||
| 4301 | } | ||
| 4282 | return; | 4302 | return; |
| 4283 | } | 4303 | } |
| 4284 | 4304 | ||
| @@ -4515,7 +4535,17 @@ lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) | |||
| 4515 | mbox->context1 = ndlp; | 4535 | mbox->context1 = ndlp; |
| 4516 | mbox->mbox_cmpl = lpfc_nlp_logo_unreg; | 4536 | mbox->mbox_cmpl = lpfc_nlp_logo_unreg; |
| 4517 | } else { | 4537 | } else { |
| 4518 | mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; | 4538 | if (phba->sli_rev == LPFC_SLI_REV4 && |
| 4539 | (!(vport->load_flag & FC_UNLOADING)) && | ||
| 4540 | (bf_get(lpfc_sli_intf_if_type, | ||
| 4541 | &phba->sli4_hba.sli_intf) == | ||
| 4542 | LPFC_SLI_INTF_IF_TYPE_2)) { | ||
| 4543 | mbox->context1 = lpfc_nlp_get(ndlp); | ||
| 4544 | mbox->mbox_cmpl = | ||
| 4545 | lpfc_sli4_unreg_rpi_cmpl_clr; | ||
| 4546 | } else | ||
| 4547 | mbox->mbox_cmpl = | ||
| 4548 | lpfc_sli_def_mbox_cmpl; | ||
| 4519 | } | 4549 | } |
| 4520 | 4550 | ||
| 4521 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); | 4551 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); |
| @@ -4741,6 +4771,11 @@ lpfc_nlp_remove(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) | |||
| 4741 | /* For this case we need to cleanup the default rpi | 4771 | /* For this case we need to cleanup the default rpi |
| 4742 | * allocated by the firmware. | 4772 | * allocated by the firmware. |
| 4743 | */ | 4773 | */ |
| 4774 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, | ||
| 4775 | "0005 rpi:%x DID:%x flg:%x %d map:%x %p\n", | ||
| 4776 | ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, | ||
| 4777 | atomic_read(&ndlp->kref.refcount), | ||
| 4778 | ndlp->nlp_usg_map, ndlp); | ||
| 4744 | if ((mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL)) | 4779 | if ((mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL)) |
| 4745 | != NULL) { | 4780 | != NULL) { |
| 4746 | rc = lpfc_reg_rpi(phba, vport->vpi, ndlp->nlp_DID, | 4781 | rc = lpfc_reg_rpi(phba, vport->vpi, ndlp->nlp_DID, |
| @@ -5070,8 +5105,7 @@ lpfc_disc_start(struct lpfc_vport *vport) | |||
| 5070 | !(vport->fc_flag & FC_PT2PT) && | 5105 | !(vport->fc_flag & FC_PT2PT) && |
| 5071 | !(vport->fc_flag & FC_RSCN_MODE) && | 5106 | !(vport->fc_flag & FC_RSCN_MODE) && |
| 5072 | (phba->sli_rev < LPFC_SLI_REV4)) { | 5107 | (phba->sli_rev < LPFC_SLI_REV4)) { |
| 5073 | if (vport->port_type == LPFC_PHYSICAL_PORT) | 5108 | lpfc_issue_clear_la(phba, vport); |
| 5074 | lpfc_issue_clear_la(phba, vport); | ||
| 5075 | lpfc_issue_reg_vpi(phba, vport); | 5109 | lpfc_issue_reg_vpi(phba, vport); |
| 5076 | return; | 5110 | return; |
| 5077 | } | 5111 | } |
| @@ -5082,8 +5116,7 @@ lpfc_disc_start(struct lpfc_vport *vport) | |||
| 5082 | */ | 5116 | */ |
| 5083 | if (vport->port_state < LPFC_VPORT_READY && !clear_la_pending) { | 5117 | if (vport->port_state < LPFC_VPORT_READY && !clear_la_pending) { |
| 5084 | /* If we get here, there is nothing to ADISC */ | 5118 | /* If we get here, there is nothing to ADISC */ |
| 5085 | if (vport->port_type == LPFC_PHYSICAL_PORT) | 5119 | lpfc_issue_clear_la(phba, vport); |
| 5086 | lpfc_issue_clear_la(phba, vport); | ||
| 5087 | 5120 | ||
| 5088 | if (!(vport->fc_flag & FC_ABORT_DISCOVERY)) { | 5121 | if (!(vport->fc_flag & FC_ABORT_DISCOVERY)) { |
| 5089 | vport->num_disc_nodes = 0; | 5122 | vport->num_disc_nodes = 0; |
| @@ -5484,18 +5517,22 @@ lpfc_mbx_cmpl_fdmi_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
| 5484 | ndlp->nlp_flag |= NLP_RPI_REGISTERED; | 5517 | ndlp->nlp_flag |= NLP_RPI_REGISTERED; |
| 5485 | ndlp->nlp_type |= NLP_FABRIC; | 5518 | ndlp->nlp_type |= NLP_FABRIC; |
| 5486 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); | 5519 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); |
| 5487 | 5520 | lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, | |
| 5521 | "0004 rpi:%x DID:%x flg:%x %d map:%x %p\n", | ||
| 5522 | ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, | ||
| 5523 | atomic_read(&ndlp->kref.refcount), | ||
| 5524 | ndlp->nlp_usg_map, ndlp); | ||
| 5488 | /* | 5525 | /* |
| 5489 | * Start issuing Fabric-Device Management Interface (FDMI) command to | 5526 | * Start issuing Fabric-Device Management Interface (FDMI) command to |
| 5490 | * 0xfffffa (FDMI well known port) or Delay issuing FDMI command if | 5527 | * 0xfffffa (FDMI well known port) or Delay issuing FDMI command if |
| 5491 | * fdmi-on=2 (supporting RPA/hostnmae) | 5528 | * fdmi-on=2 (supporting RPA/hostnmae) |
| 5492 | */ | 5529 | */ |
| 5493 | 5530 | ||
| 5494 | if (vport->cfg_fdmi_on == 1) | 5531 | if (vport->cfg_fdmi_on & LPFC_FDMI_REG_DELAY) |
| 5495 | lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DHBA); | ||
| 5496 | else | ||
| 5497 | mod_timer(&vport->fc_fdmitmo, | 5532 | mod_timer(&vport->fc_fdmitmo, |
| 5498 | jiffies + msecs_to_jiffies(1000 * 60)); | 5533 | jiffies + msecs_to_jiffies(1000 * 60)); |
| 5534 | else | ||
| 5535 | lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DHBA); | ||
| 5499 | 5536 | ||
| 5500 | /* decrement the node reference count held for this callback | 5537 | /* decrement the node reference count held for this callback |
| 5501 | * function. | 5538 | * function. |
| @@ -5650,6 +5687,13 @@ lpfc_nlp_init(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
| 5650 | INIT_LIST_HEAD(&ndlp->nlp_listp); | 5687 | INIT_LIST_HEAD(&ndlp->nlp_listp); |
| 5651 | if (vport->phba->sli_rev == LPFC_SLI_REV4) { | 5688 | if (vport->phba->sli_rev == LPFC_SLI_REV4) { |
| 5652 | ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); | 5689 | ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); |
| 5690 | lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, | ||
| 5691 | "0007 rpi:%x DID:%x flg:%x refcnt:%d " | ||
| 5692 | "map:%x %p\n", ndlp->nlp_rpi, ndlp->nlp_DID, | ||
| 5693 | ndlp->nlp_flag, | ||
| 5694 | atomic_read(&ndlp->kref.refcount), | ||
| 5695 | ndlp->nlp_usg_map, ndlp); | ||
| 5696 | |||
| 5653 | ndlp->active_rrqs_xri_bitmap = | 5697 | ndlp->active_rrqs_xri_bitmap = |
| 5654 | mempool_alloc(vport->phba->active_rrq_pool, | 5698 | mempool_alloc(vport->phba->active_rrq_pool, |
| 5655 | GFP_KERNEL); | 5699 | GFP_KERNEL); |
| @@ -5684,9 +5728,9 @@ lpfc_nlp_release(struct kref *kref) | |||
| 5684 | 5728 | ||
| 5685 | lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, | 5729 | lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, |
| 5686 | "0279 lpfc_nlp_release: ndlp:x%p did %x " | 5730 | "0279 lpfc_nlp_release: ndlp:x%p did %x " |
| 5687 | "usgmap:x%x refcnt:%d\n", | 5731 | "usgmap:x%x refcnt:%d rpi:%x\n", |
| 5688 | (void *)ndlp, ndlp->nlp_DID, ndlp->nlp_usg_map, | 5732 | (void *)ndlp, ndlp->nlp_DID, ndlp->nlp_usg_map, |
| 5689 | atomic_read(&ndlp->kref.refcount)); | 5733 | atomic_read(&ndlp->kref.refcount), ndlp->nlp_rpi); |
| 5690 | 5734 | ||
| 5691 | /* remove ndlp from action. */ | 5735 | /* remove ndlp from action. */ |
| 5692 | lpfc_nlp_remove(ndlp->vport, ndlp); | 5736 | lpfc_nlp_remove(ndlp->vport, ndlp); |
