[SCSI] lpfc 8.3.38: Fixed degraded performance after cable pulls
authorJames Smart <james.smart@emulex.com>
Fri, 1 Mar 2013 21:35:38 +0000 (16:35 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 9 Apr 2013 22:07:39 +0000 (15:07 -0700)
The service parameters for the VPI/RPIs were incorrect, resulting in
lower utilization

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/lpfc/lpfc_crtn.h
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_hw4.h
drivers/scsi/lpfc/lpfc_mbox.c

index 76ca65dae781e734afa828e580ec357618abd13d..7631893ae00511c49033f3445e45f8b164d47d46 100644 (file)
@@ -106,6 +106,7 @@ void lpfc_cleanup_discovery_resources(struct lpfc_vport *);
 void lpfc_cleanup(struct lpfc_vport *);
 void lpfc_disc_timeout(unsigned long);
 
+int lpfc_unregister_fcf_prep(struct lpfc_hba *);
 struct lpfc_nodelist *__lpfc_findnode_rpi(struct lpfc_vport *, uint16_t);
 struct lpfc_nodelist *lpfc_findnode_rpi(struct lpfc_vport *, uint16_t);
 void lpfc_worker_wake_up(struct lpfc_hba *);
index b7a61ff43ca8b8d3ed5e2739f4ad21a7690969a1..bbed8471bf0b81fce50390bb9b0ec6b7a68ba146 100644 (file)
@@ -484,6 +484,7 @@ lpfc_issue_reg_vfi(struct lpfc_vport *vport)
        vport->port_state = LPFC_FABRIC_CFG_LINK;
        memcpy(dmabuf->virt, &phba->fc_fabparam, sizeof(vport->fc_sparam));
        lpfc_reg_vfi(mboxq, vport, dmabuf->phys);
+
        mboxq->mbox_cmpl = lpfc_mbx_cmpl_reg_vfi;
        mboxq->vport = vport;
        mboxq->context1 = dmabuf;
@@ -700,6 +701,20 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
                }
        }
 
+       /*
+        * For FC we need to do some special processing because of the SLI
+        * Port's default settings of the Common Service Parameters.
+        */
+       if (phba->sli4_hba.lnk_info.lnk_tp == LPFC_LNK_TYPE_FC) {
+               /* If physical FC port changed, unreg VFI and ALL VPIs / RPIs */
+               if ((phba->sli_rev == LPFC_SLI_REV4) && fabric_param_changed)
+                       lpfc_unregister_fcf_prep(phba);
+
+               /* This should just update the VFI CSPs*/
+               if (vport->fc_flag & FC_VFI_REGISTERED)
+                       lpfc_issue_reg_vfi(vport);
+       }
+
        if (fabric_param_changed &&
                !(vport->fc_flag & FC_VPORT_NEEDS_REG_VPI)) {
 
index 915e1aa6c681d20a353529d3512c4ba7a0471370..6e74a75fa8fd06a36e2bd5a79f90c3e63577cc24 100644 (file)
@@ -2889,6 +2889,11 @@ lpfc_mbx_cmpl_reg_vfi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
                lpfc_vport_set_state(vport, FC_VPORT_FAILED);
                goto out_free_mem;
        }
+
+       /* If the VFI is already registered, there is nothing else to do */
+       if (vport->fc_flag & FC_VFI_REGISTERED)
+               goto out_free_mem;
+
        /* The VPI is implicitly registered when the VFI is registered */
        spin_lock_irq(shost->host_lock);
        vport->vpi_state |= LPFC_VPI_REGISTERED;
index 6e93b886cd4d3f15c327f155d904d0dd162cf8da..1dd2f6f0a1272f4717e6063449879b55b06ce4b0 100644 (file)
@@ -1958,6 +1958,9 @@ struct lpfc_mbx_init_vfi {
 
 struct lpfc_mbx_reg_vfi {
        uint32_t word1;
+#define lpfc_reg_vfi_upd_SHIFT         29
+#define lpfc_reg_vfi_upd_MASK          0x00000001
+#define lpfc_reg_vfi_upd_WORD          word1
 #define lpfc_reg_vfi_vp_SHIFT          28
 #define lpfc_reg_vfi_vp_MASK           0x00000001
 #define lpfc_reg_vfi_vp_WORD           word1
index efc9cd9def8b09d1c413fd97f6319ffb5929cb97..a7a9fa468308bda8ddaa97d196fa23ce75133824 100644 (file)
@@ -2126,32 +2126,40 @@ void
 lpfc_reg_vfi(struct lpfcMboxq *mbox, struct lpfc_vport *vport, dma_addr_t phys)
 {
        struct lpfc_mbx_reg_vfi *reg_vfi;
+       struct lpfc_hba *phba = vport->phba;
 
        memset(mbox, 0, sizeof(*mbox));
        reg_vfi = &mbox->u.mqe.un.reg_vfi;
        bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_REG_VFI);
        bf_set(lpfc_reg_vfi_vp, reg_vfi, 1);
        bf_set(lpfc_reg_vfi_vfi, reg_vfi,
-              vport->phba->sli4_hba.vfi_ids[vport->vfi]);
-       bf_set(lpfc_reg_vfi_fcfi, reg_vfi, vport->phba->fcf.fcfi);
-       bf_set(lpfc_reg_vfi_vpi, reg_vfi, vport->phba->vpi_ids[vport->vpi]);
+              phba->sli4_hba.vfi_ids[vport->vfi]);
+       bf_set(lpfc_reg_vfi_fcfi, reg_vfi, phba->fcf.fcfi);
+       bf_set(lpfc_reg_vfi_vpi, reg_vfi, phba->vpi_ids[vport->vpi]);
        memcpy(reg_vfi->wwn, &vport->fc_portname, sizeof(struct lpfc_name));
        reg_vfi->wwn[0] = cpu_to_le32(reg_vfi->wwn[0]);
        reg_vfi->wwn[1] = cpu_to_le32(reg_vfi->wwn[1]);
-       reg_vfi->e_d_tov = vport->phba->fc_edtov;
-       reg_vfi->r_a_tov = vport->phba->fc_ratov;
+       reg_vfi->e_d_tov = phba->fc_edtov;
+       reg_vfi->r_a_tov = phba->fc_ratov;
        reg_vfi->bde.addrHigh = putPaddrHigh(phys);
        reg_vfi->bde.addrLow = putPaddrLow(phys);
        reg_vfi->bde.tus.f.bdeSize = sizeof(vport->fc_sparam);
        reg_vfi->bde.tus.f.bdeFlags = BUFF_TYPE_BDE_64;
        bf_set(lpfc_reg_vfi_nport_id, reg_vfi, vport->fc_myDID);
+
+       /* Only FC supports upd bit */
+       if ((phba->sli4_hba.lnk_info.lnk_tp == LPFC_LNK_TYPE_FC) &&
+           (vport->fc_flag & FC_VFI_REGISTERED)) {
+               bf_set(lpfc_reg_vfi_vp, reg_vfi, 0);
+               bf_set(lpfc_reg_vfi_upd, reg_vfi, 1);
+       }
        lpfc_printf_vlog(vport, KERN_INFO, LOG_MBOX,
                        "3134 Register VFI, mydid:x%x, fcfi:%d, "
                        " vfi:%d, vpi:%d, fc_pname:%x%x\n",
                        vport->fc_myDID,
-                       vport->phba->fcf.fcfi,
-                       vport->phba->sli4_hba.vfi_ids[vport->vfi],
-                       vport->phba->vpi_ids[vport->vpi],
+                       phba->fcf.fcfi,
+                       phba->sli4_hba.vfi_ids[vport->vfi],
+                       phba->vpi_ids[vport->vpi],
                        reg_vfi->wwn[0], reg_vfi->wwn[1]);
 }
 
This page took 0.036741 seconds and 5 git commands to generate.