Skip to content

Commit

Permalink
[SCSI] lpfc 8.3.7: Fix hardware/SLI relates issues
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
James Smart authored and James Bottomley committed Jan 4, 2010
1 parent 1987807 commit def9c7a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 17 deletions.
14 changes: 10 additions & 4 deletions drivers/scsi/lpfc/lpfc_hbadisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/lpfc/lpfc_hw4.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
27 changes: 15 additions & 12 deletions drivers/scsi/lpfc/lpfc_sli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -1482,8 +1482,11 @@ lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t hbqno, uint32_t count)
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);
}

/**
Expand All @@ -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);
}

/**
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/lpfc/lpfc_sli4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit def9c7a

Please sign in to comment.