Commit 6669f9bb authored by James Smart's avatar James Smart Committed by James Bottomley
Browse files

[SCSI] lpfc 8.3.5: fix VPI registration, error clean up and add support for vlink events



This patch includes the following fixes and new features:
- Fix mask size for CT field in WQE
- Fix VPI base not used when unregistering VPI on port 1.
- Fix UNREG_VPI mailbox command to unreg the correct VPI
- Fixed Check for aborted els command
- Fix error when trying to load driver with wrong firmware on FCoE HBA.
- Fix bug with probe_one routines not putting the Scsi_Host back upon error
- Add support for Clear Virtual Link Async Events
- Add support for unsolicited CT exchange sequence abort
- Add 0x0714 OCeXXXXX PCI ID

Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 4d9ab994
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -144,6 +144,8 @@ void lpfc_hb_timeout_handler(struct lpfc_hba *);

void lpfc_ct_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *,
			 struct lpfc_iocbq *);
void lpfc_sli4_ct_abort_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *,
				    struct lpfc_iocbq *);
int lpfc_ns_cmd(struct lpfc_vport *, int, uint8_t, uint32_t);
int lpfc_fdmi_cmd(struct lpfc_vport *, struct lpfc_nodelist *, int);
void lpfc_fdmi_tmo(unsigned long);
@@ -188,7 +190,7 @@ int lpfc_mbox_tmo_val(struct lpfc_hba *, int);
void lpfc_init_vfi(struct lpfcMboxq *, struct lpfc_vport *);
void lpfc_reg_vfi(struct lpfcMboxq *, struct lpfc_vport *, dma_addr_t);
void lpfc_init_vpi(struct lpfc_hba *, struct lpfcMboxq *, uint16_t);
void lpfc_unreg_vfi(struct lpfcMboxq *, uint16_t);
void lpfc_unreg_vfi(struct lpfcMboxq *, struct lpfc_vport *);
void lpfc_reg_fcfi(struct lpfc_hba *, struct lpfcMboxq *);
void lpfc_unreg_fcfi(struct lpfcMboxq *, uint16_t);
void lpfc_resume_rpi(struct lpfcMboxq *, struct lpfc_nodelist *);
@@ -361,6 +363,7 @@ void lpfc_stop_port(struct lpfc_hba *);
void lpfc_parse_fcoe_conf(struct lpfc_hba *, uint8_t *, uint32_t);
int lpfc_parse_vpd(struct lpfc_hba *, uint8_t *, int);
void lpfc_start_fdiscs(struct lpfc_hba *phba);
struct lpfc_vport *lpfc_find_vport_by_vpid(struct lpfc_hba *, uint16_t);

#define ScsiResult(host_code, scsi_code) (((host_code) << 16) | scsi_code)
#define HBA_EVENT_RSCN                   5
+33 −1
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@ void
lpfc_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
		    struct lpfc_iocbq *piocbq)
{

	struct lpfc_dmabuf *mp = NULL;
	IOCB_t *icmd = &piocbq->iocb;
	int i;
@@ -160,6 +159,39 @@ lpfc_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
	}
}

/**
 * lpfc_sli4_ct_abort_unsol_event - Default handle for sli4 unsol abort
 * @phba: Pointer to HBA context object.
 * @pring: Pointer to the driver internal I/O ring.
 * @piocbq: Pointer to the IOCBQ.
 *
 * This function serves as the default handler for the sli4 unsolicited
 * abort event. It shall be invoked when there is no application interface
 * registered unsolicited abort handler. This handler does nothing but
 * just simply releases the dma buffer used by the unsol abort event.
 **/
void
lpfc_sli4_ct_abort_unsol_event(struct lpfc_hba *phba,
			       struct lpfc_sli_ring *pring,
			       struct lpfc_iocbq *piocbq)
{
	IOCB_t *icmd = &piocbq->iocb;
	struct lpfc_dmabuf *bdeBuf;
	uint32_t size;

	/* Forward abort event to any process registered to receive ct event */
	lpfc_bsg_ct_unsol_event(phba, pring, piocbq);

	/* If there is no BDE associated with IOCB, there is nothing to do */
	if (icmd->ulpBdeCount == 0)
		return;
	bdeBuf = piocbq->context2;
	piocbq->context2 = NULL;
	size  = icmd->un.cont64[0].tus.f.bdeSize;
	lpfc_ct_unsol_buffer(phba, piocbq, bdeBuf, size);
	lpfc_in_buf_free(phba, bdeBuf);
}

static void
lpfc_free_ct_rsp(struct lpfc_hba *phba, struct lpfc_dmabuf *mlist)
{
+8 −4
Original line number Diff line number Diff line
@@ -2712,12 +2712,16 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
	    !lpfc_error_lost_link(irsp)) {
		/* FLOGI retry policy */
		retry = 1;
		maxretry = 48;
		if (cmdiocb->retry >= 32)
		/* retry forever */
		maxretry = 0;
		if (cmdiocb->retry >= 100)
			delay = 5000;
		else if (cmdiocb->retry >= 32)
			delay = 1000;
	}

	if ((++cmdiocb->retry) >= maxretry) {
	cmdiocb->retry++;
	if (maxretry && (cmdiocb->retry >= maxretry)) {
		phba->fc_stat.elsRetryExceeded++;
		retry = 0;
	}
@@ -5671,7 +5675,7 @@ dropit:
 *    NULL - No vport with the matching @vpi found
 *    Otherwise - Address to the vport with the matching @vpi.
 **/
static struct lpfc_vport *
struct lpfc_vport *
lpfc_find_vport_by_vpid(struct lpfc_hba *phba, uint16_t vpi)
{
	struct lpfc_vport *vport;
+1 −1
Original line number Diff line number Diff line
@@ -4474,7 +4474,7 @@ lpfc_unregister_unused_fcf(struct lpfc_hba *phba)
		return;
	}

	lpfc_unreg_vfi(mbox, phba->pport->vfi);
	lpfc_unreg_vfi(mbox, phba->pport);
	mbox->vport = phba->pport;
	mbox->mbox_cmpl = lpfc_unregister_vfi_cmpl;

+9 −1
Original line number Diff line number Diff line
@@ -1183,6 +1183,7 @@ 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_TS_BE3        0x0714

#define JEDEC_ID_ADDRESS            0x0080001c
#define FIREFLY_JEDEC_ID            0x1ACC
@@ -1444,6 +1445,7 @@ typedef struct { /* FireFly BIU registers */
#define CMD_ABORT_MXRI64_CN     0x8C
#define CMD_RCV_ELS_REQ64_CX    0x8D
#define CMD_XMIT_ELS_RSP64_CX   0x95
#define CMD_XMIT_BLS_RSP64_CX   0x97
#define CMD_FCP_IWRITE64_CR     0x98
#define CMD_FCP_IWRITE64_CX     0x99
#define CMD_FCP_IREAD64_CR      0x9A
@@ -2326,7 +2328,13 @@ typedef struct {
/* Structure for MB Command UNREG_VPI (0x97) */
typedef struct {
	uint32_t rsvd1;
	uint32_t rsvd2;
#ifdef __BIG_ENDIAN_BITFIELD
	uint16_t rsvd2;
	uint16_t sli4_vpi;
#else	/*  __LITTLE_ENDIAN */
	uint16_t sli4_vpi;
	uint16_t rsvd2;
#endif
	uint32_t rsvd3;
	uint32_t rsvd4;
	uint32_t rsvd5;
Loading