aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_els.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2010-11-20 23:11:48 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-12-21 13:23:59 -0500
commit76a95d75ede64e4f1684ddb8c626fdfdb641bda2 (patch)
tree53420aed0a91873a382b886bf3b3ca828df48edc /drivers/scsi/lpfc/lpfc_els.c
parent085c647c3377c3e39c8c572278507b1e1c7e7bf7 (diff)
[SCSI] lpfc 8.3.19: Add SLI4 FC Discovery support
Add SLI4 FC Discovery support - Replace READ_LA and READ_LA64 with READ_TOPOLOGY mailbox command. - Converted the old READ_LA structure to use bf_set/get instead of bit fields. - Rename HBA_FCOE_SUPPORT flag to HBA_FCOE_MODE. Flag now indicates function is running as SLI-4 FC or FCoE port. Make sure flag reset each time READ_REV completed as it can dynamically change. - Removed BDE union in the READ_TOPOLOGY mailbox command and added a define to define the ALPA MAP SIZE. Added FC Code for async events. - Added code to support new 16G link speed. - Define new set of values to keep track of valid user settable link speeds. - Used new link speed definitions to define link speed max and bitmap. - Redefined FDMI Port sppeds to be hax values and added the 16G value. - Added new CQE trailer code for FC Events. - Add lpfc_issue_init_vfi and lpfc_init_vfi_cmpl routines. - Replace many calls to the initial_flogi routine with lpfc_issue_init_vfi. - Add vp and vpi fields to the INIT_VFI mailbox command. - Addapt lpfc_hba_init_link routine for SLI4 use. - Use lpfc_hba_init_link call from lpfc_sli4_hba_setup. - Add a check for FC mode to register the FCFI before init link. - Convert lpfc_sli4_init_vpi to be called without a vpi (get it from vport). Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c45
1 files changed, 27 insertions, 18 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 196a7bf905a1..04072ce9c905 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -523,7 +523,7 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
523 phba->fc_edtovResol = sp->cmn.edtovResolution; 523 phba->fc_edtovResol = sp->cmn.edtovResolution;
524 phba->fc_ratov = (be32_to_cpu(sp->cmn.w2.r_a_tov) + 999) / 1000; 524 phba->fc_ratov = (be32_to_cpu(sp->cmn.w2.r_a_tov) + 999) / 1000;
525 525
526 if (phba->fc_topology == TOPOLOGY_LOOP) { 526 if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) {
527 spin_lock_irq(shost->host_lock); 527 spin_lock_irq(shost->host_lock);
528 vport->fc_flag |= FC_PUBLIC_LOOP; 528 vport->fc_flag |= FC_PUBLIC_LOOP;
529 spin_unlock_irq(shost->host_lock); 529 spin_unlock_irq(shost->host_lock);
@@ -832,6 +832,12 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
832 if (lpfc_els_retry(phba, cmdiocb, rspiocb)) 832 if (lpfc_els_retry(phba, cmdiocb, rspiocb))
833 goto out; 833 goto out;
834 834
835 /* FLOGI failure */
836 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
837 "0100 FLOGI failure Status:x%x/x%x TMO:x%x\n",
838 irsp->ulpStatus, irsp->un.ulpWord[4],
839 irsp->ulpTimeout);
840
835 /* FLOGI failed, so there is no fabric */ 841 /* FLOGI failed, so there is no fabric */
836 spin_lock_irq(shost->host_lock); 842 spin_lock_irq(shost->host_lock);
837 vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP); 843 vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP);
@@ -843,13 +849,16 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
843 */ 849 */
844 if (phba->alpa_map[0] == 0) { 850 if (phba->alpa_map[0] == 0) {
845 vport->cfg_discovery_threads = LPFC_MAX_DISC_THREADS; 851 vport->cfg_discovery_threads = LPFC_MAX_DISC_THREADS;
852 if ((phba->sli_rev == LPFC_SLI_REV4) &&
853 (!(vport->fc_flag & FC_VFI_REGISTERED) ||
854 (vport->fc_prevDID != vport->fc_myDID))) {
855 if (vport->fc_flag & FC_VFI_REGISTERED)
856 lpfc_sli4_unreg_all_rpis(vport);
857 lpfc_issue_reg_vfi(vport);
858 lpfc_nlp_put(ndlp);
859 goto out;
860 }
846 } 861 }
847
848 /* FLOGI failure */
849 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
850 "0100 FLOGI failure Status:x%x/x%x TMO:x%x\n",
851 irsp->ulpStatus, irsp->un.ulpWord[4],
852 irsp->ulpTimeout);
853 goto flogifail; 862 goto flogifail;
854 } 863 }
855 spin_lock_irq(shost->host_lock); 864 spin_lock_irq(shost->host_lock);
@@ -879,7 +888,7 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
879 */ 888 */
880 if (sp->cmn.fPort) 889 if (sp->cmn.fPort)
881 rc = lpfc_cmpl_els_flogi_fabric(vport, ndlp, sp, irsp); 890 rc = lpfc_cmpl_els_flogi_fabric(vport, ndlp, sp, irsp);
882 else if (!(phba->hba_flag & HBA_FCOE_SUPPORT)) 891 else if (!(phba->hba_flag & HBA_FCOE_MODE))
883 rc = lpfc_cmpl_els_flogi_nport(vport, ndlp, sp); 892 rc = lpfc_cmpl_els_flogi_nport(vport, ndlp, sp);
884 else { 893 else {
885 lpfc_printf_vlog(vport, KERN_ERR, 894 lpfc_printf_vlog(vport, KERN_ERR,
@@ -1027,7 +1036,7 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1027 icmd->ulpCt_l = 0; 1036 icmd->ulpCt_l = 0;
1028 } 1037 }
1029 1038
1030 if (phba->fc_topology != TOPOLOGY_LOOP) { 1039 if (phba->fc_topology != LPFC_TOPOLOGY_LOOP) {
1031 icmd->un.elsreq64.myID = 0; 1040 icmd->un.elsreq64.myID = 0;
1032 icmd->un.elsreq64.fl = 1; 1041 icmd->un.elsreq64.fl = 1;
1033 } 1042 }
@@ -2722,7 +2731,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
2722 if (cmd == ELS_CMD_FLOGI) { 2731 if (cmd == ELS_CMD_FLOGI) {
2723 if (PCI_DEVICE_ID_HORNET == 2732 if (PCI_DEVICE_ID_HORNET ==
2724 phba->pcidev->device) { 2733 phba->pcidev->device) {
2725 phba->fc_topology = TOPOLOGY_LOOP; 2734 phba->fc_topology = LPFC_TOPOLOGY_LOOP;
2726 phba->pport->fc_myDID = 0; 2735 phba->pport->fc_myDID = 0;
2727 phba->alpa_map[0] = 0; 2736 phba->alpa_map[0] = 0;
2728 phba->alpa_map[1] = 0; 2737 phba->alpa_map[1] = 0;
@@ -2877,7 +2886,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
2877 retry = 1; 2886 retry = 1;
2878 2887
2879 if (((cmd == ELS_CMD_FLOGI) || (cmd == ELS_CMD_FDISC)) && 2888 if (((cmd == ELS_CMD_FLOGI) || (cmd == ELS_CMD_FDISC)) &&
2880 (phba->fc_topology != TOPOLOGY_LOOP) && 2889 (phba->fc_topology != LPFC_TOPOLOGY_LOOP) &&
2881 !lpfc_error_lost_link(irsp)) { 2890 !lpfc_error_lost_link(irsp)) {
2882 /* FLOGI retry policy */ 2891 /* FLOGI retry policy */
2883 retry = 1; 2892 retry = 1;
@@ -4597,7 +4606,7 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
4597 4606
4598 lpfc_set_disctmo(vport); 4607 lpfc_set_disctmo(vport);
4599 4608
4600 if (phba->fc_topology == TOPOLOGY_LOOP) { 4609 if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) {
4601 /* We should never receive a FLOGI in loop mode, ignore it */ 4610 /* We should never receive a FLOGI in loop mode, ignore it */
4602 did = icmd->un.elsreq64.remoteID; 4611 did = icmd->un.elsreq64.remoteID;
4603 4612
@@ -4940,7 +4949,7 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
4940 pcmd += sizeof(uint32_t); /* Skip past command */ 4949 pcmd += sizeof(uint32_t); /* Skip past command */
4941 rps_rsp = (RPS_RSP *)pcmd; 4950 rps_rsp = (RPS_RSP *)pcmd;
4942 4951
4943 if (phba->fc_topology != TOPOLOGY_LOOP) 4952 if (phba->fc_topology != LPFC_TOPOLOGY_LOOP)
4944 status = 0x10; 4953 status = 0x10;
4945 else 4954 else
4946 status = 0x8; 4955 status = 0x8;
@@ -5482,7 +5491,7 @@ lpfc_els_rcv_fan(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
5482 (memcmp(&phba->fc_fabparam.portName, &fp->FportName, 5491 (memcmp(&phba->fc_fabparam.portName, &fp->FportName,
5483 sizeof(struct lpfc_name)))) { 5492 sizeof(struct lpfc_name)))) {
5484 /* This port has switched fabrics. FLOGI is required */ 5493 /* This port has switched fabrics. FLOGI is required */
5485 lpfc_initial_flogi(vport); 5494 lpfc_issue_init_vfi(vport);
5486 } else { 5495 } else {
5487 /* FAN verified - skip FLOGI */ 5496 /* FAN verified - skip FLOGI */
5488 vport->fc_myDID = vport->fc_prevDID; 5497 vport->fc_myDID = vport->fc_prevDID;
@@ -6373,7 +6382,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport)
6373 if (!ndlp) { 6382 if (!ndlp) {
6374 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL); 6383 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL);
6375 if (!ndlp) { 6384 if (!ndlp) {
6376 if (phba->fc_topology == TOPOLOGY_LOOP) { 6385 if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) {
6377 lpfc_disc_start(vport); 6386 lpfc_disc_start(vport);
6378 return; 6387 return;
6379 } 6388 }
@@ -6386,7 +6395,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport)
6386 } else if (!NLP_CHK_NODE_ACT(ndlp)) { 6395 } else if (!NLP_CHK_NODE_ACT(ndlp)) {
6387 ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_UNUSED_NODE); 6396 ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_UNUSED_NODE);
6388 if (!ndlp) { 6397 if (!ndlp) {
6389 if (phba->fc_topology == TOPOLOGY_LOOP) { 6398 if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) {
6390 lpfc_disc_start(vport); 6399 lpfc_disc_start(vport);
6391 return; 6400 return;
6392 } 6401 }
@@ -6510,7 +6519,7 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
6510 spin_unlock_irq(shost->host_lock); 6519 spin_unlock_irq(shost->host_lock);
6511 if (vport->port_type == LPFC_PHYSICAL_PORT 6520 if (vport->port_type == LPFC_PHYSICAL_PORT
6512 && !(vport->fc_flag & FC_LOGO_RCVD_DID_CHNG)) 6521 && !(vport->fc_flag & FC_LOGO_RCVD_DID_CHNG))
6513 lpfc_initial_flogi(vport); 6522 lpfc_issue_init_vfi(vport);
6514 else 6523 else
6515 lpfc_initial_fdisc(vport); 6524 lpfc_initial_fdisc(vport);
6516 break; 6525 break;
@@ -6747,7 +6756,7 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
6747 vport->fc_flag &= ~FC_VPORT_CVL_RCVD; 6756 vport->fc_flag &= ~FC_VPORT_CVL_RCVD;
6748 vport->fc_flag &= ~FC_VPORT_LOGO_RCVD; 6757 vport->fc_flag &= ~FC_VPORT_LOGO_RCVD;
6749 vport->fc_flag |= FC_FABRIC; 6758 vport->fc_flag |= FC_FABRIC;
6750 if (vport->phba->fc_topology == TOPOLOGY_LOOP) 6759 if (vport->phba->fc_topology == LPFC_TOPOLOGY_LOOP)
6751 vport->fc_flag |= FC_PUBLIC_LOOP; 6760 vport->fc_flag |= FC_PUBLIC_LOOP;
6752 spin_unlock_irq(shost->host_lock); 6761 spin_unlock_irq(shost->host_lock);
6753 6762