Commit a0465859 authored by Bikash Hazarika's avatar Bikash Hazarika Committed by Martin K. Petersen
Browse files

scsi: qla2xxx: Wait for ABTS response on I/O timeouts for NVMe

parent daaecb41
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -2101,6 +2101,7 @@ typedef struct {
#define CS_COMPLETE_CHKCOND	0x30	/* Error? */
#define CS_IOCB_ERROR		0x31	/* Generic error for IOCB request
					   failure */
#define CS_REJECT_RECEIVED	0x4E	/* Reject received */
#define CS_BAD_PAYLOAD		0x80	/* Driver defined */
#define CS_UNKNOWN		0x81	/* Driver defined */
#define CS_RETRY		0x82	/* Driver defined */
@@ -4150,6 +4151,17 @@ struct qla_hw_data {
/* Bit 21 of fw_attributes decides the MCTP capabilities */
#define IS_MCTP_CAPABLE(ha)	(IS_QLA2031(ha) && \
				((ha)->fw_attributes_ext[0] & BIT_0))
#define QLA_ABTS_FW_ENABLED(_ha)       ((_ha)->fw_attributes_ext[0] & BIT_14)
#define QLA_SRB_NVME_LS(_sp) ((_sp)->type == SRB_NVME_LS)
#define QLA_SRB_NVME_CMD(_sp) ((_sp)->type == SRB_NVME_CMD)
#define QLA_NVME_IOS(_sp) (QLA_SRB_NVME_CMD(_sp) || QLA_SRB_NVME_LS(_sp))
#define QLA_LS_ABTS_WAIT_ENABLED(_sp) \
	(QLA_SRB_NVME_LS(_sp) && QLA_ABTS_FW_ENABLED(_sp->fcport->vha->hw))
#define QLA_CMD_ABTS_WAIT_ENABLED(_sp) \
	(QLA_SRB_NVME_CMD(_sp) && QLA_ABTS_FW_ENABLED(_sp->fcport->vha->hw))
#define QLA_ABTS_WAIT_ENABLED(_sp) \
	(QLA_NVME_IOS(_sp) && QLA_ABTS_FW_ENABLED(_sp->fcport->vha->hw))

#define IS_PI_UNINIT_CAPABLE(ha)	(IS_QLA83XX(ha) || IS_QLA27XX(ha))
#define IS_PI_IPGUARD_CAPABLE(ha)	(IS_QLA83XX(ha) || IS_QLA27XX(ha))
#define IS_PI_DIFB_DIX0_CAPABLE(ha)	(0)
+23 −4
Original line number Diff line number Diff line
@@ -982,11 +982,18 @@ struct abort_entry_24xx {

	uint32_t handle;		/* System handle. */

	union {
		__le16 nport_handle;            /* N_PORT handle. */
					/* or Completion status. */
		__le16 comp_status;             /* Completion status. */
	};

	__le16	options;		/* Options. */
#define AOF_NO_ABTS		BIT_0	/* Do not send any ABTS. */
#define AOF_NO_RRQ		BIT_1   /* Do not send RRQ. */
#define AOF_ABTS_TIMEOUT	BIT_2   /* Disable logout on ABTS timeout. */
#define AOF_ABTS_RTY_CNT	BIT_3   /* Use driver specified retry count. */
#define AOF_RSP_TIMEOUT		BIT_4   /* Use specified response timeout. */


	uint32_t handle_to_abort;	/* System handle to abort. */

@@ -995,8 +1002,20 @@ struct abort_entry_24xx {

	uint8_t port_id[3];		/* PortID of destination port. */
	uint8_t vp_index;

	uint8_t reserved_2[12];
	u8	reserved_2[4];
	union {
		struct {
			__le16 abts_rty_cnt;
			__le16 rsp_timeout;
		} drv;
		struct {
			u8	ba_rjt_vendorUnique;
			u8	ba_rjt_reasonCodeExpl;
			u8	ba_rjt_reasonCode;
			u8	reserved_3;
		} fw;
	};
	u8	reserved_4[4];
};

#define ABTS_RCV_TYPE		0x54
+6 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ extern int ql2xexlogins;
extern int ql2xdifbundlinginternalbuffers;
extern int ql2xfulldump_on_mpifail;
extern int ql2xenforce_iocb_limit;
extern int ql2xabts_wait_nvme;

extern int qla2x00_loop_reset(scsi_qla_host_t *);
extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
@@ -941,6 +942,11 @@ int qla2x00_set_data_rate(scsi_qla_host_t *vha, uint16_t mode);
extern void qla24xx_process_purex_list(struct purex_list *);
extern void qla2x00_dfs_create_rport(scsi_qla_host_t *vha, struct fc_port *fp);
extern void qla2x00_dfs_remove_rport(scsi_qla_host_t *vha, struct fc_port *fp);
extern void qla_wait_nvme_release_cmd_kref(srb_t *sp);
extern void qla_nvme_abort_set_option
		(struct abort_entry_24xx *abt, srb_t *sp);
extern void qla_nvme_abort_process_comp_status
		(struct abort_entry_24xx *abt, srb_t *sp);

/* nvme.c */
void qla_nvme_unregister_remote_port(struct fc_port *fcport);
+4 −0
Original line number Diff line number Diff line
@@ -136,6 +136,10 @@ static void qla24xx_abort_iocb_timeout(void *data)
static void qla24xx_abort_sp_done(srb_t *sp, int res)
{
	struct srb_iocb *abt = &sp->u.iocb_cmd;
	srb_t *orig_sp = sp->cmd_sp;

	if (orig_sp)
		qla_wait_nvme_release_cmd_kref(orig_sp);

	del_timer(&sp->u.iocb_cmd.timer);
	if (sp->flags & SRB_WAKEUP_ON_COMP)
+6 −0
Original line number Diff line number Diff line
@@ -3571,6 +3571,7 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb)
	struct srb_iocb *aio = &sp->u.iocb_cmd;
	scsi_qla_host_t *vha = sp->vha;
	struct req_que *req = sp->qpair->req;
	srb_t *orig_sp = sp->cmd_sp;

	memset(abt_iocb, 0, sizeof(struct abort_entry_24xx));
	abt_iocb->entry_type = ABORT_IOCB_TYPE;
@@ -3587,6 +3588,11 @@ qla24xx_abort_iocb(srb_t *sp, struct abort_entry_24xx *abt_iocb)
			    aio->u.abt.cmd_hndl);
	abt_iocb->vp_index = vha->vp_idx;
	abt_iocb->req_que_no = aio->u.abt.req_que_no;

	/* need to pass original sp */
	if (orig_sp)
		qla_nvme_abort_set_option(abt_iocb, orig_sp);

	/* Send the command to the firmware */
	wmb();
}
Loading