]> Pileus Git - ~andy/linux/blobdiff - drivers/scsi/lpfc/lpfc_hbadisc.c
[SCSI] lpfc 8.3.6 : FCoE Protocol Fixes
[~andy/linux] / drivers / scsi / lpfc / lpfc_hbadisc.c
index 1b2771ac15f2cc3eee6887597c71514f47e39e6d..3c06aa54a3e5104e5760f699ef9f69858cd6fb46 100644 (file)
@@ -568,7 +568,7 @@ lpfc_work_done(struct lpfc_hba *phba)
        status >>= (4*LPFC_ELS_RING);
        if ((status & HA_RXMASK) ||
            (pring->flag & LPFC_DEFERRED_RING_EVENT) ||
-           (phba->hba_flag & HBA_RECEIVE_BUFFER)) {
+           (phba->hba_flag & HBA_SP_QUEUE_EVT)) {
                if (pring->flag & LPFC_STOP_IOCB_EVENT) {
                        pring->flag |= LPFC_DEFERRED_RING_EVENT;
                        /* Set the lpfc data pending flag */
@@ -706,6 +706,9 @@ lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove)
 void
 lpfc_port_link_failure(struct lpfc_vport *vport)
 {
+       /* Cleanup any outstanding received buffers */
+       lpfc_cleanup_rcv_buffers(vport);
+
        /* Cleanup any outstanding RSCN activity */
        lpfc_els_flush_rscn(vport);
 
@@ -1282,7 +1285,7 @@ lpfc_match_fcf_conn_list(struct lpfc_hba *phba,
                !bf_get(lpfc_fcf_record_fcf_valid, new_fcf_record))
                return 0;
 
-       if (!phba->cfg_enable_fip) {
+       if (!(phba->hba_flag & HBA_FIP_SUPPORT)) {
                *boot_flag = 0;
                *addr_mode = bf_get(lpfc_fcf_record_mac_addr_prov,
                                new_fcf_record);
@@ -1699,9 +1702,8 @@ lpfc_init_vpi_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
                lpfc_initial_fdisc(vport);
        else {
                lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
-               lpfc_printf_vlog(vport, KERN_ERR,
-                       LOG_ELS,
-                       "2606 No NPIV Fabric support\n");
+               lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
+                                "2606 No NPIV Fabric support\n");
        }
        return;
 }
@@ -1796,8 +1798,8 @@ lpfc_mbx_cmpl_reg_vfi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
                lpfc_vport_set_state(vport, FC_VPORT_FAILED);
                goto fail_free_mem;
        }
-       /* Mark the vport has registered with its VFI */
-       vport->vfi_state |= LPFC_VFI_REGISTERED;
+       /* The VPI is implicitly registered when the VFI is registered */
+       vport->vpi_state |= LPFC_VPI_REGISTERED;
 
        if (vport->port_state == LPFC_FABRIC_CFG_LINK) {
                lpfc_start_fdiscs(phba);
@@ -1901,7 +1903,10 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
        if (phba->fc_topology == TOPOLOGY_LOOP) {
                phba->sli3_options &= ~LPFC_SLI3_NPIV_ENABLED;
 
-               if (phba->cfg_enable_npiv)
+               /* if npiv is enabled and this adapter supports npiv log
+                * a message that npiv is not supported in this topology
+                */
+               if (phba->cfg_enable_npiv && phba->max_vpi)
                        lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT,
                                "1309 Link Up Event npiv not supported in loop "
                                "topology\n");
@@ -1995,7 +2000,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
                 * is phase 1 implementation that support FCF index 0 and driver
                 * defaults.
                 */
-               if (phba->cfg_enable_fip == 0) {
+               if (!(phba->hba_flag & HBA_FIP_SUPPORT)) {
                        fcf_record = kzalloc(sizeof(struct fcf_record),
                                        GFP_KERNEL);
                        if (unlikely(!fcf_record)) {
@@ -2252,6 +2257,7 @@ lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
                                 mb->mbxStatus);
                break;
        }
+       vport->vpi_state &= ~LPFC_VPI_REGISTERED;
        vport->unreg_vpi_cmpl = VPORT_OK;
        mempool_free(pmb, phba->mbox_mem_pool);
        /*
@@ -2309,6 +2315,7 @@ lpfc_mbx_cmpl_reg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
                goto out;
        }
 
+       vport->vpi_state |= LPFC_VPI_REGISTERED;
        vport->num_disc_nodes = 0;
        /* go thru NPR list and issue ELS PLOGIs */
        if (vport->fc_npr_cnt)
@@ -3118,7 +3125,7 @@ lpfc_no_rpi(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
        struct lpfc_sli *psli;
        struct lpfc_sli_ring *pring;
        struct lpfc_iocbq *iocb, *next_iocb;
-       uint32_t rpi, i;
+       uint32_t i;
 
        lpfc_fabric_abort_nport(ndlp);
 
@@ -3127,7 +3134,6 @@ lpfc_no_rpi(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
         * by firmware with a no rpi error.
         */
        psli = &phba->sli;
-       rpi = ndlp->nlp_rpi;
        if (ndlp->nlp_flag & NLP_RPI_VALID) {
                /* Now process each ring */
                for (i = 0; i < psli->num_rings; i++) {
@@ -4441,7 +4447,7 @@ lpfc_unregister_unused_fcf(struct lpfc_hba *phba)
         */
        if (!(phba->hba_flag & HBA_FCOE_SUPPORT) ||
                !(phba->fcf.fcf_flag & FCF_REGISTERED) ||
-               (phba->cfg_enable_fip == 0)) {
+               (!(phba->hba_flag & HBA_FIP_SUPPORT))) {
                spin_unlock_irq(&phba->hbalock);
                return;
        }
@@ -4460,7 +4466,7 @@ lpfc_unregister_unused_fcf(struct lpfc_hba *phba)
                for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
                        lpfc_mbx_unreg_vpi(vports[i]);
                        vports[i]->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
-                       vports[i]->vfi_state &= ~LPFC_VFI_REGISTERED;
+                       vports[i]->vpi_state &= ~LPFC_VPI_REGISTERED;
                }
        lpfc_destroy_vport_work_array(phba, vports);
 
@@ -4614,14 +4620,6 @@ lpfc_read_fcoe_param(struct lpfc_hba *phba,
                (fcoe_param_hdr->length != FCOE_PARAM_LENGTH))
                return;
 
-       if (bf_get(lpfc_fip_param_hdr_fipp_mode, fcoe_param_hdr) ==
-                       FIPP_MODE_ON)
-               phba->cfg_enable_fip = 1;
-
-       if (bf_get(lpfc_fip_param_hdr_fipp_mode, fcoe_param_hdr) ==
-               FIPP_MODE_OFF)
-               phba->cfg_enable_fip = 0;
-
        if (fcoe_param_hdr->parm_flags & FIPP_VLAN_VALID) {
                phba->valid_vlan = 1;
                phba->vlan_id = le16_to_cpu(fcoe_param->vlan_tag) &