Commit 72fcd4eb authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: Fix task mgmt handling for NPIV

Fix task management response for NPIV Target mode.
Current code uses the wrong vp index.
Signed-off-by: default avatarQuinn Tran <quinn.tran@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a14c7711
......@@ -1901,6 +1901,7 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha,
mcmd->reset_count = ha->base_qpair->chip_reset;
mcmd->tmr_func = QLA_TGT_ABTS;
mcmd->qpair = ha->base_qpair;
mcmd->vha = vha;
/*
* LUN is looked up by target-core internally based on the passed
......@@ -2003,7 +2004,7 @@ static void qlt_24xx_handle_abts(struct scsi_qla_host *vha,
static void qlt_24xx_send_task_mgmt_ctio(struct qla_qpair *qpair,
struct qla_tgt_mgmt_cmd *mcmd, uint32_t resp_code)
{
struct scsi_qla_host *ha = qpair->vha;
struct scsi_qla_host *ha = mcmd->vha;
struct atio_from_isp *atio = &mcmd->orig_iocb.atio;
struct ctio7_to_24xx *ctio;
uint16_t temp;
......@@ -3464,6 +3465,9 @@ static int __qlt_send_term_exchange(struct qla_qpair *qpair,
ql_dbg(ql_dbg_tgt, vha, 0xe009, "Sending TERM EXCH CTIO (ha=%p)\n", ha);
if (cmd)
vha = cmd->vha;
pkt = (request_t *)qla2x00_alloc_iocbs_ready(qpair, NULL);
if (pkt == NULL) {
ql_dbg(ql_dbg_tgt, vha, 0xe050,
......@@ -4379,6 +4383,7 @@ static int qlt_issue_task_mgmt(struct fc_port *sess, u64 lun,
mcmd->flags = flags;
mcmd->reset_count = ha->base_qpair->chip_reset;
mcmd->qpair = ha->base_qpair;
mcmd->vha = vha;
switch (fn) {
case QLA_TGT_LUN_RESET:
......
......@@ -959,6 +959,7 @@ struct qla_tgt_mgmt_cmd {
uint8_t fc_tm_rsp;
struct fc_port *sess;
struct qla_qpair *qpair;
struct scsi_qla_host *vha;
struct se_cmd se_cmd;
struct work_struct free_work;
unsigned int flags;
......
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