scsi: qla2xxx: Move ABTS code behind qpair
Current abort code defaults to legacy single queue where hardware_lock is used to protect command search. This patch moves this code behind the QPair where the qp_lock_ptr will reference the appropriate lock for either legacy/single queue or MQ. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
5512e52332
commit
585def9b2f
@@ -3097,22 +3097,25 @@ qla24xx_abort_command(srb_t *sp)
|
||||
struct scsi_qla_host *vha = fcport->vha;
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
struct req_que *req = vha->req;
|
||||
struct qla_qpair *qpair = sp->qpair;
|
||||
|
||||
ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x108c,
|
||||
"Entered %s.\n", __func__);
|
||||
|
||||
if (vha->flags.qpairs_available && sp->qpair)
|
||||
req = sp->qpair->req;
|
||||
else
|
||||
return QLA_FUNCTION_FAILED;
|
||||
|
||||
if (ql2xasynctmfenable)
|
||||
return qla24xx_async_abort_command(sp);
|
||||
|
||||
spin_lock_irqsave(&ha->hardware_lock, flags);
|
||||
spin_lock_irqsave(qpair->qp_lock_ptr, flags);
|
||||
for (handle = 1; handle < req->num_outstanding_cmds; handle++) {
|
||||
if (req->outstanding_cmds[handle] == sp)
|
||||
break;
|
||||
}
|
||||
spin_unlock_irqrestore(&ha->hardware_lock, flags);
|
||||
spin_unlock_irqrestore(qpair->qp_lock_ptr, flags);
|
||||
if (handle == req->num_outstanding_cmds) {
|
||||
/* Command not found. */
|
||||
return QLA_FUNCTION_FAILED;
|
||||
|
||||
Reference in New Issue
Block a user