scsi: qla2xxx: Cleanup code to improve FC-NVMe error handling
This patch cleans up ABTS handling for FC-NVMe by - Removing allocation of sp, instead pass the sp pointer for abort IOCB - Fix error handling from Trasport failure - set outstanding_cmds array to NULL for nvme completion Signed-off-by: Darren Trapp <darren.trapp@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Родитель
623ee824e5
Коммит
60dd6e8e42
|
@ -1837,31 +1837,23 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
|
||||||
sp->done(sp, 0);
|
sp->done(sp, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||||
qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
|
void *tsk, srb_t *sp)
|
||||||
{
|
{
|
||||||
const char func[] = "NVME-IOCB";
|
|
||||||
fc_port_t *fcport;
|
fc_port_t *fcport;
|
||||||
srb_t *sp;
|
|
||||||
struct srb_iocb *iocb;
|
struct srb_iocb *iocb;
|
||||||
struct sts_entry_24xx *sts = (struct sts_entry_24xx *)tsk;
|
struct sts_entry_24xx *sts = (struct sts_entry_24xx *)tsk;
|
||||||
uint16_t state_flags;
|
uint16_t state_flags;
|
||||||
struct nvmefc_fcp_req *fd;
|
struct nvmefc_fcp_req *fd;
|
||||||
uint16_t ret = 0;
|
uint16_t ret = 0;
|
||||||
struct srb_iocb *nvme;
|
|
||||||
|
|
||||||
sp = qla2x00_get_sp_from_handle(vha, func, req, tsk);
|
|
||||||
if (!sp)
|
|
||||||
return;
|
|
||||||
|
|
||||||
iocb = &sp->u.iocb_cmd;
|
iocb = &sp->u.iocb_cmd;
|
||||||
fcport = sp->fcport;
|
fcport = sp->fcport;
|
||||||
iocb->u.nvme.comp_status = le16_to_cpu(sts->comp_status);
|
iocb->u.nvme.comp_status = le16_to_cpu(sts->comp_status);
|
||||||
state_flags = le16_to_cpu(sts->state_flags);
|
state_flags = le16_to_cpu(sts->state_flags);
|
||||||
fd = iocb->u.nvme.desc;
|
fd = iocb->u.nvme.desc;
|
||||||
nvme = &sp->u.iocb_cmd;
|
|
||||||
|
|
||||||
if (unlikely(nvme->u.nvme.aen_op))
|
if (unlikely(iocb->u.nvme.aen_op))
|
||||||
atomic_dec(&sp->vha->hw->nvme_active_aen_cnt);
|
atomic_dec(&sp->vha->hw->nvme_active_aen_cnt);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1895,45 +1887,30 @@ qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
|
||||||
fd->transferred_length = fd->payload_length -
|
fd->transferred_length = fd->payload_length -
|
||||||
le32_to_cpu(sts->residual_len);
|
le32_to_cpu(sts->residual_len);
|
||||||
|
|
||||||
/*
|
switch (le16_to_cpu(sts->comp_status)) {
|
||||||
* If transport error then Failure (HBA rejects request)
|
case CS_COMPLETE:
|
||||||
* otherwise transport will handle.
|
ret = QLA_SUCCESS;
|
||||||
*/
|
break;
|
||||||
if (sts->entry_status) {
|
case CS_ABORTED:
|
||||||
ql_log(ql_log_warn, fcport->vha, 0x5038,
|
case CS_RESET:
|
||||||
"NVME-%s error - hdl=%x entry-status(%x).\n",
|
case CS_PORT_UNAVAILABLE:
|
||||||
sp->name, sp->handle, sts->entry_status);
|
case CS_PORT_LOGGED_OUT:
|
||||||
|
case CS_PORT_BUSY:
|
||||||
|
ql_log(ql_log_warn, fcport->vha, 0x5060,
|
||||||
|
"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 = 0;
|
||||||
|
iocb->u.nvme.rsp_pyld_len = 0;
|
||||||
|
ret = QLA_ABORTED;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ql_log(ql_log_warn, fcport->vha, 0x5060,
|
||||||
|
"NVME-%s error - 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);
|
||||||
ret = QLA_FUNCTION_FAILED;
|
ret = QLA_FUNCTION_FAILED;
|
||||||
} else {
|
break;
|
||||||
switch (le16_to_cpu(sts->comp_status)) {
|
|
||||||
case CS_COMPLETE:
|
|
||||||
ret = QLA_SUCCESS;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CS_RESET:
|
|
||||||
case CS_PORT_UNAVAILABLE:
|
|
||||||
fcport->nvme_flag |= NVME_FLAG_RESETTING;
|
|
||||||
/* fall through */
|
|
||||||
case CS_ABORTED:
|
|
||||||
case CS_PORT_LOGGED_OUT:
|
|
||||||
case CS_PORT_BUSY:
|
|
||||||
ql_log(ql_log_warn, fcport->vha, 0x5060,
|
|
||||||
"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 = 0;
|
|
||||||
iocb->u.nvme.rsp_pyld_len = 0;
|
|
||||||
ret = QLA_ABORTED;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
ql_log(ql_log_warn, fcport->vha, 0x5060,
|
|
||||||
"NVME-%s error - 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);
|
|
||||||
ret = QLA_FUNCTION_FAILED;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
sp->done(sp, ret);
|
sp->done(sp, ret);
|
||||||
}
|
}
|
||||||
|
@ -2461,7 +2438,8 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
|
||||||
|
|
||||||
/* NVME completion. */
|
/* NVME completion. */
|
||||||
if (sp->type == SRB_NVME_CMD) {
|
if (sp->type == SRB_NVME_CMD) {
|
||||||
qla24xx_nvme_iocb_entry(vha, req, pkt);
|
req->outstanding_cmds[handle] = NULL;
|
||||||
|
qla24xx_nvme_iocb_entry(vha, req, pkt, sp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,7 @@ static void qla_nvme_poll(struct nvme_fc_local_port *lport, void *hw_queue_handl
|
||||||
spin_unlock_irqrestore(&qpair->qp_lock, flags);
|
spin_unlock_irqrestore(&qpair->qp_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int qla2x00_start_nvme_mq(srb_t *sp)
|
static inline int qla2x00_start_nvme_mq(srb_t *sp)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
uint32_t *clr_ptr;
|
uint32_t *clr_ptr;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче