lpfc 8.3.3 : Fix various SLI-3 vs SLI-4 differences
Subsystems (2)
PATCH 1/5 lpfc 8.3.3 : Fix various SLI-3 vs SLI-4 differences
Fix various SLI-3 vs SLI-4 differences
Contains the following changes
- Set the CT field of FDISC to 3
- Fixed over allocation of SCSI buffers on SLI4
- Removed unused jump table entries
- Increase LPFC_WQE_DEF_COUNT to 256
- Updated FDISC context to VPI
- Fixed immediate SCSI command for LUN reset translation to WQE
- Extended mailbox handling to allow MBX_POLL commands in between async MBQ commands
- Fixed SID used for FDISC
- Fix crash when accessing ctlregs from sysfs for SLI4 HBAs
- Fix SLI4 firmware version not being saved or displayed correctly
- Expand CQID field in WQE structure to 16 bits
- Fix post header template mailbox command timing out
- Removed FCoE PCI device ID 0x0705
---
drivers/scsi/lpfc/lpfc.h | 4 - drivers/scsi/lpfc/lpfc_attr.c | 6 + drivers/scsi/lpfc/lpfc_ct.c | 4 + drivers/scsi/lpfc/lpfc_els.c | 14 ++- drivers/scsi/lpfc/lpfc_hw.h | 1 drivers/scsi/lpfc/lpfc_hw4.h | 4 - drivers/scsi/lpfc/lpfc_init.c | 33 +++---- drivers/scsi/lpfc/lpfc_scsi.c | 177 +++++++------------------------------ drivers/scsi/lpfc/lpfc_sli.c | 198 +++++++++++++++++++++++++++++++---------- drivers/scsi/lpfc/lpfc_sli4.h | 2 10 files changed, 224 insertions(+), 219 deletions(-)
drivers/scsi/lpfc/lpfc.h +0 -4
@@ -457,10 +457,6 @@ struct lpfc_hba {void (*lpfc_scsi_prep_cmnd) (struct lpfc_vport *,struct lpfc_scsi_buf *,struct lpfc_nodelist *); -int (*lpfc_scsi_prep_task_mgmt_cmd) - (struct lpfc_vport *,struct lpfc_scsi_buf *, -unsigned int ,uint8_t ); -/* IOCB interface function jump table entries */ int (*__lpfc_sli_issue_iocb) (struct lpfc_hba *, uint32_t,
drivers/scsi/lpfc/lpfc_attr.c +6 -0
@@ -3113,6 +3113,9 @@ sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr,struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;struct lpfc_hba *phba = vport->phba; +if (phba->sli_rev >=LPFC_SLI_REV4 ) +return -EPERM ; +if ((off + count) >FF_REG_AREA_SIZE )return -ERANGE ;
@@ -3163,6 +3166,9 @@ sysfs_ctlreg_read(struct kobject *kobj, struct bin_attribute *bin_attr,struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;struct lpfc_hba *phba = vport->phba; +if (phba->sli_rev >=LPFC_SLI_REV4 ) +return -EPERM ; +if (off >FF_REG_AREA_SIZE )return -ERANGE ;
drivers/scsi/lpfc/lpfc_ct.c +3 -1
@@ -1732,7 +1732,9 @@ lpfc_decode_firmware_rev(struct lpfc_hba *phba, char *fwrevision, int flag)uint32_t *ptr, str[4 ];uint8_t *fwname; -if (vp->rev.rBit) { +if (phba->sli_rev ==LPFC_SLI_REV4 ) +sprintf (fwrevision,"%s" , vp->rev.opFwName); +else if (vp->rev.rBit) {if (psli->sli_flag &LPFC_SLI_ACTIVE ) rev = vp->rev.sli2FwRev;else
drivers/scsi/lpfc/lpfc_els.c +11 -3
@@ -6108,9 +6108,17 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, icmd->un.elsreq64.myID =0 ; icmd->un.elsreq64.fl =1 ; -/* For FDISC, Let FDISC rsp set the NPortID for this VPI */ - icmd->ulpCt_h =1 ; - icmd->ulpCt_l =0 ; +if (phba->sli_rev ==LPFC_SLI_REV4 ) { +/* FDISC needs to be 1 for WQE VPI */ + elsiocb->iocb.ulpCt_h = (SLI4_CT_VPI >>1 ) &1 ; + elsiocb->iocb.ulpCt_l =SLI4_CT_VPI &1 ; +/* Set the ulpContext to the vpi */ + elsiocb->iocb.ulpContext = vport->vpi + phba->vpi_base; + }else { +/* For FDISC, Let FDISC rsp set the NPortID for this VPI */ + icmd->ulpCt_h =1 ; + icmd->ulpCt_l =0 ; + } pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); *((uint32_t *) (pcmd)) =ELS_CMD_FDISC ;
drivers/scsi/lpfc/lpfc_hw.h +0 -1
@@ -1183,7 +1183,6 @@ typedef struct {#define PCI_DEVICE_ID_ZEPHYR_DCSP 0xfe12#define PCI_VENDOR_ID_SERVERENGINE 0x19a2#define PCI_DEVICE_ID_TIGERSHARK 0x0704 -#define PCI_DEVICE_ID_TIGERSHARK_S 0x0705#define JEDEC_ID_ADDRESS 0x0080001c#define FIREFLY_JEDEC_ID 0x1ACC
drivers/scsi/lpfc/lpfc_hw4.h +2 -2
@@ -422,9 +422,9 @@ struct lpfc_wqe_generic{#define lpfc_wqe_gen_pri_WORD word10uint32_t word11;#define lpfc_wqe_gen_cq_id_SHIFT 16 -#define lpfc_wqe_gen_cq_id_MASK 0x000003FF +#define lpfc_wqe_gen_cq_id_MASK 0x0000FFFF#define lpfc_wqe_gen_cq_id_WORD word11 -#define LPFC_WQE_CQ_ID_DEFAULT 0x3ff +#define LPFC_WQE_CQ_ID_DEFAULT 0xffff#define lpfc_wqe_gen_wqec_SHIFT 7#define lpfc_wqe_gen_wqec_MASK 0x00000001#define lpfc_wqe_gen_wqec_WORD word11
drivers/scsi/lpfc/lpfc_init.c +15 -18
@@ -428,7 +428,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)/* Reset the DFT_HBA_Q_DEPTH to the max xri */ if (phba->cfg_hba_queue_depth > (mb->un.varRdConfig.max_xri+1 )) phba->cfg_hba_queue_depth = - mb->un.varRdConfig.max_xri +1 ; + (mb->un.varRdConfig.max_xri +1 ) - +lpfc_sli4_get_els_iocb_cnt (phba); phba->lmt = mb->un.varRdConfig.lmt;
@@ -1646,10 +1647,6 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) oneConnect =1 ; m = (typeof (m )) {"OCe10100-F" , max_speed,"PCIe" };break ; -case PCI_DEVICE_ID_TIGERSHARK_S : - oneConnect =1 ; - m = (typeof (m )) {"OCe10100-F-S" , max_speed,"PCIe" }; -break ;default : m = (typeof (m )){NULL };break ;
@@ -7184,16 +7181,19 @@ lpfc_sli4_get_els_iocb_cnt(struct lpfc_hba *phba) {int max_xri = phba->sli4_hba.max_cfg_param.max_xri; -if (max_xri <=100 ) -return 4 ; -else if (max_xri <=256 ) -return 8 ; -else if (max_xri <=512 ) -return 16 ; -else if (max_xri <=1024 ) -return 32 ; -else -return 48 ; +if (phba->sli_rev ==LPFC_SLI_REV4 ) { +if (max_xri <=100 ) +return 4 ; +else if (max_xri <=256 ) +return 8 ; +else if (max_xri <=512 ) +return 16 ; +else if (max_xri <=1024 ) +return 32 ; +else +return 48 ; + }else +return 0 ; }/**
@@ -7642,7 +7642,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)switch (dev_id) {case PCI_DEVICE_ID_TIGERSHARK : -case PCI_DEVICE_ID_TIGERSHARK_S : rc =lpfc_pci_probe_one_s4 (pdev, pid);break ;default :
@@ -7941,8 +7940,6 @@ static struct pci_device_id lpfc_id_table[] = { PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_SERVERENGINE, PCI_DEVICE_ID_TIGERSHARK, PCI_ANY_ID, PCI_ANY_ID, }, - {PCI_VENDOR_ID_SERVERENGINE, PCI_DEVICE_ID_TIGERSHARK_S, - PCI_ANY_ID, PCI_ANY_ID, }, { 0 } };
drivers/scsi/lpfc/lpfc_scsi.c +35 -142
249 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_sli.c +151 -47
262 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_sli4.h +1 -1
@@ -229,7 +229,7 @@ struct lpfc_bmbx {#define LPFC_EQE_DEF_COUNT 1024#define LPFC_CQE_DEF_COUNT 256 -#define LPFC_WQE_DEF_COUNT 64 +#define LPFC_WQE_DEF_COUNT 256#define LPFC_MQE_DEF_COUNT 16#define LPFC_RQE_DEF_COUNT 512