mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 19:21:26 +00:00
qla2x00t-32gbit: Do not consume srb greedily
qla2xx_process_get_sp_from_handle() will clear the slot in which the current srb is stored. As a result it can't be used in qla24xx_process_mbx_iocb_response() to check for consistency and later again in qla24xx_mbx_iocb_entry(). Move the consistency check directly into qla24xx_mbx_iocb_entry() and avoid the double call or any open coding of the qla2xx_process_get_sp_from_handle() functionality. Link: https://lore.kernel.org/r/20200929073802.18770-1-dwagner@suse.de Fixes: 31a3271ff11b ("scsi: qla2xxx: Handle incorrect entry_type entries") Reviewed-by: Arun Easi <aeasi@marvell.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> See also upstream commit 657ed8a8a61b15eba70f7c4e2b61f643cf1ba91f. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9279 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1850,6 +1850,7 @@ qla24xx_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
struct mbx_24xx_entry *pkt)
|
||||
{
|
||||
const char func[] = "MBX-IOCB2";
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
srb_t *sp;
|
||||
struct srb_iocb *si;
|
||||
u16 sz, i;
|
||||
@@ -1859,6 +1860,18 @@ qla24xx_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
if (!sp)
|
||||
return;
|
||||
|
||||
if (sp->type == SRB_SCSI_CMD ||
|
||||
sp->type == SRB_NVME_CMD ||
|
||||
sp->type == SRB_TM_CMD) {
|
||||
ql_log(ql_log_warn, vha, 0x509d,
|
||||
"Inconsistent event entry type %d\n", sp->type);
|
||||
if (IS_P3P_TYPE(ha))
|
||||
set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags);
|
||||
else
|
||||
set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
|
||||
return;
|
||||
}
|
||||
|
||||
si = &sp->u.iocb_cmd;
|
||||
sz = min(ARRAY_SIZE(pkt->mb), ARRAY_SIZE(sp->u.iocb_cmd.u.mbx.in_mb));
|
||||
|
||||
@@ -3434,32 +3447,6 @@ void qla24xx_nvme_ls4_iocb(struct scsi_qla_host *vha,
|
||||
sp->done(sp, comp_status);
|
||||
}
|
||||
|
||||
static void qla24xx_process_mbx_iocb_response(struct scsi_qla_host *vha,
|
||||
struct rsp_que *rsp, struct sts_entry_24xx *pkt)
|
||||
{
|
||||
struct qla_hw_data *ha = vha->hw;
|
||||
srb_t *sp;
|
||||
static const char func[] = "MBX-IOCB2";
|
||||
|
||||
sp = qla2x00_get_sp_from_handle(vha, func, rsp->req, pkt);
|
||||
if (!sp)
|
||||
return;
|
||||
|
||||
if (sp->type == SRB_SCSI_CMD ||
|
||||
sp->type == SRB_NVME_CMD ||
|
||||
sp->type == SRB_TM_CMD) {
|
||||
ql_log(ql_log_warn, vha, 0x509d,
|
||||
"Inconsistent event entry type %d\n", sp->type);
|
||||
if (IS_P3P_TYPE(ha))
|
||||
set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags);
|
||||
else
|
||||
set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
|
||||
return;
|
||||
}
|
||||
|
||||
qla24xx_mbx_iocb_entry(vha, rsp->req, (struct mbx_24xx_entry *)pkt);
|
||||
}
|
||||
|
||||
/**
|
||||
* qla24xx_process_response_queue() - Process response queue entries.
|
||||
* @vha: SCSI driver HA context
|
||||
@@ -3570,7 +3557,8 @@ process_err:
|
||||
(struct abort_entry_24xx *)pkt);
|
||||
break;
|
||||
case MBX_IOCB_TYPE:
|
||||
qla24xx_process_mbx_iocb_response(vha, rsp, pkt);
|
||||
qla24xx_mbx_iocb_entry(vha, rsp->req,
|
||||
(struct mbx_24xx_entry *)pkt);
|
||||
break;
|
||||
case VP_CTRL_IOCB_TYPE:
|
||||
qla_ctrlvp_completed(vha, rsp->req,
|
||||
|
||||
Reference in New Issue
Block a user