[SCSI] lpfc 8.3.7: Fix hardware/SLI relates issues
authorJames Smart <james.smart@emulex.com>
Mon, 21 Dec 2009 22:02:28 +0000 (17:02 -0500)
committerJames Bottomley <James.Bottomley@suse.de>
Mon, 4 Jan 2010 17:39:44 +0000 (11:39 -0600)
Fix hardware/SLI relates issues:
- Fix CNA uses more than one EQ when in INTx interrupt mode.
- Fix driver tries to process failed read FCF record mailbox request.
- Fix allocating single receive buffer breaks FCoE receive queue.
- Support new read FCF record mailbox error case.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_hw4.h [changed mode: 0644->0755]
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/lpfc/lpfc_sli4.h

index 401167de4ff096d33186af30564eabb0468efa95..f40b9609f6e45a95799aeac89b084fb18682f16a 100755 (executable)
@@ -1555,10 +1555,16 @@ lpfc_mbx_cmpl_read_fcf_record(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
         * to book keeping the FCFIs can be used.
         */
        if (shdr_status || shdr_add_status) {
-               lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
-                               "2521 READ_FCF_RECORD mailbox failed "
-                               "with status x%x add_status x%x, mbx\n",
-                               shdr_status, shdr_add_status);
+               if (shdr_status == STATUS_FCF_TABLE_EMPTY) {
+                       lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
+                                       "2726 READ_FCF_RECORD Indicates empty "
+                                       "FCF table.\n");
+               } else {
+                       lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
+                                       "2521 READ_FCF_RECORD mailbox failed "
+                                       "with status x%x add_status x%x, mbx\n",
+                                       shdr_status, shdr_add_status);
+               }
                goto out;
        }
        /* Interpreting the returned information of FCF records */
old mode 100644 (file)
new mode 100755 (executable)
index 09c8e36..8a2a1c5
@@ -1371,6 +1371,7 @@ struct lpfc_mbx_query_fw_cfg {
 #define STATUS_ERROR_ACITMAIN                          0x2a
 #define STATUS_REBOOT_REQUIRED                         0x2c
 #define STATUS_FCF_IN_USE                              0x3a
+#define STATUS_FCF_TABLE_EMPTY                         0x43
 
 struct lpfc_mbx_sli4_config {
        struct mbox_header header;
index d4da6bdd0e73fd5d4442b2487e185920f59ef7de..7083ef3b3878b358e9a1689ca1c362aa86cfd26d 100644 (file)
@@ -7507,6 +7507,9 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid)
                        error = -ENODEV;
                        goto out_free_sysfs_attr;
                }
+               /* Default to single FCP EQ for non-MSI-X */
+               if (phba->intr_type != MSIX)
+                       phba->cfg_fcp_eq_count = 1;
                /* Set up SLI-4 HBA */
                if (lpfc_sli4_hba_setup(phba)) {
                        lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
index 50f72bf182561fff9f0fccd46e200d677a709db0..589549b2bf0e2da65b38078c8ee005f0afcee822 100644 (file)
@@ -1383,7 +1383,7 @@ lpfc_sli_hbq_to_firmware_s4(struct lpfc_hba *phba, uint32_t hbqno,
 /* HBQ for ELS and CT traffic. */
 static struct lpfc_hbq_init lpfc_els_hbq = {
        .rn = 1,
-       .entry_count = 200,
+       .entry_count = 256,
        .mask_count = 0,
        .profile = 0,
        .ring_mask = (1 << LPFC_ELS_RING),
@@ -1482,8 +1482,11 @@ err:
 int
 lpfc_sli_hbqbuf_add_hbqs(struct lpfc_hba *phba, uint32_t qno)
 {
-       return(lpfc_sli_hbqbuf_fill_hbqs(phba, qno,
-                                        lpfc_hbq_defs[qno]->add_count));
+       if (phba->sli_rev == LPFC_SLI_REV4)
+               return 0;
+       else
+               return lpfc_sli_hbqbuf_fill_hbqs(phba, qno,
+                                        lpfc_hbq_defs[qno]->add_count);
 }
 
 /**
@@ -1498,8 +1501,12 @@ lpfc_sli_hbqbuf_add_hbqs(struct lpfc_hba *phba, uint32_t qno)
 static int
 lpfc_sli_hbqbuf_init_hbqs(struct lpfc_hba *phba, uint32_t qno)
 {
-       return(lpfc_sli_hbqbuf_fill_hbqs(phba, qno,
-                                        lpfc_hbq_defs[qno]->init_count));
+       if (phba->sli_rev == LPFC_SLI_REV4)
+               return lpfc_sli_hbqbuf_fill_hbqs(phba, qno,
+                                        lpfc_hbq_defs[qno]->entry_count);
+       else
+               return lpfc_sli_hbqbuf_fill_hbqs(phba, qno,
+                                        lpfc_hbq_defs[qno]->init_count);
 }
 
 /**
@@ -4110,6 +4117,7 @@ lpfc_sli4_read_rev(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq,
        if (rc) {
                dma_free_coherent(&phba->pcidev->dev, dma_size,
                                  dmabuf->virt, dmabuf->phys);
+               kfree(dmabuf);
                return -EIO;
        }
 
@@ -11409,14 +11417,9 @@ lpfc_sli4_handle_received_buffer(struct lpfc_hba *phba,
                return;
        }
        /* If not last frame in sequence continue processing frames. */
-       if (!lpfc_seq_complete(seq_dmabuf)) {
-               /*
-                * When saving off frames post a new one and mark this
-                * frame to be freed when it is finished.
-                **/
-               lpfc_sli_hbqbuf_fill_hbqs(phba, LPFC_ELS_HBQ, 1);
+       if (!lpfc_seq_complete(seq_dmabuf))
                return;
-       }
+
        /* Send the complete sequence to the upper layer protocol */
        lpfc_sli4_send_seq_to_ulp(vport, seq_dmabuf);
 }
index 25d66d070cf8ff9e992b7bc164eaffd65bc336ec..44e5f574236bf25322eb9d30ebebc3faa8ae9442 100644 (file)
@@ -28,7 +28,7 @@
 /* Multi-queue arrangement for fast-path FCP work queues */
 #define LPFC_FN_EQN_MAX       8
 #define LPFC_SP_EQN_DEF       1
-#define LPFC_FP_EQN_DEF       1
+#define LPFC_FP_EQN_DEF       4
 #define LPFC_FP_EQN_MIN       1
 #define LPFC_FP_EQN_MAX       (LPFC_FN_EQN_MAX - LPFC_SP_EQN_DEF)