Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34b02dcd authored by James Smart's avatar James Smart Committed by James Bottomley
Browse files

[SCSI] lpfc 8.2.8 : Update driver for new SLI-3 features



Update driver for new SLI-3 features:
- interrupt enhancements
- lose adapter doorbell writes
- inlining support for FCP_Ixx cmds

Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 90160e01
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -407,10 +407,11 @@ struct lpfc_hba {
	struct lpfc_sli sli;
	uint32_t sli_rev;		/* SLI2 or SLI3 */
	uint32_t sli3_options;		/* Mask of enabled SLI3 options */
#define LPFC_SLI3_ENABLED	 0x01
#define LPFC_SLI3_HBQ_ENABLED	 0x02
#define LPFC_SLI3_NPIV_ENABLED	 0x04
#define LPFC_SLI3_VPORT_TEARDOWN 0x08
#define LPFC_SLI3_HBQ_ENABLED		0x01
#define LPFC_SLI3_NPIV_ENABLED		0x02
#define LPFC_SLI3_VPORT_TEARDOWN	0x04
#define LPFC_SLI3_CRP_ENABLED		0x08
#define LPFC_SLI3_INB_ENABLED		0x10
	uint32_t iocb_cmd_size;
	uint32_t iocb_rsp_size;

@@ -422,10 +423,16 @@ struct lpfc_hba {
#define LS_NPIV_FAB_SUPPORTED 0x2	/* Fabric supports NPIV */
#define LS_IGNORE_ERATT       0x4	/* intr handler should ignore ERATT */

	struct lpfc_sli2_slim *slim2p;
	struct lpfc_dmabuf hbqslimp;
	struct lpfc_dmabuf slim2p;

	MAILBOX_t *mbox;
	uint32_t *inb_ha_copy;
	uint32_t *inb_counter;
	uint32_t inb_last_counter;
	struct _PCB *pcb;
	struct _IOCB *IOCBs;

	dma_addr_t slim2p_mapping;
	struct lpfc_dmabuf hbqslimp;

	uint16_t pci_cfg_value;

@@ -514,6 +521,7 @@ struct lpfc_hba {
	void __iomem *HCregaddr;	/* virtual address for host ctl reg */

	struct lpfc_hgp __iomem *host_gp; /* Host side get/put pointers */
	struct lpfc_pgp   *port_gp;
	uint32_t __iomem  *hbq_put;     /* Address in SLIM to HBQ put ptrs */
	uint32_t          *hbq_get;     /* Host mem address of HBQ get ptrs */

+2 −2
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ lpfc_alloc_ct_rsp(struct lpfc_hba *phba, int cmdcode, struct ulp_bde64 *bpl,
		else
			list_add_tail(&mp->list, &mlist->list);

		bpl->tus.f.bdeFlags = BUFF_USE_RCV;
		bpl->tus.f.bdeFlags = BUFF_TYPE_BDE_64I;
		/* build buffer ptr list for IOCB */
		bpl->addrLow = le32_to_cpu(putPaddrLow(mp->phys) );
		bpl->addrHigh = le32_to_cpu(putPaddrHigh(mp->phys) );
@@ -283,7 +283,7 @@ lpfc_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp,
	icmd->un.genreq64.bdl.ulpIoTag32 = 0;
	icmd->un.genreq64.bdl.addrHigh = putPaddrHigh(bmp->phys);
	icmd->un.genreq64.bdl.addrLow = putPaddrLow(bmp->phys);
	icmd->un.genreq64.bdl.bdeFlags = BUFF_TYPE_BDL;
	icmd->un.genreq64.bdl.bdeFlags = BUFF_TYPE_BLP_64;
	icmd->un.genreq64.bdl.bdeSize = (num_entry * sizeof (struct ulp_bde64));

	if (usr_flg)
+12 −40
Original line number Diff line number Diff line
@@ -454,7 +454,7 @@ lpfc_debugfs_dumpHostSlim_data(struct lpfc_hba *phba, char *buf, int size)
	spin_lock_irq(&phba->hbalock);

	len +=  snprintf(buf+len, size-len, "SLIM Mailbox\n");
	ptr = (uint32_t *)phba->slim2p;
	ptr = (uint32_t *)phba->slim2p.virt;
	i = sizeof(MAILBOX_t);
	while (i > 0) {
		len +=  snprintf(buf+len, size-len,
@@ -467,7 +467,7 @@ lpfc_debugfs_dumpHostSlim_data(struct lpfc_hba *phba, char *buf, int size)
	}

	len +=  snprintf(buf+len, size-len, "SLIM PCB\n");
	ptr = (uint32_t *)&phba->slim2p->pcb;
	ptr = (uint32_t *)phba->pcb;
	i = sizeof(PCB_t);
	while (i > 0) {
		len +=  snprintf(buf+len, size-len,
@@ -479,44 +479,16 @@ lpfc_debugfs_dumpHostSlim_data(struct lpfc_hba *phba, char *buf, int size)
		off += (8 * sizeof(uint32_t));
	}

	pgpp = (struct lpfc_pgp *)&phba->slim2p->mbx.us.s3_pgp.port;
	pring = &psli->ring[0];
	for (i = 0; i < 4; i++) {
		pgpp = &phba->port_gp[i];
		pring = &psli->ring[i];
		len +=  snprintf(buf+len, size-len,
		"Ring 0: CMD GetInx:%d (Max:%d Next:%d Local:%d flg:x%x)  "
		"RSP PutInx:%d Max:%d\n",
		pgpp->cmdGetInx, pring->numCiocb,
		pring->next_cmdidx, pring->local_getidx, pring->flag,
		pgpp->rspPutInx, pring->numRiocb);
	pgpp++;

	pring = &psli->ring[1];
	len +=  snprintf(buf+len, size-len,
		"Ring 1: CMD GetInx:%d (Max:%d Next:%d Local:%d flg:x%x)  "
		"RSP PutInx:%d Max:%d\n",
		pgpp->cmdGetInx, pring->numCiocb,
		pring->next_cmdidx, pring->local_getidx, pring->flag,
		pgpp->rspPutInx, pring->numRiocb);
	pgpp++;

	pring = &psli->ring[2];
	len +=  snprintf(buf+len, size-len,
		"Ring 2: CMD GetInx:%d (Max:%d Next:%d Local:%d flg:x%x)  "
		"RSP PutInx:%d Max:%d\n",
		pgpp->cmdGetInx, pring->numCiocb,
		pring->next_cmdidx, pring->local_getidx, pring->flag,
		pgpp->rspPutInx, pring->numRiocb);
	pgpp++;

	pring = &psli->ring[3];
	len +=  snprintf(buf+len, size-len,
		"Ring 3: CMD GetInx:%d (Max:%d Next:%d Local:%d flg:x%x)  "
		"RSP PutInx:%d Max:%d\n",
		pgpp->cmdGetInx, pring->numCiocb,
		pring->next_cmdidx, pring->local_getidx, pring->flag,
		pgpp->rspPutInx, pring->numRiocb);


	ptr = (uint32_t *)&phba->slim2p->mbx.us.s3_pgp.hbq_get;
				 "Ring %d: CMD GetInx:%d (Max:%d Next:%d "
				 "Local:%d flg:x%x)  RSP PutInx:%d Max:%d\n",
				 i, pgpp->cmdGetInx, pring->numCiocb,
				 pring->next_cmdidx, pring->local_getidx,
				 pring->flag, pgpp->rspPutInx, pring->numRiocb);
	}
	word0 = readl(phba->HAregaddr);
	word1 = readl(phba->CAregaddr);
	word2 = readl(phba->HSregaddr);
+2 −2
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp,

	icmd->un.elsreq64.bdl.addrHigh = putPaddrHigh(pbuflist->phys);
	icmd->un.elsreq64.bdl.addrLow = putPaddrLow(pbuflist->phys);
	icmd->un.elsreq64.bdl.bdeFlags = BUFF_TYPE_BDL;
	icmd->un.elsreq64.bdl.bdeFlags = BUFF_TYPE_BLP_64;
	icmd->un.elsreq64.remoteID = did;	/* DID */
	if (expectRsp) {
		icmd->un.elsreq64.bdl.bdeSize = (2 * sizeof(struct ulp_bde64));
@@ -235,7 +235,7 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp,
		bpl->addrLow = le32_to_cpu(putPaddrLow(prsp->phys));
		bpl->addrHigh = le32_to_cpu(putPaddrHigh(prsp->phys));
		bpl->tus.f.bdeSize = FCELSSIZE;
		bpl->tus.f.bdeFlags = BUFF_USE_RCV;
		bpl->tus.f.bdeFlags = BUFF_TYPE_BDE_64;
		bpl->tus.w = le32_to_cpu(bpl->tus.w);
	}

+43 −20
Original line number Diff line number Diff line
@@ -1474,24 +1474,18 @@ struct ulp_bde64 { /* SLI-2 */
			uint32_t bdeFlags:8;	/* BDE Flags 0 IS A SUPPORTED
						   VALUE !! */
#endif

#define BUFF_USE_RSVD       0x01	/* bdeFlags */
#define BUFF_USE_INTRPT     0x02	/* Not Implemented with LP6000 */
#define BUFF_USE_CMND       0x04	/* Optional, 1=cmd/rsp 0=data buffer */
#define BUFF_USE_RCV        0x08	/*  "" "", 1=rcv buffer, 0=xmit
					    buffer */
#define BUFF_TYPE_32BIT     0x10	/*  "" "", 1=32 bit addr 0=64 bit
					    addr */
#define BUFF_TYPE_SPECIAL   0x20	/* Not Implemented with LP6000  */
#define BUFF_TYPE_BDL       0x40	/* Optional,  may be set in BDL */
#define BUFF_TYPE_INVALID   0x80	/*  ""  "" */
#define BUFF_TYPE_BDE_64    0x00	/* BDE (Host_resident) */
#define BUFF_TYPE_BDE_IMMED 0x01	/* Immediate Data BDE */
#define BUFF_TYPE_BDE_64P   0x02	/* BDE (Port-resident) */
#define BUFF_TYPE_BDE_64I   0x08	/* Input BDE (Host-resident) */
#define BUFF_TYPE_BDE_64IP  0x0A	/* Input BDE (Port-resident) */
#define BUFF_TYPE_BLP_64    0x40	/* BLP (Host-resident) */
#define BUFF_TYPE_BLP_64P   0x42	/* BLP (Port-resident) */
		} f;
	} tus;
	uint32_t addrLow;
	uint32_t addrHigh;
};
#define BDE64_SIZE_WORD 0
#define BPL64_SIZE_WORD 0x40

typedef struct ULP_BDL {	/* SLI-2 */
#ifdef __BIG_ENDIAN_BITFIELD
@@ -2715,11 +2709,19 @@ struct sli3_pgp {
	uint32_t hbq_get[16];
};

typedef union {
struct sli3_inb_pgp {
	uint32_t ha_copy;
	uint32_t counter;
	struct lpfc_pgp port[MAX_RINGS];
	uint32_t hbq_get[16];
};

union sli_var {
	struct sli2_desc	s2;
	struct sli3_desc	s3;
	struct sli3_pgp		s3_pgp;
} SLI_VAR;
	struct sli3_inb_pgp	s3_inb_pgp;
};

typedef struct {
#ifdef __BIG_ENDIAN_BITFIELD
@@ -2737,7 +2739,7 @@ typedef struct {
#endif

	MAILVARIANTS un;
	SLI_VAR us;
	union sli_var us;
} MAILBOX_t;

/*
@@ -3105,6 +3107,27 @@ struct que_xri64cx_ext_fields {
	struct lpfc_hbq_entry	buff[5];
};

#define LPFC_EXT_DATA_BDE_COUNT 3
struct fcp_irw_ext {
	uint32_t	io_tag64_low;
	uint32_t	io_tag64_high;
#ifdef __BIG_ENDIAN_BITFIELD
	uint8_t		reserved1;
	uint8_t		reserved2;
	uint8_t		reserved3;
	uint8_t		ebde_count;
#else  /* __LITTLE_ENDIAN */
	uint8_t		ebde_count;
	uint8_t		reserved3;
	uint8_t		reserved2;
	uint8_t		reserved1;
#endif
	uint32_t	reserved4;
	struct ulp_bde64 rbde;		/* response bde */
	struct ulp_bde64 dbde[LPFC_EXT_DATA_BDE_COUNT];	/* data BDE or BPL */
	uint8_t icd[32];		/* immediate command data (32 bytes) */
};

typedef struct _IOCB {	/* IOCB structure */
	union {
		GENERIC_RSP grsp;	/* Generic response */
@@ -3190,7 +3213,7 @@ typedef struct _IOCB { /* IOCB structure */

		/* words 8-31 used for que_xri_cx iocb */
		struct que_xri64cx_ext_fields que_xri64cx_ext_words;

		struct fcp_irw_ext fcp_ext;
		uint32_t sli3Words[24]; /* 96 extra bytes for SLI-3 */
	} unsli3;

Loading