Commit def9c7a9 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.3.7: Fix hardware/SLI relates issues

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: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 1987807d
...@@ -1555,10 +1555,16 @@ lpfc_mbx_cmpl_read_fcf_record(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) ...@@ -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. * to book keeping the FCFIs can be used.
*/ */
if (shdr_status || shdr_add_status) { if (shdr_status || shdr_add_status) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, if (shdr_status == STATUS_FCF_TABLE_EMPTY) {
"2521 READ_FCF_RECORD mailbox failed " lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"with status x%x add_status x%x, mbx\n", "2726 READ_FCF_RECORD Indicates empty "
shdr_status, shdr_add_status); "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; goto out;
} }
/* Interpreting the returned information of FCF records */ /* Interpreting the returned information of FCF records */
......
...@@ -1371,6 +1371,7 @@ struct lpfc_mbx_query_fw_cfg { ...@@ -1371,6 +1371,7 @@ struct lpfc_mbx_query_fw_cfg {
#define STATUS_ERROR_ACITMAIN 0x2a #define STATUS_ERROR_ACITMAIN 0x2a
#define STATUS_REBOOT_REQUIRED 0x2c #define STATUS_REBOOT_REQUIRED 0x2c
#define STATUS_FCF_IN_USE 0x3a #define STATUS_FCF_IN_USE 0x3a
#define STATUS_FCF_TABLE_EMPTY 0x43
struct lpfc_mbx_sli4_config { struct lpfc_mbx_sli4_config {
struct mbox_header header; struct mbox_header header;
......
...@@ -7507,6 +7507,9 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid) ...@@ -7507,6 +7507,9 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid)
error = -ENODEV; error = -ENODEV;
goto out_free_sysfs_attr; 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 */ /* Set up SLI-4 HBA */
if (lpfc_sli4_hba_setup(phba)) { if (lpfc_sli4_hba_setup(phba)) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
......
...@@ -1383,7 +1383,7 @@ lpfc_sli_hbq_to_firmware_s4(struct lpfc_hba *phba, uint32_t hbqno, ...@@ -1383,7 +1383,7 @@ lpfc_sli_hbq_to_firmware_s4(struct lpfc_hba *phba, uint32_t hbqno,
/* HBQ for ELS and CT traffic. */ /* HBQ for ELS and CT traffic. */
static struct lpfc_hbq_init lpfc_els_hbq = { static struct lpfc_hbq_init lpfc_els_hbq = {
.rn = 1, .rn = 1,
.entry_count = 200, .entry_count = 256,
.mask_count = 0, .mask_count = 0,
.profile = 0, .profile = 0,
.ring_mask = (1 << LPFC_ELS_RING), .ring_mask = (1 << LPFC_ELS_RING),
...@@ -1482,8 +1482,11 @@ lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t hbqno, uint32_t count) ...@@ -1482,8 +1482,11 @@ lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t hbqno, uint32_t count)
int int
lpfc_sli_hbqbuf_add_hbqs(struct lpfc_hba *phba, uint32_t qno) lpfc_sli_hbqbuf_add_hbqs(struct lpfc_hba *phba, uint32_t qno)
{ {
return(lpfc_sli_hbqbuf_fill_hbqs(phba, qno, if (phba->sli_rev == LPFC_SLI_REV4)
lpfc_hbq_defs[qno]->add_count)); 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) ...@@ -1498,8 +1501,12 @@ lpfc_sli_hbqbuf_add_hbqs(struct lpfc_hba *phba, uint32_t qno)
static int static int
lpfc_sli_hbqbuf_init_hbqs(struct lpfc_hba *phba, uint32_t qno) lpfc_sli_hbqbuf_init_hbqs(struct lpfc_hba *phba, uint32_t qno)
{ {
return(lpfc_sli_hbqbuf_fill_hbqs(phba, qno, if (phba->sli_rev == LPFC_SLI_REV4)
lpfc_hbq_defs[qno]->init_count)); 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, ...@@ -4110,6 +4117,7 @@ lpfc_sli4_read_rev(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq,
if (rc) { if (rc) {
dma_free_coherent(&phba->pcidev->dev, dma_size, dma_free_coherent(&phba->pcidev->dev, dma_size,
dmabuf->virt, dmabuf->phys); dmabuf->virt, dmabuf->phys);
kfree(dmabuf);
return -EIO; return -EIO;
} }
...@@ -11409,14 +11417,9 @@ lpfc_sli4_handle_received_buffer(struct lpfc_hba *phba, ...@@ -11409,14 +11417,9 @@ lpfc_sli4_handle_received_buffer(struct lpfc_hba *phba,
return; return;
} }
/* If not last frame in sequence continue processing frames. */ /* If not last frame in sequence continue processing frames. */
if (!lpfc_seq_complete(seq_dmabuf)) { 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);
return; return;
}
/* Send the complete sequence to the upper layer protocol */ /* Send the complete sequence to the upper layer protocol */
lpfc_sli4_send_seq_to_ulp(vport, seq_dmabuf); lpfc_sli4_send_seq_to_ulp(vport, seq_dmabuf);
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* Multi-queue arrangement for fast-path FCP work queues */ /* Multi-queue arrangement for fast-path FCP work queues */
#define LPFC_FN_EQN_MAX 8 #define LPFC_FN_EQN_MAX 8
#define LPFC_SP_EQN_DEF 1 #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_MIN 1
#define LPFC_FP_EQN_MAX (LPFC_FN_EQN_MAX - LPFC_SP_EQN_DEF) #define LPFC_FP_EQN_MAX (LPFC_FN_EQN_MAX - LPFC_SP_EQN_DEF)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment