Commit 9dd9686b authored by Darren Trapp's avatar Darren Trapp Committed by Martin K. Petersen

scsi: qla2xxx: Add changes for devloss timeout in driver

Add support for error recovery within devloss timeout, now that
FC-NVMe transport support devloss timeout.
Signed-off-by: default avatarDarren Trapp <darren.trapp@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent dbe18018
......@@ -2355,6 +2355,7 @@ typedef struct fc_port {
#define NVME_PRLI_SP_DISCOVERY BIT_3
uint8_t nvme_flag;
#define NVME_FLAG_REGISTERED 4
#define NVME_FLAG_DELETING 2
struct fc_port *conflict;
unsigned char logout_completed;
......
......@@ -5517,6 +5517,14 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
break;
}
if (fcport->fc4f_nvme) {
if (fcport->disc_state == DSC_DELETE_PEND) {
fcport->disc_state = DSC_GNL;
vha->fcport_count--;
fcport->login_succ = 0;
}
}
if (found) {
spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
continue;
......
......@@ -1910,7 +1910,7 @@ qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
} else {
switch (le16_to_cpu(sts->comp_status)) {
case CS_COMPLETE:
ret = 0;
ret = QLA_SUCCESS;
break;
case CS_ABORTED:
......@@ -1922,7 +1922,8 @@ qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
"NVME-%s ERR Handling - hdl=%x completion status(%x) resid=%x ox_id=%x\n",
sp->name, sp->handle, sts->comp_status,
le32_to_cpu(sts->residual_len), sts->ox_id);
fd->transferred_length = fd->payload_length;
fd->transferred_length = 0;
iocb->u.nvme.rsp_pyld_len = 0;
ret = QLA_ABORTED;
break;
......
This diff is collapsed.
......@@ -14,6 +14,9 @@
#include "qla_def.h"
/* default dev loss time (seconds) before transport tears down ctrl */
#define NVME_FC_DEV_LOSS_TMO 30
#define NVME_ATIO_CMD_OFF 32
#define NVME_FIRST_PACKET_CMDLEN (64 - NVME_ATIO_CMD_OFF)
#define Q2T_NVME_NUM_TAGS 2048
......@@ -31,8 +34,7 @@ struct nvme_private {
int comp_status;
};
struct nvme_rport {
struct nvme_fc_port_info req;
struct qla_nvme_rport {
struct list_head list;
struct fc_port *fcport;
};
......
......@@ -961,7 +961,7 @@ qlt_send_first_logo(struct scsi_qla_host *vha, qlt_port_logo_t *logo)
logo->cmd_count, res);
}
static void qlt_free_session_done(struct work_struct *work)
void qlt_free_session_done(struct work_struct *work)
{
struct fc_port *sess = container_of(work, struct fc_port,
free_work);
......@@ -1169,11 +1169,14 @@ void qlt_unreg_sess(struct fc_port *sess)
sess->last_rscn_gen = sess->rscn_gen;
sess->last_login_gen = sess->login_gen;
if (sess->nvme_flag & NVME_FLAG_REGISTERED)
if (sess->nvme_flag & NVME_FLAG_REGISTERED &&
!(sess->nvme_flag & NVME_FLAG_DELETING)) {
sess->nvme_flag |= NVME_FLAG_DELETING;
schedule_work(&sess->nvme_del_work);
} else {
INIT_WORK(&sess->free_work, qlt_free_session_done);
schedule_work(&sess->free_work);
}
}
EXPORT_SYMBOL(qlt_unreg_sess);
......
......@@ -1016,7 +1016,7 @@ extern void qlt_fc_port_deleted(struct scsi_qla_host *, fc_port_t *, int);
extern int __init qlt_init(void);
extern void qlt_exit(void);
extern void qlt_update_vp_map(struct scsi_qla_host *, int);
extern void qlt_free_session_done(struct work_struct *);
/*
* This macro is used during early initializations when host->active_mode
* is not set. Right now, ha value is ignored.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment